Skip to main content
100%

Color and Size Legends

✓ Published0🌍 Public
UUzma Khan
Last edited Jun 29, 2019
Created on Jun 29, 2019

This example demonstrates two reusable legend components for D3 visualizations: a color legend using an ordinal scale to map named categories to distinct colors, and a size legend using a square-root scale to encode numeric values through circle radius. The legends render as SVG groups with circles and labels, using d3.scaleOrdinal and d3.scaleSqrt. Both components employ the enter/merge/exit pattern to update efficiently, with a video link provided in the README.

AI-generated description
MIT Licensed

Similar vizzes