Skip to content

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.

yesno
Start
Fetch orders
Fetch stock
In stock?
Reserve
Back-order
Ship
Notify buyer
Arrow keys move the view, Home shows the whole flow.
Order flow editable
bit Blow

Try 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 Type picks its path: BlowEdgeType.Bezier (the default), SmoothStep, Step and Straight are all used here. Label draws text at its middle and Animated runs dashes along it.
  • A node's Style adds inline CSS to its element: In stock? mixes a blue into var(--bit-blow-node-bg), so the tint reads in both colour modes.
  • MinZoom and MaxZoom widen the zoom range from the default 0.2-2.5 to 0.1-4.
  • BlowControls shows its lock button only with ShowInteractive="true", and the button only reports the toggle: @bind-Interactive binds it to a field, and that field drives the canvas's NodesDraggable, NodesConnectable and ElementsSelectable.
  • BlowMiniMap's NodeColorFunc picks each node's fill on the map. With it set, a selected node keeps its own colour there instead of taking the selection colour.
  • BlowPanel with Anchor="BlowPanelPosition.TopLeft" pins content of your own over the pane; it stays put as the graph pans and zooms.
An unhandled error has occurred. Reload 🗙