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
PPeter S
Last edited Sep 18, 2019
Created on Aug 24, 2019

Two reusable D3 v5 legends illustrate color and size encoding side by side in a React-based VizHub example. The color legend maps an ordinal scale with fruit categories to red, yellow, green, and orange circles, while the size legend uses a square-root scale to map numeric ticks to proportional circle radii. Both legends are built with SVG selections, enter/merge/exit patterns, and custom parameters like spacing and text offsets. The page also demonstrates asynchronous data loading with a Promise, filtering car listings to generate a formatted report.

AI-generated description

An example showing the capabilities of VizHub - color legend

Comments

Sign in to join the discussion.

MIT Licensed