🌍 Public
Viewing a saved revision (read-only)
f7782279faee4ae8ad88eb35fdafa397
Interactive Color Legend
This example visualizes the classic Iris dataset as an interactive scatter plot, with petal length and sepal width mapped to the x and y axes. A color legend on the right encodes the species of each flower, and hovering over a legend entry highlights the corresponding points while fading the rest. Built with React and D3.js, the code uses `d3.scaleLinear` and `d3.scaleOrdinal` for axes and color mapping, and renders the chart as SVG with event handlers on the legend circles to trigger the hover effect.
AI-generated descriptionA scatter plot of The Iris Dataset.