Skip to main content
100%

Fork of PM2.5 For Selected Country

✓ Published0🌍 Public
BBruce J
Last edited Sep 20, 2021
Created on Sep 20, 2021

This visualization displays the PM2.5 air pollution trend for a selected country from 2010 to 2017, using data from a Kaggle dataset. A dropdown menu lets users choose a country, and the line chart updates accordingly with axes, labels, and a color legend. Built with React and D3 v5, it uses d3.csv for data loading, d3.nest to group by country, d3.scaleLinear and d3.line with curveBasis for rendering. The SVG rendering includes axis ticks, gridlines, and a colorLegend component built from the same D3 scales.

AI-generated description

A visualization constructed using D3 and (https://github.com/vega/vega-lite-api/).

The data shown here comes from the Kaggle:PM2.5 Global Air Pollution 2010-2017 (Mean Annual Exposure for 240 Countries) via Gist: PM2.5 Global Air Pollution Dataset (From 2010-2017)

The data is processed and melt to fit the visualization. It realize the sketch of showing PM2.5 trend in a specific country (eg. China).

The user can choose the country by using the menu and to see the trend from 2010 to 2017 in this country.

The only bug in this visualization is that I don't know why the little arrow of the menu disappear...

MIT Licensed

Similar vizzes