Skip to main content

Home > @jsplumbtoolkit/browser-ui > SurfaceMagnetizeOptions

SurfaceMagnetizeOptions interface

Options for the magnetize functionality of the Surface.

Signature:

export interface SurfaceMagnetizeOptions 

Properties

PropertyModifiersTypeDescription
afterDrag?boolean(Optional) If true, magnetizer will be run after a vertex is dragged.
afterGroupCollapse?boolean(Optional) Defaults to false. Indicates the surface should gather nodes around a newly collapsed group
afterGroupExpand?boolean(Optional) Defaults to false. Indicates the surface should magnetize nodes around a newly expanded group
afterGroupGrow?boolean(Optional) Defaults to false. Indicates the surface should magnetize/gather nodes around a newly resized group if the group size was enlarged.
afterGroupResize?boolean(Optional) Defaults to false. Indicates the surface should magnetize/gather nodes around a newly resized group, regardless of whether the group size grew or if it shrunk. This flag is the same as setting afterGroupShrink and afterGroupGrow
afterGroupShrink?boolean(Optional) Defaults to false. Indicates the surface should magnetize/gather nodes around a newly resized group if the group size was reduced.
afterLayout?boolean(Optional) If true, magnetizer will be run after the layout is run.
constant?boolean(Optional) If true, magnetizer will be run constantly as a vertex is being dragged, pushing other vertices out of the way of the vertex that is being dragged
constrainToViewport?boolean(Optional) If true, vertices moved by the magnetizer will be constrained to move within the visible viewport, which is a function of the current zoom/pan of the surface. Otherwise, vertices will be able to be pushed out of the visible viewport.
repositionDraggedElement?boolean(Optional) If true, and afterDrag is true, when the magnetizer is run after a drag it will be the recently dragged element that moves in precedence to the other elements. By default, the recently dragged element is _not_ moved by the magnetize operation - it stays where you dragged it.