Solution
This example plots the classic Iris flower dataset as a scatter plot, using sepal length and petal length for the axes while coloring each circle by species. The visualization is built as a stateless React-inspired component that receives SVG and configuration props. The code uses D3 v4 scales, axes, and the `d3.legendColor` API from the d3-legend library to create a categorical color legend. SVG rendering is driven by a merge pattern for incremental updates, with axis ticks and labels styled via CSS.
AI-generated descriptionAn example of a Scatter Plot component using a React-inspired pattern for stateless components.
forked from <a href='http://bl.ocks.org/curran/'>curran</a>'s block: <a href='http://bl.ocks.org/curran/298c130e67b40ed84f8c919e748d2e72'>Scatter Plot with Color Legend</a>