Skip to main content
100%

Autoscale and center topojson d3v3

✓ Published0🌍 Public
Aandrew-reid
Last edited Mar 2, 2017
Created on Mar 2, 2017

This example demonstrates how to display a TopoJSON map of Cairo monuments using D3 v3, with automatic scaling and centering of the geographic data. The map is rendered as SVG paths using a Mercator projection that is initially configured with scale 1 and translated to the center of the 800×500 viewport. The `d3.geo.path()` function is used to project the TopoJSON features, and the queue library loads the external `cairo.json` file. The map is drawn with land areas in light gray, thin black outlines, and white strokes for state boundaries. The code highlights the use of D3 v3 with TopoJSON to display the spatial distribution of historical monuments in Cairo, with each polygon representing a monument or city wall, some labeled with names and historical periods.

AI-generated description

Similar vizzes