Skip to main content
100%

Fit Extent

✓ Published0🌍 Public
Mmbostock
Last edited Jul 22, 2018
Created on Jul 29, 2016

A dark map of the contiguous United States fits its projected outline precisely within the SVG canvas. The example demonstrates d3-geo 1.2’s `fitSize` feature, which automatically scales and centers the map’s projection to match the given pixel dimensions. The code loads a US GeoJSON file via `d3.json`, filters out Alaska, Hawaii, and outlying areas, then projects the remaining states using `d3.geoConicConformal` with custom parallels, rotation, and center. A single path element is rendered using `d3.geoPath` for the resulting Conic Conformal projection.

AI-generated description

A demonstration of d3-geo 1.2’s new projection.fitSize feature.

gpl-3.0 Licensed

Similar vizzes