Skip to main content
100%

Reusable D3 scatterplot

✓ Published3🌍 Public
BBart van Pelt
Last edited Jan 17, 2023
Created on Jan 17, 2023
Forked from D3 scatterplot

This example demonstrates a reusable scatterplot component built with D3 v7, plotting Iris flower measurements with petal width on the x-axis and sepal length on the y-axis. The code implements the reusable chart pattern by exposing setter functions like `.width()`, `.data()`, and `.radius()` to configure the component before rendering. It uses `d3.scaleLinear` for axes, `d3.extent` for domains, and `d3.axisLeft` and `d3.axisBottom` for ticks. The data is loaded from a CSV via `d3.csv` and rendered as SVG circles.

AI-generated description

Example Reusable scatterplot

https://www.youtube.com/watch?v=xkBheRZTkaw To 12:31

References

MIT Licensed

Similar vizzes