Skip to main content
100%

Fork of D3 Tree with Multiple Parents

✓ Published0🌍 Public
PPrabhat
Last edited Sep 22, 2023
Created on Sep 22, 2023

This example visualizes a tree diagram with multiple parent nodes, showing how shared child concepts like "Supply and demand" and "Laborer" branch from both "Stock market" and "Government of the United States." The layout removes duplicate nodes by ID and recalculates positions based on depth, with links filtered to exclude the synthetic root. Built with D3 v5, the code uses `d3.tree`, `d3.hierarchy`, `d3.linkHorizontal`, and a `zoom` event to handle interactive panning and scaling. SVG text elements display labels with a Playfair Display font, and the animation uses `transition` to smoothly update node positions. Data comes from a local JSON file.

AI-generated description
MIT Licensed

Similar vizzes