Two Decades of Pollution in US with menus
This interactive choropleth map displays PM2.5 concentration across US counties for each year from 2000 to 2004, with a React-driven dropdown menu to switch between annual datasets. The visualization uses Vega-Lite’s `markGeoshape` with an Albers USA projection, joining county-level pollution data from a CSV via `vl.lookup`, and encodes concentration values with a clamped color scale. React’s `useState` and a custom `Dropdown` component control the selected year, triggering a re-render of the Vega view. The underlying data comes from the PM2.5 by County dataset, with styling drawn from d3’s `hcl` color utilities.
AI-generated descriptionThe source dataset of this visualization is PM2.5 by County. It shows the pm2.5 concentration of the US counties from 2000 to 2004.
Each region block represents the pm2.5 concentration of the county.
Just want to show how to implement menu by react. This solution is a bit tricky. Need to use Bind a Selection for more delicate one.
References: Scatter Plot with Menus