Closed Mavromatika closed 7 years ago
Yes. Per the README on zoom.transform:
This method requires that you specify the new zoom transform completely, and does not enforce the defined scale extent and translate extent, if any. To derive a new transform from the existing transform, and to enforce the scale and translate extents, see the convenience methods zoom.translateBy, zoom.scaleBy and zoom.scaleTo.
The reason for this behavior is to give you some flexibility in designing your own zoom transitions and interaction. For example, you could allow the user to zoom outside the allowed area with some increasing elasticity during the zoom gesture, and then smoothly transition back to the allowed area when the zoom gesture ends.
Sorry, it had escaped me. Thanks for your answer. Enforcing the translate extent manually wasn't difficult anyway.
@Mavromatika, Can you please describe with an example how you did it manually?
Still working on implementing a custom transform to zoom in on specific elements (see previous issue). This time I found that
d3.zoomIdentity.translate().scale()
does not respectd3.zoom().translateExtent()
.See an example below :
Is this behavior intentional ? I would expect everything to respect a translateExtent set on the zoom function.