Fork of Shot Distance Bar Plot
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 descriptionData: https://gist.github.com/Junying-Li/72ef4641efd6b4abf371f5d9f4267a56
Iterated from last week's visualization.
What's new?
- Added buttons to interact with users.
- When click on a button, the bar chart will filter and sort data.
- 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.