Skip to main content
100%

D3 and React

✓ Published0🌍 Public
Ggjonor
Last edited Feb 2, 2020
Created on Feb 2, 2020
Forked from React Starter

Two React components render D3 visualizations side-by-side. A bar chart maps an array of values to SVG rectangles and text labels, using D3's data join with `selectAll`, `enter`, and attribute setters, with colors via HSL strings and classes for high/low values. A second component demonstrates React's managed rendering alongside unmanaged D3 updates, appending HTML elements, merging enter/update selections, and animating appended spans with `transition().duration().delay()`. Both components use `useRef` and `useEffect` to access the DOM, with data generated by `d3.range`.

AI-generated description

React Starter code.

FreeCodeCamp Article / 13 MAY 2019 / How to get started with D3 and React / by Magdalena Stenius

https://www.freecodecamp.org/news/how-to-get-started-with-d3-and-react-c7da74a5bd9f/

MIT Licensed

Similar vizzes