Skip to main content
100%

Colour and Size Legends

✓ Published0🌍 Public
WWarren-Fitzhenry
Last edited Jan 3, 2020
Created on Jan 3, 2020

Animated fruit icons show how ordinal color and size scales encode categorical data. In this D3 v5 example, apples and lemons appear as red and yellow circles whose radius reflects a separate size scale. The `colorLegend` function uses the data join pattern, animating new circles from radius zero through `transition().duration(1000)`, while exits are removed. SVG rendering and the `scaleOrdinal` API handle the legend mappings.

AI-generated description

Making a face with D3.

Loading D3 from script tag (which creates a global 'd3' with all of its methods

MIT Licensed

Similar vizzes