Skip to main content
100%

Fork of Reusable D3 Scatter Plot

✓ Published0🌍 Public
Ssudhamshu24
Last edited Mar 23, 2022
Created on Mar 23, 2022

This example presents an animated scatter plot of the Iris Dataset, cycling through the four measured attributes (petal width, sepal width, petal length, and sepal length) on the x-axis while sepal length remains on the y-axis. It demonstrates a reusable chart pattern using D3 v6, where a `scatterPlot` function returns a configurable closure that sets scales, joins circle elements to data, and renders axes with `axisLeft` and `axisBottom`. The visualization rotates through columns every two seconds via `setInterval`, updating the x-value accessor and re-invoking the chart. It loads data asynchronously with `csv` from a GitHub Gist and renders in SVG within the full browser viewport.

AI-generated description

A reusable scatter plot inspired by Towards Reusable Charts.

Shows the Iris Dataset.

MIT Licensed

Similar vizzes