Skip to main content
100%

React & D3 Starter Template

✓ Published0🌍 Public
CChetan Maskalle
Last edited Dec 17, 2023
Created on Dec 17, 2023
Forked from React & D3 Starter

This example demonstrates a starter template for integrating React with D3 to create a scatter plot of the Iris dataset. The visualization maps sepal length to the x-axis and petal length to the y-axis, rendering circles with a fixed radius and transparency. The code uses a decoupled architecture where React manages the SVG lifecycle via a `useRef` hook and `useEffect`, while D3 functions like `csv`, `scaleLinear`, `extent`, `axisLeft`, and `axisBottom` handle data loading, scaling, and chart axes.

AI-generated description

This 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:

MIT Licensed

Similar vizzes