dbuezas / lovelace-plotly-graph-card

Highly customisable Lovelace card to plot interactive graphs. Brings scrolling, zooming, and much more!
371 stars 16 forks source link

Zooming behavior - graph zooms when it slides under the mouse pointer while scrolling a page #273

Closed wixoff closed 1 year ago

wixoff commented 1 year ago

Describe the bug On my Linux/Gnome laptop using Firefox, I ordinarily scroll the page using two fingers up/down on my trackpad. In doing so, if a plotly graph card happens to arrive under my mouse pointer, the page will stop scrolling and the graph will zoom in or out instead. In the middle of a page-scrolling attempt this is usually undesired.

If it's possible, consider zooming the graph ONLY when a gesture begins over the card.

dbuezas commented 1 year ago

Hi 👋 This is actually the intended behaviour, and also the way it works in my mac. In desktop, this is handled by plotly itself, on mobile this card takes care of it (because plotly doesn't have "native" multi touch mobile support). I can't reproduce the behaviour you are describing, could you record a video where I can see both the touchpad and the screen at the same time? maybe that way I can code a workaround for however it is that linux+firefox handle this.

wixoff commented 1 year ago

Oh that's interesting, this seems to be a Firefox issue -- Chrome doesn't have the problem.

I have used Firefox for decades and I do prefer it . . . but it sure does test me sometimes! Let me see if I can figure out any more background info.

dbuezas commented 1 year ago

btw, you can always disable scroll to zoom if this is getting in your way:

config:
  scrollZoom: false # this is a "native" plotly option
disable_pinch_to_zoom: true # this is specific to this card and meant for touchscreens only but I don't know how firefox handles touchpads. It also disables two finger drag to zoom on touchscreens 
wixoff commented 1 year ago

OK, I think I'll close this. scrollZoom: false works well enough for me, since I have the zoom buttons available anyway.

Thanks for looking into this!