react-timeseries-charts icon indicating copy to clipboard operation
react-timeseries-charts copied to clipboard

Inconsistent zoom scrolling behavior in Firefox vs Chrome

Open igozali opened this issue 7 years ago • 5 comments

When using the "scroll to zoom" feature in these examples in the Firefox browser (or any other React Timeseries Charts examples for that matter), the zooming is very slow to the point of affecting usability.

https://software.es.net/react-timeseries-charts/#/example/currency

I'm seeing this issue even in Firefox 61.0.1. I don't see this issue in Chrome 68.0.3440.84.

My suspicion is in the following function:

https://github.com/esnet/react-timeseries-charts/blob/master/src/components/EventHandler.js#L65

e.deltaY returns a very different value for Firefox and Chrome. I haven't had the chance to take a look at this further, though.

There are many articles out there talking about "normalizing mousewheel" events, but I'm not sure which approach would be better.

https://stackoverflow.com/questions/5527601/normalizing-mousewheel-speed-across-browsers

Also many issues reported in Firefox Bugzilla regarding scrolling behavior: Slow scrolling due to very small deltaY on wheel events (we use deltaMode = 1 (lines), IE/Chrome use 0 (pixels)) The value of deltaX and deltaY of WheelEvent should be in CSS pixels if its deltaMode is DOM_DELTA_PIXEL

igozali avatar Aug 07 '18 17:08 igozali

Thanks for bringing this up, and those links are very helpful. I've marked this as a bug and we'll try to figure out a solution. Thanks again.

pjm17971 avatar Aug 13 '18 15:08 pjm17971

The following yields a scroll speed I find pleasing in both Firefox and Chrome, but these things are always up for debate. Might make sense to add a configurable multiplicator :-)

const SCALE_FACTOR = typeof InstallTrigger !== 'undefined' ? 0.04 : 0.002; // check for Firefox

dirkdevriendt avatar Oct 12 '18 18:10 dirkdevriendt

I can put this in a PR if that makes it easier to test, but have to run, so not immediately.

dirkdevriendt avatar Oct 12 '18 18:10 dirkdevriendt

Wish I could do this !

zooming

hp8wvvvgnj6asjm7 avatar May 05 '19 20:05 hp8wvvvgnj6asjm7

Please...

hp8wvvvgnj6asjm7 avatar May 30 '19 14:05 hp8wvvvgnj6asjm7