🌍 Public
Viewing a saved revision (read-only)
44831da558a04e1482cf2f0064cdae25
Interactive Color Legend
A scatter plot of the Iris dataset displays sepal width against petal length, with points colored by species. An interactive color legend on the right filters the visualization: hovering over a species name highlights matching points while dimming all others to 20% opacity. Built with React and D3 v5, the example uses `scaleLinear` and `scaleOrdinal`, SVG circles, and `onMouseEnter`/`onMouseOut` events to drive the hover state. The data loads via `d3.csv` from a gist.
AI-generated descriptionA scatter plot of The Iris Dataset. Adding a color legend to it.