Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Selecting a Year on a Line Chart

Public visualization

Viewing a saved revision (read-only)

8482915a8a5343c5829b60f569b884a3

Selecting a Year on a Line Chart

0 stars0🌍 Public
Ssongr0
Last edited Jul 16, 2019
Created on Jul 15, 2019

This line chart displays population trends over time for world regions, with a visual selection mechanism for a specific year (2019). The visualization uses D3 v5 to render an SVG, loading data from UN population estimates CSV files. The code employs `d3.nest()` to group data by region, `d3.scaleTime` and `d3.scaleLinear` for axes, and a custom color legend built with `d3-selection`. A `parseYear` function converts year values, while the chart updates interactively when a new year is selected.

AI-generated description