second
✓ Published1🌍 Public
An interactive hierarchical tree visualization displays world population data organized by continent, country, and city, with color-coded nodes indicating each level. Hovering over city nodes reveals population details through a tooltip. The visualization uses D3.js version 7 with the `d3.hierarchy` and `d3.tree` layouts, `d3.linkVertical` for edges, and SVG rendering. It loads data from a CSV URL via `d3.csv` with fallback to embedded sample data, and includes validation and error handling.
AI-generated descriptionWorld Population Tree
An interactive hierarchical visualization of world population data organized by Continent → Country → City.
Features
- Hierarchical Tree Visualization: Display data in a three-level tree structure
- Color-Coded Levels: Different colors for each hierarchy level
- Interactive Tooltips: Hover over cities to see detailed population information
- Responsive Design: Clean, modern UI with smooth interactions
- Error Handling: Graceful fallback to sample data if CSV fails to load
Project Structure
index.html- Main HTML file with styling and layouttree.js- D3.js visualization logic and data processingdata.js- Data source configurationREADME.md- Documentation (this file)
Data Format
The visualization expects data in CSV format with the following columns:
| Column | Type | Description |
|---|---|---|
| Continent | String | Continental region |
| Country | String | Country name |
| City | String | City name |
| Population | Number | City population |
Example CSV
MIT Licensed