Overview
A bigger graph that puts the pieces together: the built-in node types, four edge types with labels and animation, a styled node, a widened zoom range, and the background, control bar, minimap and panel add-ons. The control bar's lock button is wired up, so the whole flow can be made read-only.
Order flow
editable
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
- Follow the edge types: the two edges out of Start are animated beziers (the default type), the two into In stock? are smooth-step, yes and no are labelled step edges, and of the last two one is a bezier and one is straight.
- Drag, connect, select and delete as on any canvas.
- Press the lock button at the bottom of the control bar: nodes can no longer be dragged, connected or selected, and the panel says so - panning and zooming still work. Press it again to unlock.
- Scroll or use the control bar to zoom anywhere from 10% to 400%; the zoom buttons disable themselves at either end.
- The minimap colours the input and output nodes in their border colours; drag in it to move the view.
How it works
- An edge's
Typepicks its path:BlowEdgeType.Bezier(the default),SmoothStep,StepandStraightare all used here.Labeldraws text at its middle andAnimatedruns dashes along it. - A node's
Styleadds inline CSS to its element: In stock? mixes a blue intovar(--bit-blow-node-bg), so the tint reads in both colour modes. MinZoomandMaxZoomwiden the zoom range from the default 0.2-2.5 to 0.1-4.BlowControlsshows its lock button only withShowInteractive="true", and the button only reports the toggle:@bind-Interactivebinds it to a field, and that field drives the canvas'sNodesDraggable,NodesConnectableandElementsSelectable.BlowMiniMap'sNodeColorFuncpicks each node's fill on the map. With it set, a selected node keeps its own colour there instead of taking the selection colour.BlowPanelwithAnchor="BlowPanelPosition.TopLeft"pins content of your own over the pane; it stays put as the graph pans and zooms.