village-builder

VB-095: Family tree by scope, fast at full scale

Status: done (2026-11-25) Priority: 3 Size: M Arch: debt Phase: implement Design ref: The player, commands and views (Family tree: shows the genealogy of any entity, from one pawn to a whole culture: Decided; Performance: must stay fast: Decided, how Open; Keeping the family tree fast: Proposed); Claims, ownership and territory (One scope model: Agreed, 30 Oct). Goal: layoutTree in src/page/treelayout.js lays out every pawn ever born on each open and draws every node. It takes about 10 ms for the 818 founding pawns of populous medium, and calls S.unions.filter per pawn, inside a sort comparator too, so it grows with pawns × unions; a 150-year run holds several thousand records and the SVG holds a node for each. Show the tree for a scope (VB-043) and draw only what is on screen. Depends on VB-043; if it is not done, mark this blocked. Touches: page/treelayout (layoutTree, layoutScope, layoutLine, findPath, layoutPath); page/family (treeLinks, renderTree, drawTree, centreTree, pickTreeChip, pickTreePerson, renderTreeInfo); sim (Sim); src/body.html; tests/smoke.js Acceptance criteria (draft, pending QUESTIONS.md, VB-095):