Node Extents
Four ways to limit where a node can be dragged: a rectangle of its own (Extent), its parent's box (ExtentParent), a parent that grows to keep its child enclosed (ExpandParent), and a rectangle no root node may leave (the canvas's NodeExtent).
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
- Drag Own extent around: it stops at the amber outline, the rectangle in its own
Extent. - Drag Pinned inside towards its group's border: it stops there.
- Drag Push the edges past its group's border: the group grows to keep it enclosed. Past the left or top edge the group's corner moves out instead, so nothing else on screen jumps.
- Tick fence in the root nodes: a violet outline appears, and neither the free node nor the two groups can be dragged out of it. Own extent keeps to its own rectangle, which takes precedence.
- Select a node and use the arrow keys: the nudges respect the same limits.
- Press Reset positions to put everything back.
How it works
BlowNode.Extentis aBlowRectthe node cannot leave, written in its own coordinate space - relative to its parent when it has one.ExtentParent = truekeeps a child inside its parent's box (React Flow'sextent: 'parent').ExpandParent = truegrows the parent instead when the child is dragged past its edge. It is ignored whenExtentParentis set.- The canvas's
NodeExtentis a rectangle no root node may leave - bound to null here while the box is unticked. It does not apply to children, whose positions are in their parent's space. ExtentParentwins overExtent, which wins overNodeExtent. The same limits hold for arrow-key nudges, align and distribute, and resizing.- The outlines are plain elements in a
BlowViewportPortal, which renders inside the zoomed layer, so they pan and zoom with the nodes.