Self-Connections
An edge back to the node it left has no route between two nodes to compute, so every ordinary path algorithm would collapse onto the node itself. Blow loops it clear instead - whatever its Type, and wherever its two handles sit - and AllowSelfConnections lets the user draw one.
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 three loops: Retry goes from its right handle round the bottom to its left one, Poll from its right handle round the corner to its top one, and Recurse from its bottom handle round the side to its top one.
- Move Loop radius: every loop swings further out from its node or tucks in closer.
- Change Path type: the edge from Poll down to Recurse changes shape, while the loops stay loops whatever the type.
- Untick Animated loops to stop the dash marching round them.
- Drag from a node's right or bottom handle back to its own top or left handle: a new loop appears, with the current radius, type and animation.
- Drag a node: its loop travels with it.
How it works
- An edge whose
SourceandTargetare the same node is drawn as a loop that swings clear of the node, itsTypeignored: a bezier or a step between two handles of one node would run through the node. SourceHandleandTargetHandlepick the two handles by id, so the same node can loop across itself, round a corner or round a side.BlowEdgePathOptions.LoopRadius(60 by default) is how far the loop stands off its node; the slider sets it on every loop through each edge'sPathOptions.- Such an edge can always be put in the
Edgeslist.AllowSelfConnections(off by default) lets the user draw one, and only between two different handles;ConnectionRadius, raised from 20 to 30 here, is how near a handle a release still snaps to it. OnConnectfires once the new edge is in the list, so the page restyles it there with the others.