🌍 Public
Viewing a saved revision (read-only)
d03933c0d1864da586c284c95eb99095
Melting Data for Multiple Lines with D3.js!
Fforcox43
Last edited Aug 13, 2020
Created on Jul 22, 2020
Forked from Line Chart with Multiple Lines with D3.js!
This visualization shows population projections from 1950 to 2100 for multiple world regions, with each region represented as a colored line. The chart uses D3.js 5.16 within a React framework, loading data from UN population estimate CSV files via `d3.csv`. The code demonstrates data “melting” from wide to long format, then uses `d3.line`, `d3.scaleTime`, `d3.scaleLinear`, and `d3.scaleOrdinal` with a category-10 color scheme. Axes, legends, and labels are drawn in SVG, with a custom color legend component and styling via CSS.
AI-generated descriptionSee also React Starter.