Skip to content

Auto Pan & Pinch

The view follows what you are doing: drag a node or a connection against the edge of the canvas and the viewport scrolls along, so a graph larger than the screen can still be edited; tab to a node out of sight and it pans into view. On a touch screen two fingers pinch to zoom.

Drag me to the edge
Node 2
Node 3
Tab to me
Arrow keys move the view, plus and minus zoom, Home shows the whole flow.
x 0 · y 0 · zoom 1.00
bit Blow

Try it

  • Drag "Drag me to the edge" toward any side of the canvas and hold it there: once the pointer enters the dashed band, the view scrolls to follow - watch x and y in the readout and the frame in the minimap - and the node stays under the pointer.
  • Drag from a handle toward the edge: the view follows a connection being drawn in the same way.
  • Raise Speed to scroll faster, and Margin to widen the band where auto-pan starts.
  • Untick Pan on node drag or Pan on connect: the view now stays still, and a node or a connection taken past the edge goes out of sight with the pointer.
  • Click the canvas and press Tab until focus reaches "Tab to me", which starts out of sight beyond the bottom-right: the view pans just far enough to show it, over the Focus pan time (0 jumps). Untick Pan to focused node and focus goes there unseen.
  • On a touch screen, put two fingers on the canvas and pinch to zoom about the point between them; untick Pinch to zoom to stop it.

How it works

  • AutoPanOnNodeDrag and AutoPanOnConnect (both true) scroll the viewport while a node or a connection is dragged within AutoPanMargin screen pixels (30) of the pane's border.
  • AutoPanSpeed (15) is the distance in screen pixels per step, about sixty steps a second, and it keeps going while the pointer is held still against the edge. The drag is tracked in flow coordinates, so what you hold stays under the pointer while the view moves.
  • AutoPanOnNodeFocus (true) pans a node that receives keyboard focus into view - only as far as needed - over AutoPanOnNodeFocusDuration milliseconds (200).
  • ZoomOnPinch (true) zooms about the midpoint between two fingers - the only way to zoom on a touch screen, which is why it is on by default.
  • OnMove streams the BlowViewport while the view travels and OnViewportChanged reports where it settles; both feed the readout. OnNodeDragStart/OnNodeDragStop and OnConnectStart/OnConnectEnd show and hide the band.
  • FitViewOptions with Nodes fits the first view to three of the four nodes, which leaves the fourth off screen for the Tab step.
An unhandled error has occurred. Reload 🗙