Fork of D3 Tree with Multiple Parents
✓ Published0🌍 Public
This example adapts D3’s hierarchical tree layout to visualize a directed graph with multiple parents, showing how shared child nodes like “Supply and demand” branch from two distinct roots. It uses `d3.tree`, `d3.hierarchy`, and `d3.linkHorizontal` to compute positions, then deduplicates nodes with underscore.js and manually recalculates x/y coordinates to handle overlapping descendants. SVG paths and text elements render the links and labels, with `d3.zoom` enabling pan and zoom. The source data is a small JSON array of government and market concepts, and the view animates between states using D3 transitions.
AI-generated descriptionMIT Licensed