Skip to main content
100%

Geo2rect test using nmap

✓ Published0🌍 Public
LLuisSevillano
Last edited Feb 9, 2017
Created on Feb 9, 2017

This example uses D3.js v4 and the geo2rect and nmap libraries to transform the districts of Madrid, Spain, from a GeoJSON polygon map into a rectangular treemap-like layout. The `geo2rect.compute` function converts each district's geographic boundaries into a rectangle, while the `nmap` algorithm arranges these rectangles in a grid. The visualization renders as SVG paths and an animated toggle control, highlighting the potential for spatial distortion when converting irregular administrative boundaries into a rectilinear grid.

AI-generated description

Test using geo2rect and nmap. Dont know how to use nmap to extract a well-look grid.
Now I'm taking those coordinates from the bounding box of each map path but obviously there are some space betweet rects. Any idea?
The map shows the districts of Madrid, Spain.

Similar vizzes