Skip to main content
100%

Color Legend

✓ Published1🌍 Public
CChristine Lanser
Last edited Nov 12, 2020
Created on Oct 7, 2020

A categorical color legend maps fruit names to colored circles using an ordinal scale. The legend renders as a vertical list of four circles, each paired with a text label, with spacing controlled by a parameter. The code uses d3.scaleOrdinal and d3-selection to bind data to SVG groups, appending circles and text elements. The colorLegend function is invoked via selection.call, with the legend positioned by an SVG transform.

AI-generated description

creating Color and Size Legends

MIT Licensed

Similar vizzes