Skip to content

Reconnect Edge

A selected edge shows a dot at each end; drag one onto another handle and the edge is rewired in place, keeping its id. OnReconnectStart, OnReconnect and OnReconnectEnd report the gesture - the last one says whether it rewired anything, the usual cue to delete an edge dropped on nothing.

drag my endsReconnectable = false
A
B
C
D
bit Blow

Try it

  • Click the edge labelled drag my ends: a small dot appears at each end.
  • Drag the dot at B onto the top dot of C or D: the edge now ends there, and the log shows the start, the new wiring under the same id, and an end that rewired it.
  • With the edge selected, tick Show grab area and move Grab radius: the shaded circle round each dot is how close the pointer has to come to pick that end up, the same on screen at any zoom.
  • Click the edge labelled Reconnectable = false: no dots appear, so its ends stay where they are.
  • Drop an end on the empty pane: the edge stays as it was and the log reports an end that did not rewire. Tick Delete an edge dropped on nothing first and the edge is removed instead - but press Escape in the middle of a drag and it is kept, since giving up is not a drop.
  • Untick Edges reconnectable: no edge shows its dots any more.
  • From the keyboard: Tab to the edge and press C to pick up its target end (C again for the source end), Tab to another node and press Enter to attach it, or Escape to give up.
  • Reset puts both edges back as they started.

How it works

  • The end dots show on a selected edge when EdgesReconnectable (on by default) and the edge's own Reconnectable (true by default) both allow it; selecting needs ElementsSelectable.
  • ReconnectRadius (10 by default) is the radius, in screen pixels, of the invisible circle round each dot that picks it up; the checkbox paints the bit-blow-edge-reconnect-hit circle that draws it.
  • OnReconnectStart receives a BlowEdgeReconnectStart: the Edge and its MovingEnd, the end being moved (Source or Target).
  • OnReconnect receives a BlowEdgeReconnect: the Edge, already rewired in place with its Id unchanged, and the new Connection.
  • OnReconnectEnd receives a BlowEdgeReconnectEnd whichever way the gesture ended: Edge, MovingEnd and Rewired. Rewired is false when the end did not attach - dropped on the pane or on a handle that refuses it, or abandoned with Escape.
  • OnConnectEnd follows it for the same gesture, with IsReconnect set; its IsDropped is true only for a real drop, so the page deletes an edge that did not rewire only when IsDropped says it was let go on nothing, not when the gesture was cancelled.
  • Every connection rule applies to the moved end as it does to a new connection; dropping it back where it came from is allowed, since the edge does not count as a duplicate of itself.
An unhandled error has occurred. Reload 🗙