Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Scrol to zoom in and out

Public visualization

Scrol to zoom in and out

0 stars0🌍 Public
Aaxliao
Last edited Jul 20, 2019
Created on Jul 20, 2019

This example demonstrates a zoom interaction that progressively reveals or hides concentric circles centered at a fixed point. The user scrolls to zoom the entire SVG group, and as the scale factor decreases, circles become hidden one by one; zooming back in makes them visible again. The code uses `d3.zoom` with an event transform to update the group’s transform and compares the current scale value against the previous one to toggle circle visibility via `d3.select` and attribute changes. The circles are manually defined in a data array with fixed radii and IDs.

AI-generated description

Click to Select

Comments

Sign in to join the discussion.

MIT Licensed