d3.zoom.translateExtends
✓ Published0🌍 Public
SServuc
Last edited Aug 17, 2016
Created on Aug 16, 2016
This example demonstrates the zoom and pan capabilities of d3.zoom, using an SVG floor plan of the Grand Palace in Bangkok. The view is constrained within the map boundaries through the translateExtents method, preventing users from panning beyond the image edges. The code imports an Inkscape-generated SVG and applies d3.zoom with d3.event transforms to control the viewport. Zooming is limited to a specified scale range, and the SVG’s view group is updated accordingly to reflect the current transformation.
AI-generated descriptionBuilt with blockbuilder.org
gpl-3.0 Licensed