flekschas / regl-scatterplot

Scalable WebGL-based scatter plot library build with Regl
https://flekschas.github.io/regl-scatterplot/
MIT License
185 stars 21 forks source link

allow to deselect via lasso? #105

Open japrescott opened 1 year ago

japrescott commented 1 year ago

Hey @flekschas

Thanks again for this great library. As an idea I was wondering how easy it would be to after selecting different regions with the lasso tool, to then be able to deselect certain subregions also with the lasso mode, eg. when pressing shift+option+ctrl? I am happy to have a poke at this if you think this would be a good addition?

Best

flekschas commented 1 year ago

I think this would be a nice addition. And it shouldn't be too hard to implement this but it'd required adjusting a few different functions:

  1. We need to extend checkModKey() to accept a tuple of action keys
  2. We need to extend the handling of the action key map to allow combinations of multiple keys. Maybe via concatenation with +. E.g., alt+shift.
  3. We need to add a new action key for removing points. E.g., KEY_ACTION_REMOVE
  4. We need to extend the select(), lassoEnd() lasso manager's end() functions to allow remove.