Reusable Scatterplot Example
This reusable scatterplot demonstrates the Iris Dataset by plotting flower measurements as animated, circular marks. The visualization cycles through different feature combinations every two seconds, rotating the x-axis between petal width, sepal width, petal length, and sepal length while keeping sepal length on the y-axis. Built with D3.js, the code uses a custom `scatterPlot` function that leverages `scaleLinear`, `extent`, and axis generators (`axisLeft`, `axisBottom`) to render SVG elements. The example also shows a reusable chart API pattern, where configuration methods like `.data()`, `.xValue()`, and `.margin()` are chained to create an independent, customizable plotting component.
AI-generated descriptionA reusable scatter plot inspired by Towards Reusable Charts.
Shows the Iris Dataset.