Skip to content

Handle Positions

The built-in nodes put their handles wherever SourcePosition and TargetPosition say, with no custom template. Switch the flow between left-to-right and top-to-bottom: the handles move to the matching sides and the edges leave and enter accordingly.

Input
Process
Review
Output
Arrow keys move the view, Home shows the whole flow.
bit Blow

Try it

  • Pick top to bottom: each target handle moves to the top of its node and each source handle to the bottom, the graph is laid out downwards, and the view refits.
  • Pick left to right: the handles go back to the left and right sides.
  • Drag from a handle to connect nodes in either direction: new edges leave and enter on the current sides too.

How it works

  • SourcePosition and TargetPosition (Bottom and Top by default) pick the side of the built-in source and target handles. They are also where an edge is anchored when its node has no matching handle.
  • Smooth-step edges, like every edge type, leave a handle in the direction of its side, so the same four edges read across or down.
  • A handle that moves to another side changes no node's size, which is all the canvas's resize observer watches. UpdateNodeInternals() has every node read again; this page re-renders on the change anyway, which also re-reads them, but a change made from anywhere else - a component inside a node, a timer - would not.
  • The page moves the nodes too - top to bottom is the left-to-right layout turned on its side - and eases the view to them with FitViewAsync(300).
An unhandled error has occurred. Reload 🗙