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
LLex
Last edited Mar 20, 2020
Created on Mar 20, 2020
Forked from FruitBowl Example

The example shows two legends for mapping data to visual encodings: one for color using ordinal categories and one for size using a square-root scale. It renders SVG elements via D3 v5, with the color legend displaying discrete fruit names mapped to distinct hues, while the size legend displays a reversed set of numeric ticks with proportional circle radii. Reusable functions `colorLengend` and `sizeLengend` manage enter, update, and exit selections for the legends.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed