Fork of React & D3 Starter
This example renders the classic Iris flower dataset as a scatter plot using React for component structure and D3 for scales, axes, and circle positioning. Sepal length appears on the x-axis and petal length on the y-axis, with semi-transparent circles for each data point. The code demonstrates a decoupled React and D3 integration, where a `VizWrapper` component manages the SVG element and calls a `viz` function that selects circles and axes using `d3.selectAll` and `.join`. It uses `d3.scaleLinear` and `d3.extent` for scaling, with axes created via `d3.axisLeft` and `d3.axisBottom`.
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: