Skip to main content
100%

Modular US State Choropleth

✓ Published0🌍 Public
CCraftbd
Last edited Apr 3, 2018
Created on Apr 3, 2018

This modular choropleth maps state-level data onto a U.S. map using a light-to-magenta color ramp defined by `lowColor` and `highColor`. The D3 v4 example loads a CSV containing state names and numeric values, joins them to a GeoJSON of US states, and renders the result as SVG paths using the Albers USA projection. A linear color scale maps data values to fill colors, and a vertical gradient legend with an axis communicates the value range. The code is organized for easy reuse, allowing users to swap in their own `statesdata.csv` with `state` and `value` columns.

AI-generated description

A modular version of this excellent choropleth - will map any CSV statesdata.csv on a linear continuous value, using d3js v4.

Requirements for statesdata.csv:

  • state column with standard full-length state names
  • value column with any numeric values

Also, you can edit the color ramp using the lowColor and highColor variables.

forked from <a href='http://bl.ocks.org/wboykinm/'>wboykinm</a>'s block: <a href='http://bl.ocks.org/wboykinm/dbbe50d1023f90d4e241712395c27fb3'>Modular US State Choropleth</a>

mit Licensed

Similar vizzes