Skip to main content
100%

Fork of Shot Distance Bar Plot

✓ Published0🌍 Public
AAnne Lin
Last edited Dec 13, 2021
Created on Dec 13, 2021

This interactive bar chart displays the number of earthquake deaths across regions, with buttons that filter the data by 20-year periods. The chart initially shows all data, and clicking a button triggers a smooth transition that rescales the axes and repositions the bars, which are sorted by death toll. Built with D3 v7, the visualization uses `d3.csv` for data loading, `d3.scaleBand` and `d3.scaleLinear` for axes, and the `.join()` method to update the SVG rectangles, with transitions animated over one second. The data comes from a GitHub-hosted CSV file depicting earthquakes from 1900 to 2000.

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