Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Color Legend Practice

Public visualization

Color Legend Practice

0 stars0🌍 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

Comments

Sign in to join the discussion.

MIT Licensed