Color Legend Practice
✓ Published0🌍 Public
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 descriptionMIT Licensed