Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Color and Size Legends

Public visualization

More options

Embed on a websiteCopy iframe embed code

Embedding does not grant access to private visualizations or project datasets.

Download & exportHTML, source ZIP and authorized project data

Source ZIP contains editable visualization files; it does not include project datasets. Standalone HTML is available where authorized and packages readable referenced data for offline use. Dataset ZIP requires project read permission.

Standalone HTMLSource ZIP
Publishing & handoffCopy a client maintenance summary

Includes the canonical link, visibility, and available export formats. Confirm dataset attribution, licensing and maintenance responsibilities with the publisher.

Color and Size Legends

1 star61🌍 Public
CCurran Kelleher
Last edited Jun 9, 2019
Created on Sep 24, 2018

This example demonstrates how to construct custom legends for both color and size encodings in D3 v5 with SVG rendering. The color legend displays four ordinal categories—apple, lemon, lime, and orange—using d3.scaleOrdinal, while the size legend uses d3.scaleSqrt to map numeric tick values to circle radii. Both legends use reusable functions that bind data to groups, append circles and text, and position them with translate transforms.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed