Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Population Density by World Cities

Public visualization

Viewing a saved revision (read-only)

8f00c27b58934089b5e6bf78ae040a2a

Population Density by World Cities

0 stars0🌍 Public
CCurran Kelleher
Last edited Jan 10, 2026
Created on Jul 24, 2024

This visualization uses a contour map to show population density across the world, based on the populations of large cities. It overlays political borders and labels for major cities, and supports panning and zooming. The implementation leverages `d3.geoNaturalEarth1` projection, `d3.geoPath`, and `d3.contourDensity` to generate density contours, which are colored using a custom scale combining CubeHelix and Reds. City labels are placed without overlap using the RBush spatial index, and the map is rendered with SVG and the `d3.select` API.

AI-generated description

A proof of concept for a label placement algorithm that can be used to add labels to maps and scatter plots.

MIT Licensed