🌍 Public
Viewing a saved revision (read-only)
5c012ba8837442a69c0c4ddc294c7101
Scrol to zoom in and out
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 descriptionClick to Select