Reusable Charts
This example demonstrates a reusable D3 chart component that visualizes the Iris dataset as a scatter plot, cycling through different variable pairings every two seconds. The `scatterPlot` function creates a configurable plot with settable properties like width, height, data, x/y value functions, margin, and radius. Using D3’s `scaleLinear`, `extent`, `axisLeft`, and `axisBottom`, it renders SVG circles with animated axes that update as the selected columns change. The plot is applied to the SVG via the `.call()` method, and `setInterval` drives the rotation through the dataset’s four numeric columns.