Reusable plots
✓ Published0🌍 Public
This example demonstrates how to build reusable chart components in React with D3. It visualizes the classic Iris dataset as a scatter plot, mapping petal length on the x-axis and sepal width on the y-axis, with circle radii fixed at 7 pixels. The code separates axes and marks into distinct React components—AxisBottom, AxisLeft, and Marks—which accept scales and dimensions as props for reuse. It uses d3.scaleLinear with extent-based domains, d3.csv for data loading, and renders SVG elements via React’s JSX syntax.
AI-generated descriptionA scatter plot of The Iris Dataset.
MIT Licensed