Skip to main content
100%

Reusable_D3_Scatter_Plot

✓ Published0🌍 Public
SShivaKarpe
Last edited Mar 27, 2022
Created on Mar 27, 2022

This example presents a reusable scatter plot of the classic Iris Dataset, with points colored by species and axes labeled by petal and sepal measurements. The visualization cycles through different measurement combinations every two seconds, updating the x-axis mapping via a `setInterval` animation while the y-axis remains fixed. Built with D3 v6, the code uses `d3.csv` for data loading, `d3.scaleLinear` and `d3.scaleOrdinal` for scales, and `d3.axisLeft`/`d3.axisBottom` for axes. A custom `scatterPlot` module encapsulates the chart, which is rendered as SVG circles with a legend.

AI-generated description

A reusable scatter plot inspired by Towards Reusable Charts.

Shows the Iris Dataset.

MIT Licensed

Similar vizzes