Hi,
Our application is using D3 to generate charts, and we use zoom behaviors to provide zooming and panning.
I'm getting complaints from users that when they are using their scroll wheel to scroll through one of our application's web pages, as soon as it scrolls to the point where their mouse is over a chart, then the scroll wheel stops scrolling the document and starts zooming that chart.
I was thinking of solving that by changing the behavior such that it only consumed wheel events while a modifier was pressed (eg. ctrl+scroll = zoom chart, scroll without ctrl is ignored and processed by the browser).
Looking at behaivour/zoom.js it does not look like that is currently supported, all mouse wheel events are consumed regardless of any modifiers, but it would be easy to add:
1. Add a function to allow setting the desired modifiers that have to be pressed in order for wheel events to be processed
2. In the mousewheeled() function, return immediately if an event occurs which does not match those modifiers (allowing the event to propagate upwards)
Of course if the modifiers are not set then it should behave as it does today.
So, my questions are: first, have I missed anything - is there some better way to do this without actually modifying D3?
Second - would such a feature be accepted if I did implement it?
Thanks for any feedback!
Regards
Mike