Connector API

Svelte Connector props, rules and defaults, surfaces, and object access.

Connector must render inside a Node. It owns (or adopts) a core ConnectorMirror registered against the parent node.

PropMeaning
idStable domain identity; minted when omitted — supply it for persistence
nameRequired. The connector’s key within its parent node
rulesPartial<ConnectorRules> admission rules (see below)
metadataSnapLineMetadata attached to the connector
callbacksConnectorCallbacks (pointer, candidate, connection events)
surfaceStrategiesCustom source/target hit-test and anchor strategies
virtualKeep the logical connector without rendering a port element; surfaces resolve against the parent node
colliderRadiusPointer pickup radius override
edgePanPan the camera when dragging a line near the viewport edge (default true)
connectorObjectAdopt an existing ConnectorMirror
dataExtra data-* attributes for the port element

object() returns the underlying ConnectorMirror. name and connectorObject are construction-time identities; every other prop is reactive, including virtual.

Connection rules

RuleDefaultMeaning
maxOutgoing"unlimited"Maximum outgoing lines (previews reserve a slot); 0 makes the connector target-only
maxIncoming1Maximum settled incoming lines; 0 makes the connector source-only
reconnecttrueAllow dragging a settled line’s end to a new target
allowParallelfalseBoth endpoints must allow parallel lines between the same pair
onFull"reject"Policy when a proposal would exceed maxIncoming: "reject" it, or "replace-oldest" to evict the oldest incoming lines
isValidConnectionLine-aware admission predicate; synchronous and side-effect free, called repeatedly during candidate discovery and rechecked on drop. Either endpoint may veto

An omitted rules prop therefore yields an unlimited-outgoing, single-incoming connector that rejects extra incoming lines.

Warning

Topology methods on ConnectorMirror such as createLine, deleteLine, deleteAllLines, and disconnectFromConnector are @internal. Change topology by updating your canonical LineRecords through ControlledGraph.