🌍 Public
19 - legends: color & size - dataviz 2018
Zzach b.
Last edited Jan 5, 2022
Created on Jan 4, 2022
Two custom legends demonstrate ordinal color and quantitative size encodings in D3 v7. The color legend uses `scaleOrdinal` to map fruit categories to distinct fills, while the size legend uses `scaleSqrt` to map numeric ticks to circle radii. Both are rendered as SVG groups with circle and text elements, updated through D3’s selection-merging API. The example highlights reusable legend construction patterns within a single static visualization.
AI-generated descriptiondatraviz 2018 #19 - legends: color & size
MIT Licensed








Comments
Sign in to join the discussion.