Skip to main content
Public

Share visualization

Loading preview…

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

Color and Size Legends

0
TToooooooT
Last edited Sep 18, 2022
Created on Sep 18, 2022

Two legend components built with D3.js v7 appear in a single SVG scene. The color legend uses `d3.scaleOrdinal` to map fruit names—apple, lemon, lime, orange—to distinct hues, with each tick rendered as a circle and label. The size legend employs `d3.scaleSqrt` to map numeric values from 0 to 10 into circle radii, showing five ticks. Both legends are constructed via reusable JavaScript modules that append `g` elements and merge enter/exit selections, with CSS styling the tick text and circle strokes.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed