Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Reusable Scatter Plot

Public visualization

Viewing a saved revision (read-only)

4771e0e3457c4e2c871cb944075c3258

Reusable Scatter Plot

0 stars0🌍 Public
MMikeMwita
Last edited Mar 26, 2023
Created on Mar 26, 2023

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 description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.