Skip to main content
100%

GeoVisualization - Choropleth map of India

✓ Published0🌍 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 choropleth map of India that has been updated from D3 v4 to D3 v7. The original code was developed by Harry Stevens and the block can be found at https://bl.ocks.org/HarryStevens/c9cf86eba753ba8650fb466e37d538d2

MIT Licensed

Similar vizzes