Skip to main content
100%

Reusable Scatterplot Example

✓ Published0🌍 Public
Sskambhore04
Last edited Mar 22, 2022
Created on Mar 22, 2022

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 description

A reusable scatter plot inspired by Towards Reusable Charts.

Shows the Iris Dataset.

MIT Licensed

Similar vizzes