🌍 Public
Viewing a saved revision (read-only)
5ff1dc0f573d4f03a7c4b128bba40939
Fork of Selecting a Year on a Line Chart
This line chart displays population over time by region, with a movable vertical line that selects a year and highlights the corresponding data point. The visualization uses D3 v5’s `scaleTime`, `scaleLinear`, and `axisBottom`/`axisLeft` to render SVG axes, while `d3.line` with `curveBasis` draws the smoothed paths. A `mouse` event on an overlay rectangle updates the selected year, and a color legend built with `scaleOrdinal` and `schemeCategory10` identifies each region. Data comes from UN population estimates (1950–2014) and medium-variant projections (2015–2100).
AI-generated description