-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Nested viewer toolbars #1140
Nested viewer toolbars #1140
Conversation
7c5ea31
to
81361ea
Compare
CI is failing because of the older pinned version of glue-jupyter. Hopefully updating that pin when 0.11.1 is out should clear up most, if not all, issues. |
Are you using a new feature only available in 0.11? |
Yes, I need the new support for assigning templates that was added in 0.11. |
b65cbb1
to
fc7e7cf
Compare
Codecov Report
@@ Coverage Diff @@
## main #1140 +/- ##
==========================================
+ Coverage 76.66% 76.72% +0.06%
==========================================
Files 82 87 +5
Lines 6483 6655 +172
==========================================
+ Hits 4970 5106 +136
- Misses 1513 1549 +36
Continue to review full report at Codecov.
|
1d9ba00
to
5131ced
Compare
@javerbukh - dark mode strikes again! Thanks for catching both of those - they should be fixed now. |
@kecnry That works thanks! I'll continue with the review. One other thing, the orange box seems to be off a little bit from where I would expect it to be: |
f597134
to
710a22c
Compare
* was raising error on viewer.repr since it didn't have an assigned template. We needed the inheritance for the traitlet, but it is now exposed to the frontend in app.py _create_viewer_item
* in a way that should be extendable once we have more nested tools. The other alternative would be to remove the slice tool from the toolbar and set _default_mouse_mode=SelectSlice in the cubeviz profile viewer. * clicking an "uncheckable" tool (home, plugin shortcuts, blink, etc) will revert to the previous selection instead of the default.
* and rename export-viewer -> export-plot
* allows for plugin shortcuts to feel more natural, but may need to reconsider if/when we implement more non-checkable tools (zoom reset, etc) or when moving implementation upstream.
* to be more consistent with other tools in the same group. Once active, blinking now requires clicking anywhere in the viewer itself (b key works whether the tool is active or not).
* needed to determine position for submenu
7491541
to
8ed7c62
Compare
That's a good question. I try to keep everything there to be strictly UI logic, so I don't think any user would ever need to access API for those (and until now, it has been strictly
I don't see any reason why something here that works in jupyter won't work when embedded, but I was also surprised by cross-browser issues, so extra testing never hurts! |
It's possible to implement, but with a few complications: right now the plugin shortcuts aren't "checkable" (they don't become active/orange). Clicking on another shortcut from another viewer still updates the viewer dropdown, which I think is useful, and we definitely don't want that to close the sidebar. The two options would be to make them "checkable" (I don't think we want that) or to check to see if that plugin is open and with that viewer selected, and if so, close the sidebar. Honestly, I'm hoping we eventually get rid of these buttons in favor of a more robust "viewer selector" similar to #1115 and see them as just helping users with the change in the meantime. |
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.
I don't know how to blink now using the new GUI. Left click turns it on and off. It used to blink when I click the button. Luckily the "b" key binding still works. (Doh, I was clicking on the button, not the image.)
Contrast/bias adjustment seems to be broken too. Instead of adjusting, it draws a region. Works with new bqplot-image-gl
, see #1149
Might be a problem when people open too many viewers in Imviz (Kyle said this will fix itself when we change the toolbar design again):
Now we seem to have two different ways to open the same plugin menu. Do we really need both? (Kyle said this will fix itself when we change the toolbar design again.)
- g-metadata-viewer | ||
- g-export-plot | ||
- g-plot-options |
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.
At least for Imviz, I propose rearranging the order to reflect better typical workflow logic. You want to adjust display first but save the plot last.
- g-metadata-viewer | |
- g-export-plot | |
- g-plot-options | |
- g-plot-options | |
- g-metadata-viewer |
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.
As per offline convo, we can defer this.
@@ -19,6 +19,8 @@ toolbar: | |||
- g-coords-info | |||
tray: | |||
- g-metadata-viewer | |||
- g-export-plot | |||
- g-plot-options | |||
- imviz-links-control | |||
- imviz-compass | |||
- imviz-aper-phot-simple |
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.
- imviz-aper-phot-simple | |
- imviz-aper-phot-simple | |
- g-export-plot |
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.
Wanted to add my quick two cents, but since we already have Jesse and Pey Lian's review, I won't go too deep into a full approval and rely on their more thorough reviews. On the surface, everything looks good on my side; everything is interactable the way I expected it to, and I don't see the scrollbar issue that Ricky's seeing
Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)] on win32, using Chromium: 98.0.4758.102
Description
This pull request implements a nested dropdown toolbar so that we can move the plot options directly into the toolbar and avoid covering the plot itself. In doing so, it also moves the "save plot" and "plot options" to new plugins in the sidebar, which can be opened to a given viewer with new tools in the toolbar (to the far right).
The new "nested toolbar" consists of up to 6 categories that should hopefully encompass any tools we develop in the future:
In order to avoid overflow onto two lines in cubeviz when the sidebar is opened, this also replaces the "DATA" button with an icon (icon itself up for debate/redesign). For the image viewers in cubeviz, the "zoom" and "pan" tools have also been merged to save space.
Screen.Recording.2022-03-07.at.10.56.29.AM.mov
Imviz with shortcuts to per-viewer plot options, saving, and compass:
Screen.Recording.2022-03-07.at.10.57.52.AM.mov
The behavior of the persistent slice indicator has also been slightly "improved". When clicking on a "non-checkable" tool (home, plugin shortcuts,
blink), the previously selected tool, if any, will be re-activated. If unchecking a "checkable" tool, then the toolbar will choose the first from a list of defaults that is the primary tool in its category. For cubeviz, this will currently always default to the slice indicator, but in the future may choose between the slice indicator and spectral line selector (see #1115), depending on which is currently active.Non-checkable tools (plugin-shortcuts) just act immediately and do not replace the primary item in the toolbar. We may need to reconsider this in the future and replace the plugin shortcuts with dropdown menu outside the toolbar.
Blink is now a checkable tool to feel consistent. You enable the tool and then click anywhere in the viewer to blink.
TODO:
FUTURE WORK
viewer.tools
/viewer.toolbar
and perhaps move implementation upstream, if interestedviewer._default_mouse_mode_cls
instead.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.CHANGES.rst
?