NodeGraphInteractionState
NodeGraphInteractionState = {
kind:"idle"; } | {delta:Point2D;kind:"drag-nodes";nodeIds:ReadonlySet<string>;startWorld:Point2D; } | {blocked:boolean;containedNodeIds:ReadonlySet<string>;delta:Point2D;groupIds:ReadonlySet<string>;kind:"drag-groups";startWorld:Point2D; } | {blocked:boolean;delta:Point2D;groupId:string;handle:NodeGraphGroupResizeHandle;kind:"resize-group";startBounds: {height:number;width:number;x:number;y:number; }; } | {candidate:NodeGraphPortRef|null;currentWorld:Point2D;invalid:boolean;kind:"connect";reconnectEdgeId?:string;reconnectEnd?:"source"|"target";source:NodeGraphPortRef; } | {additive:boolean;currentWorld:Point2D;kind:"marquee";startWorld:Point2D; }
Defined in: src/components/editor/NodeGraph/NodeGraphStore.ts:56
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ kind: "idle"; }
Type Literal
Section titled “Type Literal”{ delta: Point2D; kind: "drag-nodes"; nodeIds: ReadonlySet<string>; startWorld: Point2D; }
delta:
Point2D
Cumulative drag delta in world units (snapped if grid active).
kind:
"drag-nodes"
nodeIds
Section titled “nodeIds”nodeIds:
ReadonlySet<string>
Ids of nodes being dragged together. Set (not Array) so per-node
subscribers can do O(1) membership checks in the hot per-frame
selector path — a Cartesian Array.includes was a measurable cost
at high node counts when the user dragged the whole selection.
startWorld
Section titled “startWorld”startWorld:
Point2D
Pointer-down world position (start of the drag).
Type Literal
Section titled “Type Literal”{ blocked: boolean; containedNodeIds: ReadonlySet<string>; delta: Point2D; groupIds: ReadonlySet<string>; kind: "drag-groups"; startWorld: Point2D; }
blocked
Section titled “blocked”blocked:
boolean
True when the projected positions of the dragged groups would overlap any other (non-dragged) group. The HTML overlay paints a rejection state and the pointerup handler refuses to commit when this is set.
containedNodeIds
Section titled “containedNodeIds”containedNodeIds:
ReadonlySet<string>
Ids of nodes that were fully contained inside one of the dragged
groups at gesture start. They ride along with the group(s) and
receive the same drag delta — see rectContains in nodeGraphMath.
delta:
Point2D
Cumulative drag delta (snapped if grid active).
groupIds
Section titled “groupIds”groupIds:
ReadonlySet<string>
Ids of groups being dragged together. See nodeIds for why Set.
kind:
"drag-groups"
startWorld
Section titled “startWorld”startWorld:
Point2D
Pointer-down world position.
Type Literal
Section titled “Type Literal”{ blocked: boolean; delta: Point2D; groupId: string; handle: NodeGraphGroupResizeHandle; kind: "resize-group"; startBounds: { height: number; width: number; x: number; y: number; }; }
blocked
Section titled “blocked”blocked:
boolean
Set when the resized bounds would overlap another group.
delta:
Point2D
Cumulative pointer delta in world units (snapped).
groupId
Section titled “groupId”groupId:
string
handle
Section titled “handle”handle:
NodeGraphGroupResizeHandle
kind:
"resize-group"
startBounds
Section titled “startBounds”startBounds:
object
Original bounds at the start of the resize.
startBounds.height
Section titled “startBounds.height”height:
number
startBounds.width
Section titled “startBounds.width”width:
number
startBounds.x
Section titled “startBounds.x”x:
number
startBounds.y
Section titled “startBounds.y”y:
number
Type Literal
Section titled “Type Literal”{ candidate: NodeGraphPortRef | null; currentWorld: Point2D; invalid: boolean; kind: "connect"; reconnectEdgeId?: string; reconnectEnd?: "source" | "target"; source: NodeGraphPortRef; }
candidate
Section titled “candidate”candidate:
NodeGraphPortRef|null
Hovered candidate target port, or null when none.
currentWorld
Section titled “currentWorld”currentWorld:
Point2D
Current pointer position in world coordinates.
invalid
Section titled “invalid”invalid:
boolean
Whether the candidate is currently rejected by isValidConnection.
kind:
"connect"
reconnectEdgeId?
Section titled “reconnectEdgeId?”
optionalreconnectEdgeId?:string
Set while re-dragging an existing edge’s endpoint. The edge is hidden from the edge layer for the duration so only the preview shows, and the drop either moves the endpoint, deletes the edge (detach), or — on a click with no drag — selects it.
reconnectEnd?
Section titled “reconnectEnd?”
optionalreconnectEnd?:"source"|"target"
Which end of reconnectEdgeId is being dragged.
source
Section titled “source”source:
NodeGraphPortRef
Fixed endpoint the preview draws from. For a new connection this is the port the drag started on; for a reconnect it’s the other end of the edge being edited (the one staying put).
Type Literal
Section titled “Type Literal”{ additive: boolean; currentWorld: Point2D; kind: "marquee"; startWorld: Point2D; }
additive
Section titled “additive”additive:
boolean
Whether the additive modifier was held at gesture start.
currentWorld
Section titled “currentWorld”currentWorld:
Point2D
Current pointer position in world coordinates.
kind:
"marquee"
startWorld
Section titled “startWorld”startWorld:
Point2D
Marquee start in world coordinates.