Skip to content
  1. API
  2. Types
  3. SnapOptions

SnapOptions

Type: object

Options controlling how dragged nodes snap to the grid.

Properties

  • dot(optional) boolean[=false] When true, snaps to the nearest grid intersection (both axes).
  • line(optional) boolean[=false] When true, snaps to the nearest grid line (either axis).
  • ratio(optional) number[=0.25] Fraction of cellSize that acts as the snap capture radius. Values between 0.1 and 0.4 give a natural feel.