D3 Reusable Charts
This example demonstrates a reusable scatter plot component built with D3 v6 that cycles through different iris flower measurements every two seconds. The visualization uses the classic Iris dataset loaded from a GitHub gist, with sepal length plotted on the y-axis while the x-axis rotates through sepal length, petal length, sepal width, and petal width. The scatterPlot function exposes chainable setter methods for configuring dimensions, margins, data accessors, and point radius, while the main script uses D3’s `select`, `csv`, `scaleLinear`, `axisLeft`, and `axisBottom` APIs to render the SVG with animated transitions.