Skip to content
Entangle UI v0.13.0

UseNodeGraphReturn

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:64

addGroup: (bounds, options?) => string

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:109

Append a group. Returns the group id.

WorldRect

AddGroupOptions

string


addNode: (node) => string

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:76

Append a node (generating an id when omitted). Returns the node id.

NodeGraphNodeInput

string


bind: NodeGraphBind

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:116

Spread onto <NodeGraph {...bind} /> to wire all four controlled props.


clearSelection: () => void

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:113

Clear the selection.

void


connect: (source, target, data?) => string

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:103

Add an edge between two ports, de-duplicating identical endpoints. Returns the new (or existing) edge id.

NodeGraphPortRef

NodeGraphPortRef

unknown

string


disconnectPort: (node, port) => void

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:85

Remove every edge connected to a port — “detach all” for one socket.

string

string

void


duplicateNodes: (ids?, options?) => string[]

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:95

Clone nodes (defaults to the current selection), append the copies, and select them. Returns the new node ids.

readonly string[]

DuplicateNodesOptions

string[]


edges: NodeGraphEdge[]

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:66


groups: NodeGraphGroup[]

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:67


nodes: NodeGraphNode[]

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:65


removeEdges: (ids) => void

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:83

Remove the given edges and prune them from the selection.

readonly string[]

void


removeGroups: (ids) => void

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:111

Remove the given groups and prune them from the selection.

readonly string[]

void


removeNodes: (ids) => void

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:81

Cascade-delete the given nodes — removes them, drops any edge touching them, and prunes them from the selection.

readonly string[]

void


removeSelection: () => void

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:90

Cascade-delete the current selection (nodes + edges + groups) and clear it — the programmatic equivalent of pressing Delete.

void


selection: NodeGraphSelection

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:68


setEdges: Dispatch<SetStateAction<NodeGraphEdge[]>>

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:71


setGroups: Dispatch<SetStateAction<NodeGraphGroup[]>>

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:72


setNodes: Dispatch<SetStateAction<NodeGraphNode[]>>

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:70


setSelection: Dispatch<SetStateAction<NodeGraphSelection>>

Defined in: src/components/editor/NodeGraph/useNodeGraph.ts:73