-
Notifications
You must be signed in to change notification settings - Fork 38
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
Layers dropdown to follow visible Data layer #244
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #244 +/- ##
==========================================
+ Coverage 89.17% 89.19% +0.02%
==========================================
Files 82 82
Lines 4037 4046 +9
==========================================
+ Hits 3600 3609 +9
Misses 437 437
Continue to review full report at Codecov.
|
1c0f95f
to
e1975f8
Compare
Thanks for the PR! The logic isn't quite right yet though - in the following example if I have a subset layer selected and I toggle the visibility of a data layer it will change the selection when it doesn't have to: I think the logic can actually be simplified. Basically if the current selected layer is visible, leave as is, otherwise select the next visible layer, and if there are none, the next previous visible layer - regardless of whether they are data or subset? @mariobuikhuizen - on the vue side, I am wondering if we can make things nicer by not actually allowing the user to select an item in the list if it is not visible? Maybe the logic for moving the selection when visibility is toggled could then even be on the vue side too? |
What do you mean? When you hide the second image, the first is shown. When people mess with the options, they want to see things change on what is actually shown. While I don't know why the subset stuff is poluting the dropdown, I think the toggle logic is less confusing than it currently is. If there is a simpler way to do this, I'll be happy too. |
The subset stuff is in the dropdown so that in principle you can change the visual properties of the subsets too. I realised that in jdaviz you may not want this though, so maybe we should have a way to remove subset layers from this dropdown (as an opt-in option that could be enabled in jdaviz). Layers can have transparency so it doesn't always make sense to select the 'top' visible layer. I think we should only change the selected layer if the current one has its visibility turned off (that was the more general point of my animation above). Note that there are viewers (in the general use case) where one might also only want to see some subsets and no data hence why I think the logic shouldn't be specific to data vs subset. That issue could be resolved by my previous point that subsets could be hidden in jdaviz if you wanted so there would only be data objects anyway. |
Well, as far as Imviz is concerned, no one is using the transparency thingy. In fact, they are even confused why there is a Data dropdown box at all. But I understand you have other use cases too, so I'll hold off on this until @astrofrog and @mariobuikhuizen can figure out a path forward. But we do this need for MVP, so a fast resolution would be nice. Thanks! |
Another real use case for the drop down is if you want to overlay contours and images though which is a jdaviz use case (one layer might be the contours and the other the image) |
Good point. Haven't gotten to fixing contour yet (spacetelescope/jdaviz#530) but it is not MVP, so... 😬 |
Description
This is to solve spacetelescope/jdaviz#743 for Jdaviz/Imviz. cc @astrofrog @maartenbreddels
Also fix a bug introduced by #249 cc @rosteen (moved to #250)
If this is accepted, we will need a release for Jdaviz.
imviz.add_markers()
.