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.geo.albersUsa projection. The unitId used in this topojson source is the FIPS code. Since we don't use the default projection (d3.geo.naturalEarth) 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.geomap.choropleth()

d3.csv('/data/venture-capital.csv', function(error, data) {'#map')
        .call(map.draw, map);


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