-
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
Add polygon selection #371
Conversation
Tagging @astrofrog and @maartenbreddels for their awareness here |
Not sure what the CircleCI error here means... |
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.
Aside from a small comment about the icon below, I couldn't get this to work - for some reason the drag events are just not triggered. If I add 'click' to the events to listen to, then I can check that on_msg gets called when I click, but nothing happens when I click and drag. I'm using MacOS X and I see this on both Safari and Google Chrome.
The CircleCI error should be fixed by #372 |
I just tried this out in Jupyter lab and it works nicely! One small difference compared to other tools is that when the selection is being drawn, it is bright yellow while drawing is active, whereas for other selection tools it is a translucent grey. Would it be possible to make this new tool match the behavior of the existing ones? |
Done. |
Do you get any error when trying to use this polygon tool in Notebook? I get:
which looks suspiciously similar to the iostream messages reported here. |
@jfoster17 - when I use notebook I don't see any errors - either in the browser console or in the terminal where I started the notebook from. Clicking and dragging just doesn't do anything. |
I'm seeing the same thing - works great in lab, but no errors and no functionality in the notebook. I found something that, at least for me, makes it work in both environments, but maybe @astrofrog has a bit more insight into why this would be the case. So I think the issue might be the |
Fantastic! Thanks for this breakthrough Jon. Now there are just a few more things to clean up... |
0d29c54
to
b12d66a
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #371 +/- ##
==========================================
- Coverage 87.32% 86.65% -0.67%
==========================================
Files 89 89
Lines 4882 4937 +55
==========================================
+ Hits 4263 4278 +15
- Misses 619 659 +40
☔ View full report in Codecov by Sentry. |
I think this is good-to-go. I rebased to get the CircleCI fix. @astrofrog -- would you like to do another review? |
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.
Works great in both the scatter and image viewer, thanks! 🎉
Pull Request Template
Description
This adds a polygon/lasso-type selection tool to the image and scatter viewers in glue-jupyter using the MouseInteraction class provided in bqplot_image_gl. Creating subsets from arbitrary regions is a top priority for Alyssa before we show an alpha version of glue-jupyter-lab to the world.
For similarity with other selection tools it would have been nice to get the data back from the LassoSelector (as in this stalled PR), but getting that finished and into a released version of bqplot was probably going to take too long.
I hope that the new testing infrastructure can verify that adding a new default tool to the basic viewers does not mess things up for jdaviz.