D3 Line Chart With Brush - Earthquakes
A D3 line chart visualizes global total earthquake deaths per year from 1900 to 1999, using data from a CSV of earthquake records. Circles mark individual yearly totals, connected by a steelblue line. An interactive brush (d3.brushX) allows selection along the x-axis; selected circles turn red, and double-clicking either clears the selection or selects all data if none exists. The chart uses d3.scaleLinear for both axes, d3.axisLeft, d3.axisBottom, and d3.rollup to aggregate deaths by year, rendered as SVG elements.
AI-generated descriptionA D3 line chart shows the global total deaths caused by earthquakes from 1900 to 1999.
Brush:
- Select:
In selected area, circles become red.
- Double click:
If user has already selected an area, user can unselect it by double clicking in this area. If user has not selected area, double click will select all circles.
Data: Earthquakes Dataset.
Y-axis:
Global total deaths in the year
X-axis:
Year