Skip to main content

Home > @jsplumbtoolkit/core > Magnetizer > snapToGrid

Magnetizer.snapToGrid() method#

Snaps all elements to a grid. Returns a map of element IDs, representing all the elements that were moved.

Signature:

snapToGrid(grid: Grid): Dictionary<{        original: PointXY;        current: PointXY;    }>;

Parameters#

ParameterTypeDescription
gridGrid

Returns:

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