Skip to main content
100%

Fork of Line Chart with React & D3

✓ Published1🌍 Public
DDeclan Naughton
Last edited Sep 30, 2025
Created on Sep 30, 2025

This example renders monthly atmospheric CO2 measurements from Mauna Loa as a line chart built with React and D3 v7. The visualization plots CO2 concentration in parts per million over time, with the date parsed from year and month columns and missing values filtered out. A monotone curve interpolation connects valid data points, and the line color randomly alternates between pink and brown on each render. The chart uses `d3.scaleTime`, `d3.scaleLinear`, `d3.line`, and `d3.axisBottom`/`axisLeft` to construct scales, axes, and labels within the React component lifecycle.

AI-generated description
MIT Licensed

Similar vizzes