Easy Connect
Each node is almost entirely covered by one connectable handle, so a connection starts and ends anywhere inside a node instead of on an 8px dot. Loose connection mode lets that single handle take both ends of an edge, and floating edges attach to whichever side faces the other node.
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
- Press anywhere inside the dashed outline of a node and drag: a connection starts. Release anywhere over another node to connect the two.
- Drag a node by its rim - the thin strip outside the dashed outline - to move it; its edges slide round to the side that faces the other node.
- Release over the node you started from: nothing is connected. The canvas refuses self-connections by default, and even
AllowSelfConnectionsneeds two different handles - each node here has one. - Click an edge to select it and press Delete or Backspace to remove it.
How it works
- Each node draws a single
BlowHandle, stretched by itsStyleto 8px inside the node (position:absolute; inset:8px; width:auto; height:auto; transform:none). The rim outside it is still the node, so pressing there drags. ConnectionMode="BlowConnectionMode.Loose"lets any handle connect to any other. The only handle here is a source, and in the defaultStrictmode a source can never be dropped on another source.- A drop counts anywhere over the target handle, because the canvas looks for the handle under the pointer; within
ConnectionRadius(20px) of a handle's centre it also snaps to it. - A handle's anchor is its centre, so here the line drawn while connecting starts in the middle of the node;
ConnectionLineType="BlowEdgeType.Straight"draws it straight, like the edges. - The
EdgeTemplateignores the handles:BlowGraphUtils.GetFloatingEdgeParams(source, target)finds the point and side on each node's border facing the other,BlowEdgePath.Computeturns them into a straight path, andBlowBaseEdgedraws it, together with the wide invisible path that makes a thin edge easy to click. - The node's
Class,easy-shell, strips the default node chrome (padding, border, minimum width) so the node draws its own box, edge to edge.