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

Viewer/layer labels #1465

Merged
merged 17 commits into from
Jul 14, 2022
Merged

Viewer/layer labels #1465

merged 17 commits into from
Jul 14, 2022

Conversation

kecnry
Copy link
Member

@kecnry kecnry commented Jul 7, 2022

Description

This pull request implements per-viewer labels showing the viewer reference name as well as the currently loaded/visible layers, with icons that are synced across all viewer/layer dropdown menus in the plugins.

In short, every viewer is given a numbered icon, and every layer is given a lettered icon, which is available to use app-wide (in the UI only) to quickly associate items in dropdowns with the applicable entries in the viewers. These numbers/letters are shown in the upper-right of the viewers to be as out-of-the-way as possible, but hovering over them expands to show the label of the viewer/layer.

Few use-cases (note: since these recordings, the viewer numbered icons have been hidden when there is only a single viewer):

Screen.Recording.2022-07-09.at.2.12.22.PM.mov
Screen.Recording.2022-07-09.at.2.15.17.PM.mov
Screen.Recording.2022-07-09.at.2.16.41.PM.mov
Screen.Recording.2022-07-09.at.2.30.37.PM.mov

included in this PR:

  • fix subset visibility check in spectrum-viewer (hiding data layers currently excludes the icon from displaying, but subset layers need separate logic) and directly check visibility of data layers rather than relying on the menu mixed/visible/hidden state.
  • fix bug where mask_viewer icon is not populated on load (likely just the traitlet not pushing the update to the UI or an order at which events are fired)
  • fix bug where new layer icon doesn't show in subset dropdown in plot options (for example: adding moment map to flux viewer and then edit plot options to contour only)
  • show relevant layer icon in mouseover display, compass, etc? (could replace the need to display in top-down order)
  • include layer icons in dataset dropdowns? (would not be able to color, since layers might be different colors in different viewers)
  • show relevant layer icon in data menu to associate with letters
  • test whether coordinate display updating on blink (but not mousemove) is broken by this PR or in main (and either fix or file separate ticket) - see Fix updating coordinate displaying when blinking via click #1470
  • what to do when running out of letters and/or vertical space?
  • hide viewer icon when only a single viewer?
  • color layer icons (might be different per-viewer) to effectively act as a legend? This might clash with any active/top indication and force us to use background color or "dot" markers for those instead of just turning the icon the active orange color.
  • cubeviz spectrum-viewer: indication of collapse method in expanded label.
  • icon to left of expanded label with spectral/spatial icon
  • display layer icons in top-down order
  • fix color reverting to gray when setting color_mode back to Colormaps
  • styling tweaks (iterate with @Jenneh)

Possible follow-up efforts

  • ability to click layer icons to set active layer for coordinate display? If this defaults to the top layer, then we need to distinguish if we're indicating both the top layer and "active" layer. Alternatively clicking could disable the layer (but then it would disappear from the list, which might be awkward UX).
  • ability to drag and drop to re-order z-order of layers
  • also color icons in layer dropdowns (but can't necessarily in data dropdowns since layers can be different colors in different viewers)
  • try to avoid the temporary extra entry during blinking (delay updating the state until blinking is complete)?
  • subset select components in plugins are in a somewhat random order - they should appear in alphabetical order
  • button to hide/dodge icons? Or perhaps option to only show the viewer number and then show layer letters when hovering over that?
  • use on-the-fly icon creation (via css) so we can control the font and handle numbers past 9 and letters past z
  • settings switch for including/excluding subsets from the shown layers?
  • re-order existing icons when deleting viewer/subset (to remove gaps)?

Closes #1426

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.

  • Are two approvals required? Branch protection rule does not check for the second approval. If a second approval is not necessary, please apply the trivial label.
  • Do the proposed changes actually accomplish desired goals? Also manually run the affected example notebooks, if necessary.
  • Do the proposed changes follow the STScI Style Guides?
  • Are tests added/updated as required? If so, do they follow the STScI Style Guides?
  • Are docs added/updated as required? If so, do they follow the STScI Style Guides?
  • Did the CI pass? If not, are the failures related?
  • Is a change log needed? If yes, is it added to CHANGES.rst?
  • Is a milestone set?
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@kecnry kecnry added this to the 2.8 milestone Jul 7, 2022
@github-actions github-actions bot added the embed Regarding issues with front-end embedding label Jul 7, 2022
@codecov
Copy link

codecov bot commented Jul 7, 2022

Codecov Report

Merging #1465 (91e733a) into main (163d1a3) will increase coverage by 0.04%.
The diff coverage is 92.77%.

@@            Coverage Diff             @@
##             main    #1465      +/-   ##
==========================================
+ Coverage   85.38%   85.42%   +0.04%     
==========================================
  Files          91       91              
  Lines        8476     8544      +68     
==========================================
+ Hits         7237     7299      +62     
- Misses       1239     1245       +6     
Impacted Files Coverage Δ
jdaviz/configs/imviz/plugins/compass/compass.py 69.44% <33.33%> (-3.29%) ⬇️
...nfigs/default/plugins/plot_options/plot_options.py 99.18% <88.88%> (-0.82%) ⬇️
jdaviz/app.py 92.43% <93.33%> (+0.02%) ⬆️
jdaviz/core/template_mixin.py 91.43% <95.65%> (-0.03%) ⬇️
jdaviz/configs/default/plugins/viewers.py 95.65% <96.66%> (+0.41%) ⬆️
jdaviz/configs/cubeviz/plugins/viewers.py 88.88% <100.00%> (+0.11%) ⬆️
...z/configs/imviz/plugins/coords_info/coords_info.py 97.56% <100.00%> (+0.06%) ⬆️
jdaviz/configs/imviz/plugins/viewers.py 82.55% <100.00%> (+0.10%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 163d1a3...91e733a. Read the comment docs.

Copy link
Contributor

@pllim pllim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nifty! I tried creating multiple viewers in Imviz via GUI and API, and it didn't break. Also appears nice on dark mode. 😉

jdaviz/container.vue Outdated Show resolved Hide resolved
* note: this includes subsets which are often on top of data layers.  The coordinate display currently shows the top *data* layer as indicated by the icon.
* remove unused traitlet
@kecnry kecnry marked this pull request as ready for review July 11, 2022 13:23
Copy link
Contributor

@javerbukh javerbukh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!!

@havok2063
Copy link
Collaborator

I think this looks good, especially with the colored labels <-> subsets. Can I click on the icon to quick-toggle the visibility of the layer?

@kecnry
Copy link
Member Author

kecnry commented Jul 13, 2022

Can I click on the icon to quick-toggle the visibility of the layer?

@havok2063 - not as part of this PR, unfortunately... but I'll add that to the list (in the PR description) of potential follow-up efforts. There was also some discussion of using clicking to select which layer is used for mouseover coordinate display, etc, so we will need to think through which is most convenient.

Copy link
Collaborator

@duytnguyendtn duytnguyendtn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well! Thanks Kyle!

@kecnry kecnry merged commit ecfb2ee into spacetelescope:main Jul 14, 2022
@kecnry
Copy link
Member Author

kecnry commented Jul 14, 2022

Thanks for the reviews/comments/suggestions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
embed Regarding issues with front-end embedding Ready for final review UI/UX😍
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Imviz: Show the name of the dataset being used for the cursor readback (currently in Compass)
5 participants