🌍 Public
Viewing a saved revision (read-only)
932c14ef7ea54ad7b0229b21e9d55681
Fork of Selecting a Year on a Line Chart
This interactive line chart displays population trends over time for global regions, with a movable vertical line that lets users select a specific year. Hovering over the chart triggers the `setSelectedYear` function, which updates the selected year and redraws the visualization. The chart uses `d3.line` with `curveBasis` for smooth paths, `d3.scaleTime` and `d3.scaleLinear` for axes, and `d3.nest` to group data by region. A color legend built with `d3.scaleOrdinal` and `schemeCategory10` identifies each line. Population data comes from UN estimates merged with medium variant projections, rendered as SVG.
AI-generated description