🌍 Public
Viewing a saved revision (read-only)
f27426def33a4550b76c8f25b73e12d5
Melting data for multiple lines
AAnShed
Last edited Jul 8, 2020
Created on Jul 7, 2020
Forked from Temperature - Linechart with multiple lines
This example visualizes population over time for multiple regions using a single chart with multiple lines. It employs a color legend to distinguish regions and a melt operation to reshape the data from wide to long format. The visualization is built with D3 v5, using `scaleTime`, `scaleLinear`, `scaleOrdinal`, `line` with `curveBasis`, and `nest`. Data is loaded from CSV files via `d3.csv` and processed with `timeParse`, `range`, and custom functions. The SVG rendering includes axes with gridlines and a title, with interactive sorting of regions by their final population values.
AI-generated description