Skip to content
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

More zoom/pan modes? #8

Closed
naught101 opened this issue Aug 1, 2017 · 2 comments
Closed

More zoom/pan modes? #8

naught101 opened this issue Aug 1, 2017 · 2 comments

Comments

@naught101
Copy link

Currently there are these zoom/pan modes, that I can figure out:

  • LMB-drag: pan
  • MMB-drag: pan
  • Mousewheel: zoom
  • axis LMB-drag: pan single axis
  • axis MWL zom single axis.

It would be really nice to be able to use a few more of the pan and zoom modes available in PyQtGraph, specifically:

  • LMB-drag: change this to the drag-a-rectange-and-zoom-to-that mode (this mode is better for single-button users, more familiar for Matplotlib users, and the current functionality duplicated anyway)
  • RMB-drag: scale the scene on each axis independently
  • axis LMB-drag: if in the direction of the axis, normal behaviour, if in the perpendicular direction, then scale the axis instead. e.g. on the x axis, LMB click and dragging left and right will pan left and right as normal, dragging up will zoom in, and draggin down will zoom out. On the y axis, dragging right would zoom in (maintaining the "towards the plot is inwards" mapping), and left would zoom out. This behaviour is like the drag behaviour in Ableton, and is really quick and intuitive once you get used to it.

The first two of these are already available in PyQtGraph, the first one just needs to be turned on - I'm not sure why the second is not working. The third option probably needs new functionlity in PyQtGraph, but I though I'd post this here first and check.

This is some really nice software. I've been looking for something like this for ages :)
Both

titusjan added a commit that referenced this issue Aug 6, 2017
See issue #8
Removed 'open inspector' context menu from main window since is always disabloed or overridden.
titusjan added a commit that referenced this issue Aug 6, 2017
If checked the left mouse drag will draw a rectangle for zooming. If turned off (the default) left mouse button will drag.
See [issue #8](#8)
@titusjan
Copy link
Owner

titusjan commented Aug 6, 2017

Thanks for the feedback.

I have added a rectangle zoom mode configuration option that can be used to turn on the rectangle zooming mode. The default is still panning mode. I am slightly disappointed that the middle mouse button will also draw rectangles in rectangle zoom mode. The PyQtGraph docs say that: "Dragging the mouse with the wheel pressed down will always pan the scene".

The RMB-drag was disabled because it interfered with the context-menu (which overrides the standard PyQtGraph context menu since I don't want to support all its options). However I managed to fix it so RPM-drag zooming is now enabled.

You can try both fixes in the development branch.

About the axis LMB-drag, indeed this should be a feature request for PyQtGraph. It would be my preference that it only works for either the left or middle mouse button, and that the other mouse remains as-is and only drags. This way it is still possible to do only dragging on the axis.

@naught101
Copy link
Author

Cool, thanks.

I forgot to link back, but I already posted that MMB drag bug at pyqtgraph/pyqtgraph#522

I'll post the LMB-Axis drag bug there too.

titusjan added a commit that referenced this issue Oct 10, 2020
titusjan added a commit that referenced this issue Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants