Skip to main content
100%

Tree Map for countries and states

✓ Published0🌍 Public
SSwapna1915
Last edited Jul 20, 2023
Created on Jul 17, 2023
Forked from Hello VizHub

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 description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes