Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Selecting a Year on a Line Chart

Public visualization

Selecting a Year on a Line Chart

0 stars0🌍 Public
HHasideluxe
Last edited Aug 7, 2020
Created on Aug 7, 2020

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 description

Comments

Sign in to join the discussion.

MIT Licensed