Skip to main content
100%

Color and Size Legends

✓ Published0🌍 Public
Hhugomell
Last edited Jul 31, 2020
Created on Jul 31, 2020

This example demonstrates how color and size can encode categorical differences in data, using a simple fruit bowl visualization. It shows apples and lemons as circles, where color distinguishes fruit type and radius encodes size, with legends implied through the shapes themselves. The code uses d3.scaleOrdinal for both color and radius mappings, and builds the SVG scene with d3-selection methods. The visualization is rendered using D3 v5, with fruit data drawn as circles and text labels inside a rounded rect bowl.

AI-generated description
MIT Licensed

Similar vizzes