Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Zoomable Circles with D3-Zoom

Public visualization

Viewing a saved revision (read-only)

e01d5268c6b1418a90539ade85f7e028

Fork of Zoomable Circles with D3-Zoom

0 stars0🌍 Public
00pal
Last edited Nov 21, 2024
Created on Nov 21, 2024

This example demonstrates a zoomable scatterplot of colored circles, where users pan and zoom the entire visualization through mouse or touch interactions. The code uses D3’s `zoom` behavior and applies the resulting transform to a group element containing the circles. The circles are defined with hardcoded positions, radii, and fill colors, rendered with SVG elements. It showcases a reusable pattern for integrating d3-zoom with state management, as the transform is stored via a `setState` callback.

AI-generated description

A demonstration of how to add panning and zooming using d3-zoom.

Challenge

  • Use this technique to add zooming to a visualization you created, such as a map