Skip to content

Custom MiniMap Node

Make the minimap say something about the graph: colour its nodes by type and outline the selected ones with NodeColorFunc and NodeStrokeColorFunc, or draw each one as your own SVG shape with NodeTemplate.

Input
Default A
Default B
Output A
Output B
Arrow keys move the view, Home shows the whole flow.
bit Blow

Try it

  • Look at the minimap in the bottom-right corner: each node is filled with its type's colour from the legend.
  • Click a node to select it, or Shift+click several: each selected node gets an outline on the map. Click the background to clear it.
  • Switch Map nodes to Own SVG shapes: the input becomes a circle, the outputs diamonds and the rest pills, still coloured by type and outlined while selected.
  • Drag a node on the canvas and its shape follows on the map; drag on the map to move the view.

How it works

  • NodeColorFunc returns each node's fill. Without it nodes take NodeColor (the theme's --bit-blow-minimap-node), and a selected node the selection colour; with it, the function decides every fill, selected or not.
  • NodeStrokeColorFunc returns each node's outline - a theme colour for selected nodes and transparent for the rest - drawn NodeStrokeWidth wide (default 2, in flow units, here 3). BorderRadius (2) rounds the rectangles' corners, here 6.
  • NodeTemplate replaces the rectangle with any SVG you write, translated to the node's position; node.GetRect() gives its size. The rectangle's own options - the colour and stroke functions, the radius - no longer apply, so the template draws its own fill and outline.
  • NodeClassFunc is the stylesheet route: it adds a CSS class to each rectangle instead of a colour.
  • The outline uses --bit-blow-text rather than a fixed colour, so it stays visible in the dark colour mode.
An unhandled error has occurred. Reload 🗙