Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of D3 Tree with Multiple Parents

Public visualization

Viewing a saved revision (read-only)

b7089d6da00c4adf995350a94e8a872a

Fork of D3 Tree with Multiple Parents

0 stars0🌍 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