Skip to main content
100%

Interactive Earthquake Bar Plot

✓ Published3🌍 Public
JJunying Li
Last edited Oct 6, 2021
Created on Oct 3, 2021
Forked from Hello VizHub

This interactive bar plot displays earthquake deaths across various regions during the 20th century, with buttons filtering the data into 20-year periods. When a user clicks a button, the bars re-sort by death toll and smoothly animate to their new positions via D3's `transition` on the `rect` elements. The code uses `d3.csv` to load the dataset, `d3.scaleBand` and `d3.scaleLinear` for axes, and `d3.axisBottom` and `d3.axisLeft` to render them. The visualization is built with D3 v7 and rendered as SVG.

AI-generated description

Data: https://gist.github.com/Junying-Li/72ef4641efd6b4abf371f5d9f4267a56

Iterated from last week's visualization.

What's new?

  1. Added buttons to interact with users.
  2. When click on a button, the bar chart will filter and sort data.
  3. Added transition.

X-axis: region that earthquake occured.

Y-axis: Deaths in earthquake.

This bar plot shows the deaths caused by earchquakes in mutiple regions in different period of 19 century.

MIT Licensed

Similar vizzes