Skip to main content
100%

Fork of Reusable D3 Scatter Plot

✓ Published0🌍 Public
NNanditha Reddy
Last edited Mar 24, 2024
Created on Mar 24, 2024

This example presents a reusable scatter plot that visualizes the Iris dataset, mapping sepal and petal measurements. The visualization dynamically alternates between two data columns, "hp" and "mpg," every second, updating the x-axis and points accordingly. Built with D3.js v6, the chart uses SVG elements and D3 scales, axes, and data joins to render the circles. The code demonstrates a modular pattern where a `scatterPlot` function encapsulates the chart logic, allowing for easy reconfiguration of dimensions, margins, and data accessors. Axes and labels are generated with D3's axis and text APIs, with transitions handled through `setInterval`.

AI-generated description

A reusable scatter plot inspired by Towards Reusable Charts.

Shows the Iris Dataset.

MIT Licensed

Similar vizzes