Skip to main content
Public

Share visualization

Loading preview…

D3 Annotation Example

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

D3 Annotation Example

0
AAlark Joshi
Last edited Apr 15, 2025
Created on Apr 15, 2025
Forked from D3 Starter

This example demonstrates the d3-annotation library, which adds customizable labels, connectors, and callouts to an SVG visualization. It displays four distinct annotation styles—basic labels, labels with arrow connectors and text wrapping, curved connectors with dot endpoints, and a circular callout—placed on a blank white canvas without any underlying data or scales. The code uses the `d3.annotation()` factory method with `d3.annotationLabel` and `d3.annotationCalloutCircle` types, configuring properties like note position, offset, and connector style. Each annotation is manually positioned with x/y coordinates and rendered by appending a group to the SVG.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed