D3 鼠标滚轮缩放行为的约束
d3 可视化库有一个很棒的鼠标滚轮和触摸缩放功能,但似乎没有办法限制它。如何修补 d3 缩放行为以添加最小值和最大值?
The d3 visualization library has a great mouse wheel and touch enabled zoom, however there doesn't seem to be a way to constrain it. How could one patch the d3 zoom behavior to add min and max values?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我对 d3.behavior.zoom 的范围实现。
我们或许可以让它更加灵活,但希望这能让事情开始。
Here is my implementation of extents for d3.behavior.zoom.
We can probably make it more flexible, but hopefully that'll get things started.