Tree Map for countries and states
✓ Published0🌍 Public
This example presents a tree diagram mapping countries to their respective states, using a hierarchical dataset structured with parent-child relationships. The visualization uses D3 v5’s `d3.stratify` to convert the flat data into a hierarchy, then applies `d3.tree()` to compute the layout. Nodes are rendered as circles colored by depth (purple, dark red, and magenta), connected by red cubic Bézier curves, with labels placed next to each node. The implementation is based on code adapted from a Crypters Infotech tutorial.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed