Skip to main content
100%

Modular US State Choropleth

✓ Published0🌍 Public
Aaawiegel
Last edited Aug 1, 2017
Created on Aug 1, 2017

A modular US State Choropleth maps state-level CSV data onto a continuous linear color scale, rendering each state as an SVG path using D3 v4's geoAlbersUsa projection. The example loads beerwine2.csv, which contains a normalized `value` for each state, and merges it with GeoJSON state geometries to color-code the map. Users can customize the color ramp by modifying the `lowColor` and `highColor` variables. A vertical gradient legend with an axis is included to show the value-to-color mapping. This block is a refactored version of an existing choropleth and requires a `statesdata.csv` with `state` (full name) and `value` (numeric) 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