Skip to main content

Home > @jsplumbtoolkit/core > AbstractLayout > setPosition

AbstractLayout.setPosition() method#

Sets the position of the node/group with the given id, and recalculates the extents.


setPosition(id: string, x: number, y: number, doNotCalculateExtents?: boolean): Dictionary<{        original: PointXY;        current: PointXY;    }>;


idstringID of the node/group to move
xnumberLeft position
ynumberTop position.
doNotCalculateExtentsbooleanIf 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.


Dictionary<{ original: PointXY; current: PointXY; }>