Skip to content

pan with mouse wheel pressed + box zoom on left button #4004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mzechmeister opened this issue Jul 1, 2019 · 4 comments
Open

pan with mouse wheel pressed + box zoom on left button #4004

mzechmeister opened this issue Jul 1, 2019 · 4 comments
Labels
feature something new P3 backlog

Comments

@mzechmeister
Copy link

I would like to have:

Currently, all three together do not work simultaneously. One needs to toggle the zoom/pan button, which is cumbersome.
So, how can I get this behaviour?

@etpinard etpinard added feature something new and removed feature something new labels Jul 2, 2019
@mzechmeister
Copy link
Author

mzechmeister commented Jul 2, 2019

A quick hack in plotly.min.js is to force to pan mode on middle button (e.buttons==4). Modify

:o="pan"),St.minDrag="lasso"

to

:o="pan"),4==e.buttons && (o="pan"),St.minDrag="lasso"

If zooming is active, the left button has naturally box zoom.

Yet, one short coming is, that the mouse pointer does not change to the pan look.

@mzechmeister
Copy link
Author

From the code I also noted that the shift key toggles temporary between pan/zoom.
This is currently a built-in way to toggle the behaviour with a keypress (instead of going to the modebar buttons).
But it does not work with ctrl, as requested here or implied by the code with e.ctrlKey checks.

@Nic30
Copy link

Nic30 commented Nov 28, 2021

@mzechmeister did you manage to get pan using middle button working?
Shift works (cursor has wrong icon however) but the middle button is more convenient.

@mzechmeister
Copy link
Author

@mzechmeister did you manage to get pan using middle button working? Shift works (cursor has wrong icon however) but the middle button is more convenient.

Yes, I have got it running. See here for a demo.

The code line with critical hack is here:
https://github.com/mzechmeister/csvplotter/blob/88c60c1aaf386dc5b86be09d147eebff4e2c2a7b/zoom_pan.js#L155

@gvwilson gvwilson self-assigned this Jul 12, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added feature something new P3 backlog labels Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P3 backlog
Projects
None yet
Development

No branches or pull requests

4 participants