Skip to main content
100%

[01] The Basics - Using React Hooks with D3

✓ Published1🌍 Public
Ggjonor
Last edited Feb 22, 2020
Created on Feb 18, 2020
Forked from React Starter

This example demonstrates how to combine React Hooks with D3 to render and update a simple SVG scatterplot. A `useState` hook manages an array of numeric data, while a `useRef` hook and `useEffect` hook initialize an SVG canvas using `d3.select` from D3 v5. Circles are appended via `selectAll(...).data(...).join('circle')`, with radius and position derived from each value. Clicking the “Update” button increments the data by 5, and “Filter” removes values over 35, triggering a re-render through React’s state changes.

AI-generated description
MIT Licensed

Similar vizzes