Skip to content

SnappingConfig

Configuration for node dragging behavior.

computeSnapForNodeDrag: (node) => null | Size

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

Node

The node to compute the snap size for dragging.

null | Size

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

() => null

computeSnapForNodeSize: (node) => null | Size

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

Node

The node to compute the snap size for resizing.

null | Size

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

() => null

defaultDragSnap: Size

The default snap size for node dragging.

{ width: 10, height: 10 }

defaultResizeSnap: Size

The default snap size for node resizing.

{ width: 10, height: 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.

() => false

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.

() => false