Skip to main content
100%

Idempotent Reusable Scatterplot 101

✓ Published1🌍 Public
AAlex
Last edited Apr 9, 2023
Created on Apr 9, 2023

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
MIT Licensed

Similar vizzes