Fork of Selecting a Year on a Line Chart
✓ Published0🌍 Public
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 descriptionMIT Licensed