Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Reusable Scatter Plot

Public visualization

Viewing a saved revision (read-only)

97d8417265e14e8393c3e3b1df4ea302

Reusable Scatter Plot

0 stars1🌍 Public
GGARIDIDEEKSHITHREDDY
Last edited Mar 29, 2022
Created on Mar 29, 2022

This example animates the classic Iris dataset in a reusable scatter plot, cycling through four different feature pairs on the x-axis while keeping sepal length fixed on the y-axis. Points are colored by species (setosa, versicolor, virginica) with a custom legend, and the plot updates every few seconds using `setInterval`. Built with D3 v6, it uses `d3.scaleLinear` for axes, `d3.axisLeft` and `d3.axisBottom` for scales, and SVG circles for marks. The `scatterPlot` factory function encapsulates the chart’s dimensions, margins, and scales, making the visualization modular and reusable.

AI-generated description