🌍 Public
Viewing a saved revision (read-only)
e72e02cd47f3430ba667d967c2813201
Fork of Fork of D3 Tree with Multiple Parents
This example visualizes a hierarchical tree with multiple parents, showing how nodes like "Laborer" and "Foreign worker" connect to several top-level categories. It flattens the hierarchy by deduplicating repeated nodes and manually recalculating their x- and y-positions using `_.uniq`, `_.where`, and depth-based spacing. The SVG renders horizontal links with `d3.linkHorizontal`, supports zooming via `d3.zoom`, and animates node transitions on click. Data comes from a local JSON file, and traversal uses `d3.hierarchy` and `d3.tree`. The latest top-level child is highlighted with a steel-blue stroke.
AI-generated description