Automatically arrange multiple trees within a group into a clean grid.
When you have multiple mind map trees inside a canvas group, forest layout arranges them into a tidy grid.
How to trigger
From the Map outline — right-click a group > "Layout forest"
From the canvas — right-click a group on the canvas > "Layout forest"
From the command palette — select a node inside a group, then run "Layout forest"
How it works
Each tree's internal layout is recalculated first (contour-based packing)
Trees are sorted in reading order (top-to-bottom, left-to-right)
Trees are flow-packed into rows targeting a square-ish grid shape
The group resizes to fit all trees with padding
Grid shape
The algorithm uses ceil(sqrt(N)) trees per row with average tree width to determine row breaks. For example:
4 trees → 2×2 grid
9 trees → 3×3 grid
12 trees → 4×3 grid
Spacing
Trees have wider gaps between them than nodes within a tree (1.5x horizontal, 3x vertical) for clear visual separation.
Drag and drop
Drag a tree from the Map outline into a group. The entire subtree moves together, preserving the left/right arrangement of children. Forest layout runs automatically after the drop.