Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Idempotent Reusable Scatterplot 101

Public visualization

Viewing a saved revision (read-only)

fe8b20736e5a480b946cb59a494dc1f3

Idempotent Reusable Scatterplot 101

0 stars1🌍 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