🌍 Public
Viewing a saved revision (read-only)
4f9e33f92607433e858c3b257d16c7c4
Fork of Interactive Color Legend
This example visualizes the Iris Dataset as a scatter plot using D3 v7, displaying sepal length versus petal length with points colored by species via `scaleOrdinal` and `schemeCategory10`. A color legend renders each species as a labeled circle using `colorLegend`, and hovering over a legend tick dynamically adjusts the opacity of matching scatterplot marks through `setHoveredValue` and `hoveredValue` state. The visualization uses D3’s `selection.join`, `scaleLinear` for axes, and `csvParse` for data loading.
AI-generated descriptionA scatter plot of the Iris Dataset with a color legend.
Hover on the color legend to highlight the marks that match!
See also: