Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Melting Data for Multiple Lines

Public visualization

Viewing a saved revision (read-only)

9b72eabc92104b03af623c984e5bcdf3

Melting Data for Multiple Lines

0 stars0🌍 Public
Ssingularity6033
Last edited Jan 31, 2020
Created on Jan 31, 2020

This visualization displays population over time by region, with each line representing a different area and a color legend identifying them. The chart uses d3.csv to load UN population data, which is then processed using d3.nest to group data by region. The code demonstrates a data-wrangling technique called "melting," transforming wide-format data with columns per year into tidy data with year, name, and population fields. Multiple lines are drawn using d3.line and curveBasis, with d3.scaleTime and d3.scaleLinear handling the axes and d3.scaleOrdinal applying colors.

AI-generated description