Fork of React & D3 Starter
This example demonstrates a reusable starter pattern for integrating React with D3.js, displaying the classic Iris dataset as a scatterplot. The visualization maps sepal length and petal length onto x- and y-axes using D3’s `scaleLinear` and `extent`, with circles rendered via SVG. React manages the component lifecycle through hooks like `useState`, `useEffect`, and `useRef`, while D3 handles selection, data joins, and axis generation with `axisLeft` and `axisBottom`. The code showcases decoupled architecture, scaling for complexity, and copy-paste compatibility with existing projects.
AI-generated descriptionThis viz is a starter that demonstrates patterns used in real world projects in which complexity is anticipated to scale.
- Decoupled React & D3 integration
- Opening moves for scalable complexity
- Industry standard ES modules and JSX
- Copy-paste into existing projects
Any questions? Ask on Twitter!
Also viewable in: