Skip to main content
100%

Melting Data for Multiple Lines

✓ Published1🌍 Public
Ppplomith
Last edited May 7, 2021
Created on Apr 2, 2021

This example visualizes population over time by region, showing six major world regions as distinct colored lines from 1950 to 2100. The chart uses a line generator with curveBasis for smooth paths, while a color legend identifies each region. The code melts wide-format UN population data into tidy rows, combining estimates and medium-variant projections from CSV files. It employs d3.scaleTime, d3.scaleLinear, d3.scaleOrdinal, d3.nest, and d3.axisBottom/axisLeft, rendering as SVG with custom tick formatting for abbreviated population values.

AI-generated description
MIT Licensed

Similar vizzes