Skip to main content
Public

Share visualization

Loading preview…

76. D3 Data Join Key

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

76. D3 Data Join Key

0
Aamakanju@nyit.edu
Last edited Feb 23, 2026
Created on Feb 23, 2026

Clicking the text removes the first value from a bar chart, demonstrating D3's data join with a custom key function. Each bar is an SVG `rect` bound to an object with `key` and `value` properties; removal triggers an exit transition that slides the bar off-screen left. The remaining bars animate to new positions via `transition.attr`, while labels update text but not exits, a known limitation. The example uses `d3.scaleBand`, `d3.scaleLinear`, and D3 v4.5.0.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed