React component for displaying responsive choropleth U.S. maps with tooltips, fills, strokes and more.
Used in The Washington Post’s abortion legislation tracker.
npm i --save react-us-map
Import USMap
:
import { USMap } from 'react-us-map'
Then, in JSX, render the component:
<USMap
fill={d => d === 'Illinois' ? 'steelblue' : '#eee'}
/>
Control the map styling with props. Most props take a function with the full state name as the only argument.
View full list of props and some examples on Storybook.
To contribute to this tool, first checkout the code. Then install the dependencies:
npm i
To start storybook:
npm run start
To release a new version:
npm version [major | minor | patch]
npm run release