All examples By author By category About

seemantk

Responsive Map

An experiment with responsive maps and svg's with d3.

The projection paths are defined in the svg's section, and the states are rendered on screen using svg's statements, one for each state. Additionally, since d3's albersUsa projection assumes a screen size of 960x500, the viewBox attribute is set to those dimensions, but the svg itself doesn't have any sizing information. This makes it fill up the available space of its containing

(or, in this case).

To see the resizing, click "Open in a new window"

Built with blockbuilder.org