Touch Device
Every gesture is built on pointer events, so dragging nodes, panning, connecting and pinch-zooming work with a finger as they do with a mouse. The toolbar covers what a touch screen lacks: no Shift key to box-select with, and handles small enough to miss. Open it on a phone or tablet, or with your browser's device emulation.
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
- Touch and drag a node to move it, and drag the empty background with one finger to pan.
- Pinch with two fingers to zoom about the point between them. Untick Pinch to zoom and a second finger no longer zooms - the first carries on with whatever it was doing - while the control bar's buttons still zoom.
- Drag from a handle to another node's handle to connect them; letting go near a handle is enough.
- Tick Tap to connect, then tap a handle and tap another node's handle: the two are connected with no drag at all. Tapping empty space abandons it.
- Tick Drag to select: a one-finger drag on the empty background now draws a selection box instead of panning, and the label beside it says which.
- Tap a node or an edge to select it, or the background to clear the selection.
How it works
- The canvas listens for pointer events, which a mouse, a pen and a finger all raise, and sets
touch-action: noneon itself while a one-finger drag pans or draws a selection box, so a finger on it is a gesture of the flow rather than a scroll of the page. WithPanOnDragandSelectionOnDragboth off, a swipe on the background scrolls the page instead, and the nodes and handles that can be dragged still drag. ZoomOnPinch(on) zooms on a two-finger pinch about the fingers' midpoint - the only way to zoom on a touch screen besides the control bar.SelectionOnDrag(off) turns a plain drag on the pane into a box selection; with a keyboard, Shift (SelectionKey) does that for a single drag.ConnectOnClick(off) connects with two taps as well as a drag. A connection dropped withinConnectionRadius(20 screen pixels) of a handle snaps to it, and every handle's hit area stays at least--bit-blow-handle-hit-size(12px) across on screen at any zoom.BlowControlsandBlowMiniMaptake taps as well; on a phone-sized screen this site hides the minimap, which would cover the nodes.