π Public
Melting Data for Multiple Lines
This example visualizes population projections for global regions from 1950 to 2100 as multiple smoothed lines, each colored by region via an ordinal color scale and accompanied by a legend. The chart uses d3.scaleTime, d3.scaleLinear, d3.axisLeft, and d3.axisBottom to render axes, while d3.line with d3.curveBasis draws the paths. Data is loaded from CSV files and melted into a tidy format before rendering as SVG.
AI-generated descriptionD3 course follow along.
MIT Licensed
Comments
Sign in to join the discussion.