Skip to main content
Public

Share visualization

Loading preview…

Brushing Circles with D3

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

Brushing Circles with D3

0
DDonald Bagwell
Last edited Sep 2, 2024
Created on Sep 1, 2024

This example demonstrates interactive brushing on a set of five colored circles. Users can drag a rectangular selection region, and any circle whose center falls within that area is highlighted with a thick black stroke. The visualization updates its state through D3's `brush` API, using the `on('brush')` and `on('end')` events to track the selection. The circles are rendered as SVG elements with hardcoded coordinates and colors, and the highlighted set is managed via a `Set` stored in the component’s state.

AI-generated description

Creating circles with D3.

Challenge

  • Fork this example
  • Modify it
  • Maybe make it Halloween themed
  • Maybe make it Christmas themed
  • Be creative

Comments

Sign in to join the discussion.

MIT Licensed