Selecting a Year on a Line Chart
✓ Published0🌍 Public
The visualization displays population over time for world regions with selectable year brackets, showing trajectories from 1950 through 2100 using a line chart with a color-coded legend. A vertical guide line appears at the selected year, and users can update the selection by mousing over the chart, which triggers the `setSelectedYear` callback. The code uses D3 v5’s `nest` for data grouping, `scaleTime` and `scaleLinear` for axes, `curveBasis` for line smoothing, and SVG rendering with data from UN population estimates.
AI-generated descriptionMIT Licensed