🌍 Public
Viewing a saved revision (read-only)
4771e0e3457c4e2c871cb944075c3258
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.