second
This interactive tree visualization displays world population data organized hierarchically from continent to country to city. Using D3.js v7, it loads a CSV file with columns for Continent, Country, City, and Population, then constructs a hierarchical layout with `d3.tree()` and `d3.hierarchy()`. Nodes are colored by depth level using `d3.scaleOrdinal()`, with circles representing cities and larger nodes for parents. Hovering reveals tooltips showing city population details. The SVG renders vertical links via `d3.linkVertical()` and scales responsively through a viewBox.
AI-generated descriptionWorld Population Tree Visualization
An interactive D3.js tree visualization showing world population data organized hierarchically: Continent → Country → City.
Features
- Hierarchical Tree Layout: Data organized from continents down to individual cities
- Color Coding: Different colors for each tree depth level
- Interactive Tooltips: Hover over nodes to see detailed information
- Responsive SVG: Scales to fit different screen sizes
Setup
Replace the
CSV_URLinindex.htmlwith your own CSV file URLYour CSV should have the following columns:
Continent: The continent nameCountry: The country nameCity: The city namePopulation: The population (numeric)
Open
index.htmlin your browser