Selecting a year on a line chart
✓ Published0🌍 Public
This interactive line chart shows how population changes over time across world regions, with a vertical line marking the currently selected year. Users move the mouse over the chart to change the selection, which updates the line in real time. The chart is built with React and D3 v5, using `scaleTime` and `scaleLinear` for the axes, `line` for the sparklines, and a `mouse` event on a transparent rectangle to capture the cursor position. The color legend is generated with `colorLegend`, and the data comes from UN population estimates.
AI-generated descriptionA bare minimum HTML page.
See also React Starter.
MIT Licensed