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

Proposal for a toggle setting for mouseover marker #9

Closed
wants to merge 9 commits into from

Conversation

bmorris3
Copy link

Description

After sprint planning today, @kecnry and I discussed some ideas for how to toggle the mouseover marker and coordinate info. We talked about some of the difficulties with adding a new button to the toolbar, and decided we might scope out alternatives first.

This PR is a small addition to spacetelescope#1894 which toggles the mouseover marker and coordinate info with a switch in the Plot Options plugin, under the Settings drop-down. Demo below:

JDAT-3038.mov

I decided to contribute this suggestion as a PR to @pllim's PR, since (1) it depends on @pllim's implementation in spacetelescope#1894, and (2) it has a pretty small diff. Happy to make a PR to base:spacetelescope/jdaviz if that's better.

🐱

Change log entry

  • Is a change log needed? If yes, is it added to CHANGES.rst? If you want to avoid merge conflicts,
    list the proposed change log here for review and add to CHANGES.rst before merge. If no, maintainer
    should add a no-changelog-entry-needed label.

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 milestone set? Set this to bugfix milestone if this is a bug fix and needs to be released ASAP; otherwise, set this to the next major release milestone.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

pllim and others added 9 commits January 5, 2023 09:25
in all the configurations supported by Jdaviz.
when out of bounds.
spec1d mouseover. Also remove unnecessary re-computation in the internals.
A new internal cache on app level is introduced.
* only used in spectrum profile viewers
* currently ALWAYS on
(or default tool - slice in cubeviz, for example)
* including clearing cache when subset is changed and ignoring hidden layers
@bmorris3 bmorris3 requested a review from pllim as a code owner January 18, 2023 01:52
@bmorris3 bmorris3 changed the title Proposal for JDAT 3038 Proposal for a toggle setting for mouseover marker Jan 18, 2023
Copy link

@kecnry kecnry left a comment

Choose a reason for hiding this comment

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

I am beginning to like this place for the switch more and more (and might even prefer it to eventually moving it to a "markers" plugin). Thanks!

Comment on lines +68 to +71
# only handle mouseover markers if the setting is selected:
plot_options_plugin = self.jdaviz_app.get_tray_item_from_name('g-plot-options')
if not plot_options_plugin.show_mouseover_marker:
return
Copy link

Choose a reason for hiding this comment

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

I think we want only the marker to be toggled, but still show the information in the panel. So self.label_mouseover.marks[self._reference_id].visible = plot_options_plugin.show_mouseover_marker somewhere.

Copy link
Author

Choose a reason for hiding this comment

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

I think the only place where we assign the LHS of the above snippet to True is here:

self.label_mouseover.marks[self._reference_id].visible = True

so I'll change that True to plot_options_plugin.show_mouseover_marker

Copy link

Choose a reason for hiding this comment

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

right. Alternatively, the switch could act as the current locking_active (but probably renamed), and the text in the plugin changed to reflect that. That actually would probably be my vote (the switch controls both the marker AND exposing the coordinates of the nearest spectrum, but the mouse position is always exposed).

@@ -19,6 +19,14 @@
persistent-hint
></v-switch>
</v-row>
<v-row>
<v-switch v-if="config=='specviz'"
Copy link

Choose a reason for hiding this comment

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

cubeviz and mosviz also have spectral viewers, so I think we want the switch there as well.

Suggested change
<v-switch v-if="config=='specviz'"
<v-switch v-if="['specviz', 'cubeviz', 'mosviz'].indexOf(config) !== -1"

@kecnry
Copy link

kecnry commented Jan 18, 2023

If we move forward in this direction, I think we'll probably also want to consider removing the locking_active logic (to always act as True) to make this so that the switch alone determines whether the marker is always or never shown.

@pllim
Copy link
Owner

pllim commented Jan 19, 2023

spacetelescope#1894 is merged, so I am closing this here. Feel free to resubmit this patch as PR straight to Jdaviz. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants