Core concepts and connections
Understand engines, nodes, connectors, lines, coordinates, and ownership.
Object model
- One SnapEngine supplies input dispatch, scheduling, collision data, and the camera coordinate transform.
- A
NodeMirrorowns connector objects and mirrors one node record of your graph document. - A
ConnectorMirrordescribes direction, capacity, metadata, and connection policy. - A
LineMirrorjoins two connectors and keeps its SVG path attached while either node moves.
Connector rules are symmetric limits: maxIncoming/maxOutgoing accept a
count, 0 (disables that direction), or the explicit "unlimited". A
source-only output is { maxIncoming: 0 }; a single-input port is { maxOutgoing: 0, maxIncoming: 1 }. Omitted rules default to maxOutgoing: "unlimited", maxIncoming: 1, reconnect: true, allowParallel: false, and onFull: "reject". onFull decides what happens
when a proposal would exceed maxIncoming: "reject" refuses it, while "replace-oldest" evicts the oldest incoming lines to make room — useful for
single-input ports that should adopt the newest connection. Topology is
always controlled — lines exist because your document’s LineRecords say so,
and gestures propose changes through ControlledGraph’s onLineChangeRequest; imperative topology methods like deleteLine are @internal and not part of the public API.
Coordinates
Persist node positions in world space. Browser pointer positions begin in screen space, pass through camera space, and then become world positions. Placement callbacks report all three useful representations instead of making applications repeat that conversion.
Rendering ownership
Core objects never insert, remove, or reparent framework-rendered elements.
Adapters render collections and dimensions; core updates transforms, SVG
geometry, and data-selected. This rule keeps React and Svelte reconciliation
authoritative.