Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Color and size legends

Public visualization

Viewing a saved revision (read-only)

ca4dccaa322a430f9e0faa0ae77ca9a3

Color and size legends

0 stars0🌍 Public
Aarths-glitch
Last edited May 28, 2020
Created on May 28, 2020

This example demonstrates two legends for mapping data to visual encodings. A color legend uses a d3.scaleOrdinal scale to map categorical fruit names to distinct colors, while a size legend uses a d3.scaleSqrt scale to map a numeric range to circle radii. The legends are custom reusable components, created with d3.selection and appended to an SVG canvas, with each tick rendered as a group containing a circle and a text label.

AI-generated description