Skip to main content
100%

Scatter Plot with Color Legend

✓ Published0🌍 Public
Zzyniax
Last edited Apr 12, 2021
Created on Apr 12, 2021

This example visualizes the classic Iris dataset using a scatter plot of petal length versus sepal width, with points colored by species according to a color legend. Selecting a legend item dims all other points and restores full opacity to the matching species. Built with React and D3 v5, it uses `scaleLinear`, `scaleOrdinal`, and `extent` to compute scales, while custom React components render axes, marks, and the interactive legend as SVG. The data loads as CSV via D3’s `csv` function.

AI-generated description

A scatter plot of The Iris Dataset with color legend.

MIT Licensed

Similar vizzes