Node Drag Threshold
NodeDragThreshold is how far, in screen pixels, the pointer has to travel before a press on a node
starts moving it. A higher threshold keeps a shaky click from nudging nodes out of place; the line above the
canvas tells you what each gesture did.
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
- Click a node without moving the pointer: it is selected, stays put, and counts as a click.
- Press a node and move the pointer a little - less than the threshold - before letting go: the node is selected but does not move. Past a few pixels it no longer counts as a click either.
- Drag a node further than the threshold: it stays put until the pointer has travelled that far, then catches up with the pointer and follows it.
- Move Threshold down to 0 or 1 and every small wobble moves the node; move it up to 80 and only a deliberate drag does.
- Press Escape in the middle of a drag: the node goes back to where it started.
How it works
NodeDragThreshold(default 1) is measured from the point where the node was pressed, in screen pixels, so it feels the same at any zoom. Until the pointer has gone that far the node is not moved.NodeClickDistance(default 3) is how far the pointer may travel and still count as a click: beyond itOnNodeClickis not raised. A gesture between the two distances neither moves the node nor clicks it.OnNodeDragStartis raised when the node is pressed andOnNodeDragStopwhen it is let go, whether or not it moved; the page compares the node'sPositionat the two to tell a move from a press.OnNodeClickis raised after the release, for a press that stayed withinNodeClickDistance.- The node is selected on the press itself, which is why it selects whatever the threshold.