Color Size and Legends
✓ Published0🌍 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 descriptionA bare minimum HTML page.
See also React Starter.
MIT Licensed