[03] Axes and scales - Using React Hooks with D3
✓ Published1🌍 Public
Ggjonor
Last edited Feb 22, 2020
Created on Feb 18, 2020
This example shows a line chart of an array of numeric values rendered as a smooth, cardinal-curved path with labeled axes. The code uses React Hooks with `useState` and `useRef` to manage data and the SVG element, while D3 v5’s `scaleLinear`, `axisBottom`, `axisRight`, and `line` with `curveCardinal` construct the visualization. Buttons update or filter the data, triggering a re-render that redraws the line and axes against a fixed 900×400 SVG viewport.
AI-generated descriptionMIT Licensed