China tile grid map
This example shows a tile grid map of China, where each province is represented as a rectangle colored by its electricity consumption in 2015. A toggle button switches between the grid layout and the original geographic map, animating the shape change. The code uses the geo2rect library to convert GeoJSON polygons into rectangles, with D3 v4 (d3.geoMercator, d3.scaleQuantile) for rendering and coloring, and Turf.js for geographic calculations. Province positions in the grid are manually specified in the config, and the electricity data comes from a CSV file.
AI-generated descriptionInspired by Maarten Lambrecht's Europe example, using geo2rect by Sebastian Meier. Geojson data for China map is from china-geojson.
forked from <a href='http://bl.ocks.org/officeofjane/'>officeofjane</a>'s block: <a href='http://bl.ocks.org/officeofjane/d33d6ef783993b60b15a3fe0f8da1481'>China tile grid map</a>