SnappingConfig
Configuration for node dragging behavior.
Properties
Section titled “Properties”computeSnapForNodeDrag()
Section titled “computeSnapForNodeDrag()”computeSnapForNodeDrag: (
node
) =>null
|Point
Computes the snap point for a node while dragging. If null is returned, a default snap point will be used.
Parameters
Section titled “Parameters”The node to compute the snap point for dragging.
Returns
Section titled “Returns”null
| Point
The snap point for the node while dragging, or null.
computeSnapForNodeSize()
Section titled “computeSnapForNodeSize()”computeSnapForNodeSize: (
node
) =>null
|Point
Computes the snap point for a node while resizing. If null is returned, a default snap point will be used.
Parameters
Section titled “Parameters”The node to compute the snap point for resizing.
Returns
Section titled “Returns”null
| Point
The snap point for the node while resizing, or null.
defaultDragSnap
Section titled “defaultDragSnap”defaultDragSnap:
Point
The default snap point for node dragging.
Default
Section titled “Default”{ x: 10, y: 10 }
defaultResizeSnap
Section titled “defaultResizeSnap”defaultResizeSnap:
Point
The default snap point for node resizing.
Default
Section titled “Default”{ x: 10, y: 10 }
shouldSnapDragForNode()
Section titled “shouldSnapDragForNode()”shouldSnapDragForNode: (
node
) =>boolean
Determines if a node should snap to grid while dragging.
Parameters
Section titled “Parameters”The node being dragged.
Returns
Section titled “Returns”boolean
True if the node should snap to grid, false otherwise.
shouldSnapResizeForNode()
Section titled “shouldSnapResizeForNode()”shouldSnapResizeForNode: (
node
) =>boolean
Determines if a node should snap to grid while resizing.
Parameters
Section titled “Parameters”The node being resized.
Returns
Section titled “Returns”boolean
True if the node should snap to grid, false otherwise.