🌍 Public
Viewing a saved revision (read-only)
97de6a040fdb46dcb3904e3de54688b4
Reusable Scatter Plot
This example generates a reusable scatter plot component using the D3.js v6 library. It visualizes the Iris dataset, revealing relationships between pairs of attributes like petal length and sepal width, with points colored by species (setosa, versicolor, virginica). The code defines a `scatterPlot` function that takes x and y attribute names, creates the SVG axes and scales, and renders the data points. The Iris CSV data is loaded via `d3.csv`, with axes scaled via `d3.scaleLinear` and `d3.axisBottom`/`d3.axisLeft`, and a color legend is added to distinguish species groups.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.