Skip to content

DevTools

Inspector panels in the spirit of React Flow's DevTools, built from the canvas's own events: a live viewport readout from OnMove, a node inspector that follows every drag, and a change log fed by OnGraphChanged - one entry per completed edit, saying what kind it was, what made it and what it touched.

Node 1
Node 2
Node 3
Viewport
x: 0, y: 0, zoom: 1.00
Node Inspector
1 input (250, 20)
2 default (150, 160)
3 output (380, 160)
bit Blow

Try it

  • Drag the background to pan and scroll to zoom: the Viewport panel follows every step.
  • Drag a node: its position in the Node Inspector follows the pointer, and when you let go the log gets one Moved entry, not one per step.
  • Click a node (or Shift+click several): the inspector stars the selected ones and the log notes the new selection.
  • Drag from a handle to another node to connect them, then select something and press Delete: the log shows a Connected and a Removed entry, by the user.
  • Press Add node: the log shows an Added entry made through the API, and the node joins the inspector.
  • Press Ctrl+Z and Ctrl+Y on the canvas: undo and redo appear as Replaced entries from the history. Clear log empties the log.

How it works

  • OnMove reports the viewport on every step of a pan or zoom, so the Viewport panel is live; OnViewportChanged would report a drag-pan only once it ends.
  • OnNodeDrag is raised on every pointer move of a drag. The page does nothing in it but re-render, which is all the inspector needs to read the moving Position.
  • Measured is the size the canvas measured in the browser - empty until a node has been laid out, so the inspector shows a size only from then on - and Selected the node's selection state; both are kept up to date on the live node. OnNodesInitialized, raised once every node has been measured, re-renders the inspector with the first sizes.
  • OnGraphChanged is raised once per completed edit with a BlowGraphChange: Kind (Added, Removed, Moved, Resized, Connected, Reconnected, Replaced or Edited), Origin (User, Api, History or Remote), Label, and the Nodes, Edges, RemovedNodes and RemovedEdges it touched. It is the place to save, validate or sync.
  • OnSelectionChange reports the selected nodes and edges; selecting is not an edit, so it never reaches OnGraphChanged.
  • AddNodes(node) appends a node through the API, and HistoryEnabled turns on undo and redo, whose steps come back as Replaced changes.
  • BlowPanel pins the two panels to the pane's corners with Anchor; the log sits under the canvas, where it can grow without covering nodes.
An unhandled error has occurred. Reload 🗙