Skip to main content
100%

choropleth map for the "Density (P/Km2)"

✓ Published1🌍 Public
JJames Cruz
Last edited Apr 26, 2024
Created on Apr 26, 2024
Forked from HTML Starter

This choropleth map visualizes global population density by coloring each country according to its estimated population (pop_est) using a viridis sequential color scale. The map renders world geography as SVG paths via d3.geoPath, with country boundaries stroked in white and a hover effect darkening each region. The code loads world-atlas TopoJSON data through d3.json, converts it to GeoJSON with topojson.feature, and maps population values to fill colors. D3 v7 handles the SVG generation and data binding, while the color scale uses d3.scaleSequential with d3.interpolateViridis for continuous color encoding.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes