block by mbostock 4e3925cdc804db257a86fdef3a032a45

Pan & Zoom III

Full Screen

This example demonstrates using d3-zoom to pan and zoom an SVG element by applying an SVG transform using transform.toString. The zoom behavior is applied to an invisible rect overlaying the SVG element; this ensures that it receives input, and that the pointer coordinates are not affected by the zoom behavior’s transform.

Updated Example →

index.html