Choropleth Map: US States

This example shows how to create a choropleth map of states in the US using data from the National Science Foundation about venture capital spent in the US in 2012.

I'll only explain the differences to the example choropleth map of the world, where you can learn about the meaning of the other settings.

Since this is a map of the US, we load the appropriate TopoJSON file and set the map object to use the d3.geoAlbersUsa projection. The unitId used in this TopoJSON source is the FIPS code. Since we don't use the default projection (d3.geoNaturalEarth) we need to set the scale so the map fits well into the layout, in this case 1000 is a good value.

The remaining code should be straight-forward, provided you read the explanation of the choropleth world map example.

var map = d3.choropleth()

d3.csv('/data/venture-capital.csv').then(data => {


See an excerpt of the data used in this map below. Currently CSV is the only supported data format for creating choropleth maps with d3-geomap.


Example Maps