Skip to main content
100%

Color and Size Legends

✓ Published0🌍 Public
Ffbudwill
Last edited Jun 10, 2020
Created on Jun 10, 2020

This example demonstrates two reusable legend components rendered side by side in an SVG: a color legend using an ordinal scale mapping fruit names to distinct colors, and a size legend built from a square-root scale with circular marks sized proportionally to tick values. Both legends use D3 v5’s selection joins to update enter and exit states. The color legend calls `scaleOrdinal`. The size legend uses `scaleSqrt.ticks()` for tick generation.

AI-generated description
MIT Licensed

Similar vizzes