How to drag-to-select (e.g. box selection, or lasso selection)? #1820
nicogreenarry
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to build these two features:
What's the best way to do these?
I can imagine ways to build them from scratch using some of Visx's tools, but maybe there are easier ways?
E.g.: for box select: Use Drag to track the cursor's movement, and draw a semitransparent rect from the start to the end point of their drag. When they release, manually calculate which points are inside that region, and change their point appearance to indicate visually that they're selected.
And for lasso select, use something like in the Drag II example to draw the lasso.
But if there are built-in tools for doing some of the things I anticipate doing manually, I'd love to know about them.
Beta Was this translation helpful? Give feedback.
All reactions