-
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
Plot options rewrite #1343
Plot options rewrite #1343
Conversation
dd0910e
to
b1573e0
Compare
Codecov Report
@@ Coverage Diff @@
## main #1343 +/- ##
==========================================
+ Coverage 84.78% 84.93% +0.15%
==========================================
Files 91 91
Lines 8023 8339 +316
==========================================
+ Hits 6802 7083 +281
- Misses 1221 1256 +35
Continue to review full report at Codecov.
|
e13c6ec
to
6819ecb
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.
Looks good. I see more styling updates for the general plugin but that is outside the scope of this ticket.
Needs a rebase to fix change log -- FYI |
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.
SOLVED: I get this traceback if I create a second viewer in Imviz, load an image in the second viewer, and then select the second viewer in Plot Options.
.../ipywidgets/widgets/widget.py in set_state(self, sync_data)
543 from_json = self.trait_metadata(name, 'from_json',
544 self._trait_from_json)
--> 545 self.set_trait(name, from_json(sync_data[name], self))
546
547 def send(self, content, buffers=None):
.../contextlib.py in exit(self, typ, value, traceback)
124 if typ is None:
125 try:
--> 126 next(self.gen)
127 except StopIteration:
128 return False
.../traitlets/traitlets.py in hold_trait_notifications(self)
1214 for changes in cache.values():
1215 for change in changes:
-> 1216 self.notify_change(change)
1217
1218 def _notify_trait(self, name, old_value, new_value):
.../ipywidgets/widgets/widget.py in notify_change(self, change)
604 # Send new state to front-end
605 self.send_state(key=name)
--> 606 super(Widget, self).notify_change(change)
607
608 def repr(self):
.../traitlets/traitlets.py in notify_change(self, change)
1227 def notify_change(self, change):
1228 """Notify observers of a change event"""
-> 1229 return self._notify_observers(change)
1230
1231 def _notify_observers(self, event):
.../traitlets/traitlets.py in _notify_observers(self, event)
1264 c = getattr(self, c.name)
1265
-> 1266 c(event)
1267
1268 def _add_notifiers(self, handler, name, type):
.../jdaviz/core/template_mixin.py in _on_viewer_changed(self, msg)
448 if new != old:
449 self._clear_cache()
--> 450 self._on_layers_changed()
451
452 @observe('filters')
.../jdaviz/core/template_mixin.py in _on_layers_changed(self, msg)
457 if not isinstance(viewer_names, list):
458 viewer_names = [viewer_names]
--> 459 viewers = [self.app.get_viewer(viewer) for viewer in viewer_names]
460
461 manual_items = [{'label': label} for label in self.manual_options]
.../jdaviz/core/template_mixin.py in (.0)
457 if not isinstance(viewer_names, list):
458 viewer_names = [viewer_names]
--> 459 viewers = [self.app.get_viewer(viewer) for viewer in viewer_names]
460
461 manual_items = [{'label': label} for label in self.manual_options]
.../jdaviz/app.py in get_viewer(self, viewer_reference)
439 The viewer class instance.
440 """
--> 441 return self._viewer_by_reference(viewer_reference)
442
443 def get_viewer_by_id(self, vid):
.../jdaviz/app.py in _viewer_by_reference(self, reference)
997 viewer_item = self._viewer_item_by_reference(reference)
998
--> 999 return self._viewer_store[viewer_item['id']]
1000
1001 def _viewer_item_by_reference(self, reference):
TypeError: 'NoneType' object is not subscriptable
</details>
This comment was marked as resolved.
This comment was marked as resolved.
bd9ce7c
to
d38bea1
Compare
Rebased and fixed handling retrieving layers for imviz viewers without names.
It's easy to hide if that's what we want to do (maybe there are cases where you want to see the scale, but at least this information is available from toolbar when mousing over pixels). The whitespace is an issue upstream that also affects cubeviz/mosviz - we need to force a redraw when toggling the axes. If you resize the viewer panel, it will force it to adjust and fill the space appropriately. I'll bring this up for discussion and we can decide whether to keep or remove the toggle in imviz. |
This comment was marked as resolved.
This comment was marked as resolved.
For Imviz:
Otherwise, it seems to work great for Imviz. And I think allowing people to set stretch etc for multiple viewers at once is a killer feature. Great work! 👏 |
In Cubeviz, it gets confusing to see FLUX listed twice when select all is done for everything. I understand that one of them is the spectrum but I am not sure if a new user would know that. I wonder if Select All should exclude the spectrum viewer... p.s. When I am in multi-select mode, sometimes the options like stretch does not show even though I only have one thing selected in that mode. But if I change back to simple mode and select the same thing, it shows. I do not know the exact steps to reproduce this as I was clicking on things to look at other stuff. |
* immediately overrides by setting the list. * this could be triggered by default selection as well, and avoids needed exceptions to pass lists in all of those cases.
* image.state.visible doesn't seem to actually affect image visibility and we already have the image and contour toggles
785fbc9
to
e43750e
Compare
e43750e
to
7f10c09
Compare
I think I've addressed most/all of the previous comments. I couldn't reproduce some of the tracebacks anymore, but am not sure the exact workflow to reproduce them, so please do let me know if you can still find ways to trigger them. I think there's still one big open question for this PR (or possibly as a follow-up): how should options for subsets be categorized? Right now, options for subsets in the profile viewer show up under the line subsection (and are toggled with "show line"), whereas subsets in the image viewer are toggled with "show subset" but do NOT have any exposed options for color or opacity. Changes to consider:
This is all very hard to explain in text or screenshots, the best way to understand is to open cubeviz, create a spatial subset and a spectral subset, and then play with the plot options, especially in advanced mode. |
Running the Imviz example notebook, I added "my_sky" markers and then removed them using I have to stop here for the day, so this is by no means final review comment. I wonder if we should just get this in, and then open follow-up issues to avoid this dragging on and getting stale... |
I agree with @pllim. Lets get this in and test with real use cases. |
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 agree with the other reviewers. This is a marked improvement over the previous plot options, even though it still needs a few iterations. I would suggest delaying the 2.7 release for another sprint to give time for any bug fixes after we merge this. Great work!!
P.S. maybe the dark mode fix could be at the top of that bug list? 😄
How about when Kyle is back next week, we make a list of follow-up issues and then merge this? |
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 am just gonna approve this with the agreement that this PR will have a list of follow-up issues linked to it as future work.
Description
This pull request implements custom jdaviz plot options that we can modify/style as well as an "advanced" mode (off by default) that allows for editing plot options across multiple viewers/layer simultaneously. In order to do this, the Select plugin components had to be updated to support toggling between single and multi-select, and a new Select component had to be created for generic (both subset and data) layers.
When in "advanced" mode, entries with "mixed-states" between the different entries will have an overlay that can be clicked to "unmix" the states:
This PR does not address all the styling changes requested for the plot options yet, but provides the framework for us to make those changes in follow-up efforts.
This supersedes the proof-of-concept in #1103.
In the default "simple" mode, the behavior is very similar to previously, except the plot options have been separated into sections and re-ordered to be more useful in jdaviz:
Screen.Recording.2022-05-25.at.10.17.51.AM.mov
Turning on "multiselect" mode now enables more advanced use-cases:
Screen.Recording.2022-05-25.at.10.18.48.AM.mov
including the ability to set stretch across multiple layers simultaneously:
Screen.Recording.2022-05-25.at.10.21.42.AM.mov
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
?