Home > @jsplumbtoolkit/core > AbstractLayout > setPosition
AbstractLayout.setPosition() method
Sets the position of the node/group with the given id, and recalculates the extents.
Signature:
setPosition(id: string, x: number, y: number, doNotCalculateExtents?: boolean): Record<string, {
original: PointXY;
current: PointXY;
}>;
Parameters
Parameter | Type | Description |
---|---|---|
id | string | ID of the node/group to move |
x | number | Left position |
y | number | Top position. |
doNotCalculateExtents | boolean | If true, do not recalculate the layout extents. we use this during a layout run, as we dont need to calculate the extents until it is finished. But for a single setPosition call, we do want to recalculate extents. |
Returns:
Record<string, { original: PointXY; current: PointXY; }>