All examples By author By category About

clhenrick

Resize Map on Window Resize

Using an unprojected version of the us-10m.json so that the Albers USA projection may be applied and that d3-geo's projection.fitSize can be used to appropriately scale the rendering of the data to a small SVG container.

It looks smoother to just rescale the SVG on window resize, but this method could be useful if you were doing other things on the map as well.

Thanks to @veltman for the tip.

Built with blockbuilder.org

forked from clhenrick's block: Debugging d3-geo projection.fitSize

forked from clhenrick's block: Debugging d3-geo projection.fitSize II