Skip to content

Commit 1741ff8

Browse files
committed
Add tree visualization modes matching Ancestry.com
Implements 5 view modes for ancestry tree visualization: - Fan Chart: radial pedigree with lineage-colored wedges (default) - Horizontal: root left, ancestors right (Ancestry-style) - Vertical: ancestors top, root middle with generation labels - Columns/Focus: existing views retained URL-based routing enables deep-linking to specific views. Fixed classic view bugs with dynamic centering using ResizeObserver.
1 parent 0ff2c9a commit 1741ff8

16 files changed

Lines changed: 2958 additions & 265 deletions

‎.changelog/v0.6.x.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ This release normalizes FamilySearch as a downstream provider (equal to Ancestry
5050

5151
## Improvements
5252

53+
### Tree Visualization Parity with Ancestry.com (v0.6.x)
54+
- Added 5 tree view modes matching Ancestry.com functionality
55+
- **Fan Chart** (default): Radial pedigree with lineage-colored wedges (paternal=blue/teal, maternal=red/coral)
56+
- **Horizontal Pedigree**: Root left, ancestors right with expandable nodes
57+
- **Vertical Family**: Ancestors top, root middle with generation labels
58+
- **Columns** and **Focus**: Existing views retained
59+
- URL-based routing: `/tree/:dbId/:personId/:viewMode`
60+
- New shared components: TreeCanvas (D3 zoom/pan), TreeControls, AncestorNode
61+
- New utilities: lineageColors, treeLayout, arcGenerator
62+
- Fixed classic view bugs: dynamic centering, ResizeObserver instead of setTimeout
63+
5364
### Avatar Placeholders (v0.6.x)
5465
- Replaced emoji-based avatar placeholders with proper SVG components throughout tree views
5566
- New `AvatarPlaceholder` component renders gender-aware silhouettes (male/female/unknown profiles)

‎PLAN.md‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,61 @@ Separated provider data download from automatic application to prevent data corr
463463
- `scripts/migrate-fs-photos.ts` - **NEW** photo migration
464464
- `scripts/migrate-legacy-cache.ts` - **NEW** cache migration
465465

466+
### Phase 15.21: Tree Visualization Parity with Ancestry.com
467+
468+
Enhanced tree views matching Ancestry.com visualization modes:
469+
470+
**New View Modes (5 total):**
471+
1. **Fan Chart** (default) - Radial chart with lineage-colored wedges
472+
- Paternal line: cool colors (blue/teal)
473+
- Maternal line: warm colors (red/coral)
474+
- SVG-based with zoom/pan support
475+
2. **Horizontal Pedigree** - Root left, ancestors right (Ancestry-style)
476+
- DOM-based cards with SVG connector lines
477+
- Expandable nodes for loading more ancestors
478+
3. **Vertical Family** - Ancestors top, root middle (classic family tree)
479+
- Generation labels ("Michael's parents", "Michael's grandparents")
480+
- Clean CSS-based connecting lines
481+
4. **Columns** - Horizontal generational columns (existing)
482+
5. **Focus** - Single person navigator (existing)
483+
484+
**URL-Based Routing:**
485+
- `/tree/:dbId/:personId/fan` - Fan chart (default)
486+
- `/tree/:dbId/:personId/horizontal` - Horizontal pedigree
487+
- `/tree/:dbId/:personId/vertical` - Vertical family view
488+
- `/tree/:dbId/:personId/columns` - Generational columns
489+
- `/tree/:dbId/:personId/focus` - Focus navigator
490+
491+
**Shared Components:**
492+
- `TreeCanvas.tsx` - D3 zoom/pan wrapper with hooks
493+
- `TreeControls.tsx` - Generation selector, zoom buttons
494+
- `AncestorNode.tsx` - Reusable person card with lineage colors
495+
496+
**Utilities:**
497+
- `lineageColors.ts` - Paternal/maternal color schemes
498+
- `treeLayout.ts` - Node positioning calculations
499+
- `arcGenerator.ts` - Fan chart arc path generation
500+
501+
**Bug Fixes:**
502+
- Replaced hardcoded initial transform with dynamic centering
503+
- Replaced `setTimeout` with `ResizeObserver` for layout calculations
504+
505+
**Files Created:**
506+
- `client/src/components/ancestry-tree/utils/lineageColors.ts`
507+
- `client/src/components/ancestry-tree/utils/treeLayout.ts`
508+
- `client/src/components/ancestry-tree/utils/arcGenerator.ts`
509+
- `client/src/components/ancestry-tree/shared/TreeCanvas.tsx`
510+
- `client/src/components/ancestry-tree/shared/TreeControls.tsx`
511+
- `client/src/components/ancestry-tree/shared/AncestorNode.tsx`
512+
- `client/src/components/ancestry-tree/views/HorizontalPedigreeView.tsx`
513+
- `client/src/components/ancestry-tree/views/FanChartView.tsx`
514+
- `client/src/components/ancestry-tree/views/VerticalFamilyView.tsx`
515+
516+
**Files Modified:**
517+
- `client/src/App.tsx` - Added view mode route
518+
- `client/src/components/ancestry-tree/AncestryTreeView.tsx` - View switcher dropdown, URL routing
519+
- `client/src/index.css` - Lineage color CSS variables
520+
466521
### Phase 16: Multi-Platform Sync (Remaining Items)
467522

468523
- ~~Provider cache structure~~ (completed in 15.11)

‎client/src/App.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ function App() {
2121
<Routes>
2222
<Route path="/" element={<Layout />}>
2323
<Route index element={<Dashboard />} />
24+
{/* Tree routes with view mode support */}
2425
<Route path="tree/:dbId" element={<AncestryTreeView />} />
2526
<Route path="tree/:dbId/:personId" element={<AncestryTreeView />} />
27+
<Route path="tree/:dbId/:personId/:viewMode" element={<AncestryTreeView />} />
2628
<Route path="person/:dbId/:personId" element={<PersonDetail />} />
2729
<Route path="search/:dbId" element={<SearchPage />} />
2830
<Route path="path/:dbId" element={<PathFinder />} />

0 commit comments

Comments
 (0)