Zooming

I finally figured out how to make my maps zoomable. It was, compared to actually making a map, really easy -like 6 lines of code. Basically there’s a behaviour in D3 already that allows you to zoom about, you just have to set it to work on the map projection so everything moves together nicely.

It doesn’t interfere with the tooltip or the interactivity or anything. Although the more you zoom in the more the boundaries get a bit weird – there appears to be a lake just north of Croydon, for instance. The example below is based on the young adult unemployment data I got from the census.

This from D3 tips and tricks was that I used – it’s really very helpful indeed

Comments are closed.