🚀 Gen 5 of the leading AI app deployment platform launches October 6. Click for the livestream.

How to set scrollZoom using FigureWidget()?

how to set scrollZoom when using FigureWidget(). If works through plot(config={scrollZoom=True}).
Also, how would it be possible to zoom only x axis through mouse scrolling?

Hi @ctypsy,

Unfortunately, FigureWidget doesn’t support config options yet. See https://github.com/plotly/plotly.py/issues/1074.

Also, how would it be possible to zoom only x axis through mouse scrolling?

For 2D cartesian axes, you can do this by scrolling with the mouse on the x or y axis

-Jon

1 Like

I thought so. I’ve read through the issue you mentioned above.

Sorry for being annoying, but would it be possible to achieve scroll horizontal zoom with similar method than this one (through .layout.on_change_:

…and somehow recognize mouse scroll as appropriate event?

Thank you very much in advance @jmmease

Hi @ctypsy,

Not annoying at all, I definitely understand the drive to get something working! I’ll try to take a look at this for plotly.py 3.7.0, but I can’t guarantee it will make it in.

Now this isn’t something I’ve tried, but you might want to look at ipyevents. This looks to be designed to allow you to catch extra events around an ipywidget, and it even mentions wheel events.

If you do give it a try, please let us know how it goes!
-Jon

OMG, yeah, awesome idea! Jumping in…

1 Like