Skip to main content

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

ParameterTypeDescription
vertexstring | Node | Group | Element
xnumber
ynumber
doNotUpdateElementboolean

Returns:

Record<string, { original: PointXY; current: PointXY; }>