Skip to main content
100%

Color Legend Practice

✓ Published0🌍 Public
Ccpsshan
Last edited Jul 16, 2019
Created on Jul 16, 2019

This visualization demonstrates two reusable legend components: a color legend for categorical data and a size legend for quantitative data. The color legend maps fruit names to colored circles, while the size legend uses a square-root scale to represent numeric values through circle radius. Built with d3.js v5, the example shows how SVG groups can be efficiently updated using the `selectAll` and `merge` pattern for incremental rendering. Both legends are created as modular functions that accept a selection and configuration properties, highlighting a flexible approach to legend creation.

AI-generated description
MIT Licensed

Similar vizzes