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.
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
- 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
NodeColorFuncreturns each node's fill. Without it nodes takeNodeColor(the theme's--bit-blow-minimap-node), and a selected node the selection colour; with it, the function decides every fill, selected or not.NodeStrokeColorFuncreturns each node's outline - a theme colour for selected nodes andtransparentfor the rest - drawnNodeStrokeWidthwide (default 2, in flow units, here 3).BorderRadius(2) rounds the rectangles' corners, here 6.NodeTemplatereplaces 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.NodeClassFuncis the stylesheet route: it adds a CSS class to each rectangle instead of a colour.- The outline uses
--bit-blow-textrather than a fixed colour, so it stays visible in the dark colour mode.