Skip to main content
100%

Reusable Scatter Plot

✓ Published1🌍 Public
KKhanAzmat
Last edited Dec 30, 2022
Created on Dec 29, 2022

This reusable scatter plot displays the classic Iris Dataset, mapping sepal and petal measurements onto a full-screen SVG canvas. The visualization cycles through all four measured attributes as the x-axis variable every two seconds, with axes and circles updating in place. Built with D3's `scaleLinear`, `extent`, `axisLeft`, and `axisBottom` APIs, the code demonstrates a modular chart composition pattern where the scatter plot function accepts configurable width, height, data, margin, and value accessors. The internal `join` mechanism updates both circles and axis labels idempotently, creating a smooth, animated transition between different data dimensions.

AI-generated description

A reusable scatter plot inspired by Towards Reusable Charts.

Shows the Iris Dataset.

MIT Licensed

Similar vizzes