Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Constraints for D3 mouse wheel zoom behaviour

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?

like image 654
kreek Avatar asked Feb 22 '23 16:02

kreek


1 Answers

Here is my implementation of extents for d3.behavior.zoom.

We can probably make it more flexible, but hopefully that'll get things started.

like image 150
Jason Davies Avatar answered Mar 04 '23 09:03

Jason Davies