Fork of Reusable D3 Scatter Plot
This example presents a reusable scatter plot that visualizes the Iris dataset, mapping sepal and petal measurements. The visualization dynamically alternates between two data columns, "hp" and "mpg," every second, updating the x-axis and points accordingly. Built with D3.js v6, the chart uses SVG elements and D3 scales, axes, and data joins to render the circles. The code demonstrates a modular pattern where a `scatterPlot` function encapsulates the chart logic, allowing for easy reconfiguration of dimensions, margins, and data accessors. Axes and labels are generated with D3's axis and text APIs, with transitions handled through `setInterval`.