Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Color Size and Legends

Public visualization

Color Size and Legends

0 stars0🌍 Public
BB Sundaresan
Last edited Jul 15, 2020
Created on Jul 15, 2020

This example demonstrates two custom legend components rendered with D3 v5 in a React framework. A categorical color legend maps fruit names to distinct colors using `scaleOrdinal`, while a separate size legend uses `scaleSqrt` to visualize numeric values through circle radii. Both legends animate their circles with a 1-second `transition`, and the code highlights reusable legend-building patterns through D3's data join and enter/merge/exit selections.

AI-generated description

A bare minimum HTML page.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed