Color and Size Legends
✓ Published1🌍 Public
A static SVG demonstrates two legend styles built from reusable D3 functions. `colorLegend` maps an ordinal color scale across fruit categories with fixed-size circles, while `sizeLegend` uses a square-root scale to represent numeric values through varying circle radii. Both legends render SVG groups with labeled ticks, using `scaleOrdinal`, `scaleSqrt`, and explicit spacing and text-offset parameters. The code defines separate modules for each legend and composes them in a single SVG canvas via `selection.call()`.
AI-generated descriptionMIT Licensed