Default Node Overwrite
Replace the look of the built-in 'default' node type and keep the rest: the NodeTemplate draws every default node as a card with an accent bar, and hands input and output nodes back to BlowDefaultNode so they keep their built-in look.
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
- Compare Custom default A and B with Input and Output: the two default nodes are drawn by the template, as cards with an accent bar; the other two keep the built-in look.
- Untick overwrite the default node: the cards go back to the built-in default node. Tick it again to bring them back.
- Drag, connect and select as usual: a template changes how a node looks, not how it behaves.
How it works
NodeTemplaterenders the content of every node. Itsnode.Type == "default"branch draws the card, and<BlowDefaultNode Node="node" />draws every other type exactly as the canvas would without a template.- A node whose
Typeis not set is a"default"node, so the two nodes with no type get the card. - The template places its own
BlowHandles and passes themnode.TargetPositionandnode.SourcePosition(TopandBottomunless a node says otherwise), as the built-in renderer does. - The template renders inside the node element, so the card keeps the node's border, padding and selection ring; a rule on
.bit-blow-node-defaultwould restyle that frame too. - The checkbox is read inside the template: changing it re-renders this page, and with it every node.