Skip to main content

Home > @jsplumbtoolkit/core > MagnetizerRunOptions > constrain

MagnetizerRunOptions.constrain property#

Optional function used to constrain the movement of elements when the magnetizer is being applied. An example of this in use in the Toolkit is in the label spacer module, in which the magnetizer is used to ensure labels do not overlap, but their movement is limited to travel along the path inscribed by the connector to which they belong.


constrain?: MagnetizerConstrainFunction;