Skip to content

SnappingConfig

Configuration for node dragging behavior.

computeSnapForNodeDrag: (node) => null | Point

Computes the snap point for a node while dragging. If null is returned, a default snap point will be used.

Node

The node to compute the snap point for dragging.

null | Point

The snap point for the node while dragging, or null.


computeSnapForNodeSize: (node) => null | Point

Computes the snap point for a node while resizing. If null is returned, a default snap point will be used.

Node

The node to compute the snap point for resizing.

null | Point

The snap point for the node while resizing, or null.


defaultDragSnap: Point

The default snap point for node dragging.

{ x: 10, y: 10 }

defaultResizeSnap: Point

The default snap point for node resizing.

{ x: 10, y: 10 }

shouldSnapDragForNode: (node) => boolean

Determines if a node should snap to grid while dragging.

Node

The node being dragged.

boolean

True if the node should snap to grid, false otherwise.


shouldSnapResizeForNode: (node) => boolean

Determines if a node should snap to grid while resizing.

Node

The node being resized.

boolean

True if the node should snap to grid, false otherwise.