🌍 Public
Viewing a saved revision (read-only)
e8815f15dd904555926a10b2c04d5909
Fork of D3 Tree with Multiple Parents
This example displays a tree diagram with multiple parent nodes, using custom data that maps topics like "Government" and "Stock market" to shared children. It builds the hierarchy with `d3.hierarchy`, applies a `d3.tree` layout, and renders links as horizontal paths via `linkHorizontal`. The code uses `_.uniq` from Underscore to deduplicate nodes, then manually recalculates x and y positions so shared children appear once. Interactive zooming via `d3.zoom` and animated transitions on node positions and opacity are included, with SVG text elements showing labels.
AI-generated description