Skip to main content
100%

D3 Tree with Multiple parents

✓ Published0🌍 Public
AASHA
Last edited May 8, 2023
Created on May 8, 2023

This example shows a tree diagram where nodes can have multiple parents, linking shared concepts like "Supply and demand" across different top-level categories. The visualization uses D3 v5 and Underscore.js to deduplicate hierarchical data by node ID, then manually recalculates node positions before rendering horizontal links and labels as SVG elements. Clicking a node collapses or expands its children with animated transitions, while zoom and pan are enabled through D3’s zoom behavior. The data comes from a static JSON file, and the code applies a Playfair Display font to the text labels.

AI-generated description
MIT Licensed

Similar vizzes