Skip to main content
Public

Share visualization

Loading preview…

Fork of Color and Size Legends

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Fork of Color and Size Legends

0
Jjay-goone
Last edited Jan 14, 2022
Created on Jan 14, 2022

Two reusable legend components render side by side in a single SVG canvas. The color legend uses d3.scaleOrdinal to map fruit names to discrete colors, drawing color-coded circles with labels, while the size legend uses d3.scaleSqrt to encode numeric values as circle radii. Both legends are built from SVG groups, with circles and text offset by a spacing variable, and update via enter/merge/exit selections in d3 v5.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed