Skip to main content
100%

Simple Zoom Example v4 II

✓ Published0🌍 Public
TThanaporn-sk
Last edited Apr 5, 2017
Created on Apr 5, 2017

This example demonstrates a simple zoom interaction on an SVG canvas populated with 50 randomly placed blue circles. The circles are generated using `d3.range` and assigned random `cx` and `cy` coordinates within the canvas dimensions. The zoom behavior is implemented with the `d3.zoom()` method, which triggers a `zoom` event handler that applies the transform to the circle group. The code uses the D3 v4 library and specifically the `d3.zoom()` API, along with `d3.select` and `attr` for SVG manipulation.

AI-generated description

This is an simple example of adding zoom to your graph.

Click here to read a more detailed explanation on how zoom works.

forked from <a href='http://bl.ocks.org/puzzler10/'>puzzler10</a>'s block: <a href='http://bl.ocks.org/puzzler10/91a6b53d4237c97752d0e466443dad0b'>Simple Zoom Example v4 II </a>

mit Licensed

Similar vizzes