Skip to main content
100%

second

✓ Published1🌍 Public
119h61a05c9@cvsr.ac.in
Last edited Nov 10, 2025
Created on Nov 10, 2025
Forked from D3 Starter

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 description

World 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

  1. Replace the CSV_URL in index.html with your own CSV file URL

  2. Your CSV should have the following columns:

    • Continent: The continent name
    • Country: The country name
    • City: The city name
    • Population: The population (numeric)
  3. Open index.html in your browser

CSV Format Example

MIT Licensed

Similar vizzes