Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

color and size legends

Public visualization

color and size legends

0 stars0🌍 Public
Ssheafallick
Last edited Dec 16, 2022
Created on Dec 16, 2022

Two D3 legend components display color and size scales side-by-side in a single SVG. The color legend uses `scaleOrdinal` with named fruit categories and a `colorLegend` function, while the size legend uses `scaleSqrt` and a `sizeLegend` function. Both legends generate groups with circles and text labels, positioned via `spacing` and `textOffset`. The size scale filters out zero values and uses `ticks` to determine displayed values.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed