Skip to main content
Version: 4.3

SnaplinesIsSnapTargetParams

Params passed to the SnaplinesIsSnapTarget callback (the <Snaplines isSnapTarget> prop).

  • id / model describe the active (moving / resizing) element, the subject of the snap operation, the same meaning as model in canSnap and additionalSnapPoints.
  • targetId / targetModel describe the candidate snap target being evaluated: return true if it should be a snap target for model, false to exclude it.

The pair lets you write proximity- and relation-based filters such as "skip targets in a different swim-lane" or "only snap to targets within 200px of the active element".

Extends

Properties

graph

readonly graph: Graph;

The graph the element belongs to.

id

readonly id: ID;

Id of the active element (the one being dragged or resized).

model

readonly model: Element;

The active element model being dragged or resized.

paper

readonly paper: Paper;

The paper the element belongs to.

targetId

readonly targetId: ID;

Id of the candidate snap target being evaluated.


targetModel

readonly targetModel: Element;

The candidate snap-target element being evaluated against the active element.

Stay in the know

Be where thousands of diagramming enthusiasts meet

Star us on GitHub