🌍 Public
Viewing a saved revision (read-only)
38b9872b210e43d8b964c6aed53956d5
Color Legend Practice
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