Basic Flow
Every default gesture on one canvas: a BlowCanvas over your own List<BlowNode>
and List<BlowEdge>, which it edits in place as you drag, connect, select and delete - with
a background, the control bar, a minimap and a panel of your own on top. The
Interactions page switches these gestures on and off.
Press Tab to move between the nodes and edges of the diagram.
Press Enter or Space to select it, Shift with Enter to add it to the selection, the arrow keys to move the selected nodes, Delete to remove them and Escape to clear the selection. Press C to start a connection from it.
Press Enter or Space to select it, Delete to remove it and Escape to clear the selection. Press C to move its end to another node.
bit BlowTry it
- Drag a node to move it; its edges follow. Hold it against the canvas border and the view scrolls along with it.
- Drag from a handle (the dot on a node's edge) and let go on another node's handle to connect them. Let go on empty space and nothing is added.
- Click a node or an edge to select it, Shift+click to add to the selection, and Shift+drag the background to draw a selection box. Escape clears the selection.
- Press Delete or Backspace to remove what is selected; deleting a node takes its edges with it.
- Drag the background to pan, scroll to zoom toward the cursor and double-click the background to zoom in (Shift+double-click zooms out). On a touch screen, pinch with two fingers.
- The control bar in the bottom-left corner zooms in, zooms out and fits the whole graph in view.
- Click or drag in the minimap in the bottom-right corner to move the view there.
- Add node drops a new node at a random spot on the canvas.
- Press Tab to move through the edges and nodes, Enter to select the focused one and the arrow keys to move the selected nodes.
How it works
NodesandEdgesare plain lists; the canvas adds, moves and removes items in them directly, so the page's state is always the graph on screen.- A node's
Typepicks the built-in look:inputhas only a source handle,outputonly a target handle, and the default has both. - An edge joins
SourcetoTargetby node id;Animatedruns dashes along it andLabeldraws text at its middle. FitViewOnInitzooms the graph to fit once the nodes have been measured.OnConnectis raised after the canvas has already added the new edge toEdges, so it is only for side effects - here it writes a line to the browser's console.BlowBackgrounddraws the dot pattern (Variant="Dots",Gap="20").BlowControlsshows zoom in, zoom out and fit view; its lock button stays hidden unlessShowInteractiveis set.BlowMiniMapisPannableby default (Zoomableis off).BlowPanel Position="top-right"holds the button over the canvas, unaffected by pan and zoom; a press inside a panel never starts a pan.- Add node adds a
BlowNodeto_nodes. The page re-renders after the click, and the canvas picks the new node up and measures it - no call into the canvas is needed.