Some simple, frequently used functions for creating a map with D3.js and Topojson.
centerZoom
- Automatically centers and scales your map to its container, and returns your map's outer boundaries in case you want to draw them.drawOuterBoundary
- Uses the boundary returned fromcenterZoom
to draw a boundary around your whole map.drawPlaces
- Draws place names, if your topojson has places.drawSubunits
- Draws subunits.
See this tutorial for more on making maps with D3. I got most of the centerZoom
function from this block.