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)

2e18ace9f7a74d2ea3aa36bc8cb73b99

Melting Data for Multiple Lines

0 stars0🌍 Public
Ssriramvsharma
Last edited Jul 29, 2020
Created on Jul 29, 2020

This example shows population over time by region as multiple smoothed lines, using a color legend to distinguish regions. The data is melted from wide to long format in `loadAndProcessData`, combining UN population estimates (1950–2014) with medium-variant projections (2015–2100). D3 v5 APIs include `d3.nest`, `d3.line` with `curveBasis`, `d3.scaleTime`, `d3.scaleLinear`, and `d3.scaleOrdinal`. A custom `colorLegend` function renders SVG legends, while axes use `d3.axisBottom` and `d3.axisLeft` with tick formatting via `d3.format`.

AI-generated description