Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Interactive Color Legend

Public visualization

Viewing a saved revision (read-only)

f7782279faee4ae8ad88eb35fdafa397

Interactive Color Legend

0 stars0🌍 Public
Yyptang5488
Last edited Oct 4, 2020
Created on Oct 4, 2020

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 description

A scatter plot of The Iris Dataset.