mwcraig / ipyevents

A custom widget for returning mouse and keyboard events to Python. Documentation:
https://ipyevents.readthedocs.io/en/latest/index.html
BSD 3-Clause "New" or "Revised" License
115 stars 27 forks source link

Add rectangular selection and/or lasso selections #9

Closed mwcraig closed 3 years ago

mwcraig commented 6 years ago

See https://github.com/jupyter-widgets/ipywidgets/pull/1727#issuecomment-339057129 and following comments

pbugnion commented 6 years ago

How did you see this implemented? I think Jason's comment about pushing that interaction to JavaScript and just returning the selection makes sense.

Should this be a new widget -- at the same level as Event?

e.g.

class RectangleSelector(CoreWidget):

    _selection_style = # define the style of the rectangle selector?

    def _on_selection(self, callback):
        # register handlers
mwcraig commented 6 years ago

Yeah, that might make more sense. One of the things I like about the current structure is that the JavaScript code is fairly simple. I'd also imagine there is a js library for selections out there.

mwcraig commented 3 years ago

Closing, because I agree this is out of scope for ipyevents.