Skip to main content
100%

PM2.5 For Selected Country

✓ Published3🌍 Public
Iivaleehan
Last edited Oct 13, 2020
Created on Oct 13, 2020

This visualization displays PM2.5 air pollution trends for a selected country from 2010 to 2017 using a multi-line chart. A dropdown menu allows users to switch between countries, updating the line path to show that nation’s annual mean exposure values. The code uses D3 v5 with React, employing `d3.line`, `d3.scaleLinear`, `d3.axisLeft`, `d3.axisBottom`, and `d3.nest` to process and render the data. It also uses a custom `colorLegend` component and `foreignObject` for the dropdown UI. Data originates from a Kaggle dataset loaded via a Gist URL.

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