🌍 Public
Viewing a saved revision (read-only)
deb2de2c254842c888d06770658e74cc
Idempotent Reusable Scatterplot 101
This example demonstrates a reusable scatterplot component that cycles through different pairs of Iris flower measurements every second, using the D3 library's `scaleLinear`, `axisBottom`, and `axisLeft` APIs. The scatterplot function returns a closure that can be configured via setter methods for data, dimensions, margins, and accessor functions, then called on an SVG selection to render axes and circles. Data loading uses D3's `csv` parser, and animation is driven by `setInterval`, which updates the x and y accessors and re-invokes the plot on the SVG.
AI-generated description