Skip to main content
100%

Color and size legend

✓ Published0🌍 Public
Bbambaleq
Last edited Feb 24, 2020
Created on Feb 24, 2020

This example demonstrates two reusable legend components: a color legend mapping ordinal categories to distinct hues, and a size legend using a square-root scale to encode numeric values through circle radii. The color legend displays fruits with colored circles, while the size legend renders circular markers with labels positioned beyond each circle. Both legends use D3 v5 scales and SVG rendering, with React-styled selection/merge patterns for dynamic updates. The size legend uses `sizeScale.ticks()` to generate evenly spaced values for its circles.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes