Skip to main content
100%

idempotence of reusable D3 scatterplot

✓ Published1🌍 Public
SSamuele Greco
Last edited Feb 10, 2022
Created on Feb 10, 2022

This example demonstrates a reusable D3 scatterplot that cycles through different data columns of the Iris dataset every second, updating the x-axis and point positions with a smooth animation. Built as a React-compatible module, the `scatterPlot` function uses D3's `scaleLinear`, `scaleOrdinal`, `axisLeft`, `axisBottom`, and `symbol` APIs to render SVG marks colored by species. The plot is re-invoked via `svg.call(plot)` on a timer, showcasing idempotent re-rendering as the `xValue` accessor changes between petal and sepal measurements.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes