-
Notifications
You must be signed in to change notification settings - Fork 6
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
Zoomable spectrum plot in the Spectrum Viewer #2133
Conversation
I'd like to find a way to do this that can be consistent across all our image views and plots. So maybe holding down Ctrl and dragging a box. Or a magnifying glass icon, that you can click on and then zoom, like in matplotlib. E.g.
|
I could see if I can make the zoom box activate upon holding down the ctrl key, but this behaviour should be able to to made consistent with all plots etc by setting the viewbox as I thought I would apply this behaviour to the Spectrum Viewer plot only at first to test and see if the scientists like the functionality of it, etc |
39879ad
to
a09061a
Compare
Note: |
041fc9a
to
209bfa5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly working well. A couple of code comments.
When I first open the spectum window, I am unable to move the ends of the range in the spectrum view. After pressing and releasing ctrl I can.
Also, does it work to make this work with the ROIs in the keyPressEvent and keyReleaseEvents.
Issue
Closes #2132
Description
The
SpectrumPlotWidget
inspectrum_widget.py
now uses a custom viewbox which overrides the mouse events of the standard ViewBox class. The custom viewbox uses theRectMode
mouse mode which uses a built-in zoom drag box. Now to pan the data, the middle mouse button can be used (by temporary using thePanMode
mouse mode). The right mouse button can be clicked to reset the zoom to its default. The right click menu for this plot has been disabled as it is not useful for this plot.Testing
make check
Acceptance Criteria
Load data into MI and use the Spectrum Viewer.
Click and drag a zoom box over the data to check the data is zoomed in as expected.
NOTE: the ToF range box has to be moved to zoom as clicking and dragging this box will move the box instead of creating a zoom box, e.g. below:
Use the middle and right mouse buttons to check they have the behaviour as mentioned above.
Documentation
will add release note