/basemap.d3

A simple API for generating maps using d3.js

Primary LanguageJavaScript

basemap.d3

A simple API for generating maps using d3.js.

See examples at etpinard.github.io/basemap.d3/.

Current features

  • Basemap of coastlines, land, ocean, countries, USA states, river and lakes
  • Scatter points/text and great circle paths in (lon, lat) coordintates on top of a basemap
  • Choropleth of countries (with custom boundary lines)
  • Scatter points/text by locations (e.g. ISO-3)
  • Periodic panning and zoom
  • Customizable lon/lat axis ranges, graticule width, color and spacing

TODO list

  • Improve maps set scale (almost there ...)

  • Improve scopes: figure out what land / ocean / coastlines layers should be

  • Add zeroline and showline (with graticule.outline) lon/lat) attributes.

  • Add more subunits and choropleth locmode values (but the Natural Earth 110m set only includes USA states, the 50m include USA states and Canadian provinces)

  • ...

Running it locally

  • Install gdal (info: ubuntu ; mac)

  • Install node.js dependencies

npm install
make wget
  • Convert shapefiles into topojson
make convert
  • Install http-server
npm install http-server -g
  • Boot up server
./server up

API

Describe the figure object of the examples in ./examples/

Axis ranges and projection rotation

... TODO