Skip to content

Use Node Connections

Click a node to see what it is wired to: the canvas's GetNodeConnections lists its incoming and outgoing connections, GetHandleConnections narrows them to one handle, and BlowGraphUtils names its neighbours. The panel follows the graph as you connect and delete.

Split
2
3
Merge
bit Blow

Try it

  • Click a node: the panel under the canvas lists its incoming and outgoing connections, how many edges each of its handles has, and its neighbours.
  • Click Split or Merge: they have two named handles each, so the per-handle counts tell left from right and a from b, and each connection names its handle after a dot.
  • Drag from a handle to another node to add a connection, or select an edge and press Delete: the panel updates at once.
  • Delete the node you clicked (select it, then Delete or Backspace) and the panel empties rather than describing a node that is gone.

How it works

  • GetNodeConnections(nodeId, type, handleId) on the canvas returns the BlowConnections attached to a node - all of them, or only those where it is the Target or the Source, or only those at one handle id. It is React Flow's getNodeConnections.
  • GetHandleConnections(nodeId, type, handleId) is the same for one handle, React Flow's getHandleConnections. A null handleId does not filter by handle, which for a node with one unnamed handle of each type - 2 and 3 here - is the same thing.
  • Both are also static on BlowGraphUtils, taking the edge list, for code with no canvas at hand; the canvas versions read its current Edges.
  • BlowGraphUtils.GetIncomers and GetOutgoers return the neighbouring nodes, and GetConnectedEdges the edges touching any of the given nodes.
  • Split and Merge are built-in input and output nodes that declare Ports; a built-in node draws one handle per declared port, spread along its side, so they get named handles without a template.
  • OnNodeClick picks the node; no-op NodesChanged and EdgesChanged handlers re-render the page after every edit, so the panel stays current.
An unhandled error has occurred. Reload 🗙