-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Doc issues + Rectangular or lasso selection is not available out of the box, right? #2658
Comments
Correct, deck.gl does not have the notion of "selection". Rectangular selection can be implemented with |
I believe "lasso" type selections are indeed implemented in some of our internal deck.gl (or rather nebula.gl) applications the way I believe you are proposing, by creating a non-pickable "mask" layer with a polygon that covers the screen and has a lasso-shaped hole. Then any non-hidden objects can be picked with However, I don't think the technique required any custom/subclassed layers, the standard polygon layer did the trick. @georgios-uber am I getting this right? Does nebula.gl itself contains any code or example of this technique? |
Oh, thanks: That sounds like an interesting approach. For now I'll try to get the rectangular selection first, and then look at the lasso: If I get something tidy, I'll post an example here. (For me, making a composite layer seemed like an easy way to distinguish the behavior and style for the selected and unselected objects, but I could see putting if-thens in the properties, too.) Feel free to close? |
Yes, nebula uses standard deck methods to implement selection. |
@georgios-uber : Thanks! I'll look deeper into that. I filed some small PRs on the docs, but I think I'm still confused by the relationship between
I may be interpreting it wrong, but it doesn't seem to work that way for me:
produces:
The I've also tried something like nebula, here, but for me the |
Your JSX stanza ( You need to get a ref to the actual DeckGL React component, that ref will have the functions you seek. https://github.com/uber/deck.gl/blob/master/modules/react/src/deckgl.js#L79 Google "React refs" to see how this is done, i.e. |
That solves that problem. Thank you! I'll close this. There are still issues, but it's on my side: My data has coordinates from 0-50000, and if I try too large of a region I have an error in
Figuring out exactly what that limit is:
So, for me, I think I'll keep my coordinates as they are, and implement my own region selection, but may revisit this in the future. Thank you again! |
First, in the docs for "Adding Interactivity", the links here
should probably go to
instead of
because the picking methods are covered in the docs for Deck, but not in the docs for the DeckGL component.
Second, in the Deck docs there is some confusion:
Should the example there be about
pickMultipleObjects
rather thanpickObject
?Finally, in early 2017 it looks like there was an idea of supporting rectangle or lasso selection. I don't think lasso was ever implemented, and for rectangular region selection, an earlier questioner was pointed to the
pickObjects
docs #1683.I wanted to confirm that there's no built-in notion of selecting a set of objects. I've started doing something like this...
and then, using my particular data structures...
... which lets me select individual objects, but maybe there's a better way? Thanks!
The text was updated successfully, but these errors were encountered: