🌍 Public
Viewing a saved revision (read-only)
c091d5fd69fb4a34a91871269c58f15c
Reusable Scatter Plot
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