second
✓ Published1🌍 Public
This interactive D3.js v7 tree visualization displays the hierarchical relationship between continents, countries, and cities based on population data. It uses a vertical tree layout with color-coded nodes for each level (root, continent, country, city) and interactive tooltips that show population details on hover. The visualization is built with D3's `d3.hierarchy`, `d3.tree`, and `d3.linkVertical` APIs, rendering as SVG, and loads sample data from a JavaScript array with an optional CSV URL fallback.
AI-generated descriptionWorld Population Tree Visualization
An interactive D3.js tree visualization showing the hierarchical relationship between continents, countries, and cities by population.
Features
- Hierarchical Tree Layout: Displays data as Continent → Country → City
- Color Coding: Different colors for each level (Root, Continent, Country, City)
- Interactive Tooltips: Hover over nodes to see detailed information
- Responsive Design: Adapts to different screen sizes
Setup
Quick Start with Sample Data
The visualization comes with sample data pre-loaded. Open
index.html in a web browser to see the tree.
Using Your Own Data
- Prepare CSV Data
- Create a CSV file with columns:
Continent,Country,City,Population - Example:
- Create a CSV file with columns:
MIT Licensed