Skip to main content
100%

Color and size legends

✓ Published0🌍 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
MIT Licensed

Similar vizzes