basemap.d3

A simple API for generating maps using d3.js

Stars
5

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) coordinates 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
  • Customizable map frame
  • High resolution map scopes of Europe, Asia, Africa, North America, South America and USA
  • Integrated with all d3.geo
    projections

TODO list

  • 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)
  • Add zeroline (lon/lat) attributes.
  • Add a conic-specific zoom handler

Running it locally

  • Install http-server
npm install http-server -g
  • Boot up server
./server up

Add or modify a map scope

This is done by filter and clipping Natural Earth shapefiles and converting them to topojson:

  • Install gdal (info: ubuntu ; mac)

  • Install node.js dependencies

npm install
make wget
  • Edit ./bin/config.json (more info to come)

  • Convert shapefiles into topojson

make convert

API

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