GeoVisualization - Choropleth map of India
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 descriptionA 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