Skip to content

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.

Drag me
to me
or me
bit Blow

Try 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 AllowSelfConnections needs 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 its Style to 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 default Strict mode 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 EdgeTemplate ignores the handles: BlowGraphUtils.GetFloatingEdgeParams(source, target) finds the point and side on each node's border facing the other, BlowEdgePath.Compute turns them into a straight path, and BlowBaseEdge draws 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.
An unhandled error has occurred. Reload 🗙