Home > @jsplumbtoolkit/browser-ui > Surface > setMagnetizedPosition
Surface.setMagnetizedPosition() method
Sets the position of the given node/group and runs the magnetizer. This operation is wrapped in a transaction on the Toolkit so if undo is called then every element affected by the magnetize is relocated.
Signature:
setMagnetizedPosition(vertex: string | Node | Group | Element, x: number, y: number, doNotUpdateElement?: boolean): Record<string, {
original: PointXY;
current: PointXY;
}>;
Parameters
Parameter | Type | Description |
---|---|---|
vertex | string | Node | Group | Element | |
x | number | |
y | number | |
doNotUpdateElement | boolean |
Returns:
Record<string, { original: PointXY; current: PointXY; }>