Skip to main content
100%

Melting Data for Multiple Lines with D3.js!

✓ Published1🌍 Public
Fforcox43
Last edited Aug 13, 2020
Created on Jul 22, 2020

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 description

See also React Starter.

MIT Licensed

Similar vizzes