Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

GeoVisualization - Choropleth map of India

Public visualization

Viewing a saved revision (read-only)

60a151c7eb754a90b4c2df6db1be0ba7

GeoVisualization - Choropleth map of India

0 stars0🌍 Public
AAlark Joshi
Last edited Apr 5, 2024
Created on Apr 5, 2024

This example displays a choropleth map of India, rendering its states and major places as an interactive SVG graphic. It uses a Mercator projection via `d3.geoMercator` and `d3.geoPath` to draw TopoJSON features representing state polygons and city points. State subdivisions are filled with a categorical `d3.scaleOrdinal` color scheme at reduced opacity, while labels for each state and place are positioned using `path.centroid` and the projection of coordinates. The map automatically centers and scales to fit the viewport using geographic bounds. Data comes from a remote TopoJSON file, and the code updates an earlier D3 v4 implementation to D3 v7.

AI-generated description

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

See also React Starter.