Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

D3 Zoom

Public visualization

Viewing a saved revision (read-only)

7d1c643f73e1494ebd9ab4fee7ff3dac

D3 Zoom

0 stars1🌍 Public
KKhanin Sisaengsuwanchai
Last edited Jun 1, 2023
Created on Jun 1, 2023

This example demonstrates interactive zooming and panning on a scatterplot of 100 randomly positioned points. Users can scroll to zoom in and out within a scale extent of 0.5x to 4x, or click and drag to pan across the full-window SVG canvas. The visualization uses d3.zoom to attach zoom behavior to the root SVG element and applies the transform directly to that element’s `transform` attribute during the zoom event. Data is generated randomly with the `makeData` utility, and circles are bound and updated using D3’s data join pattern.

AI-generated description