Fire event at the end of a lasso-selection

Hello,

I use a scatter plot combined with CustomJS and a lasso-selection (similar to this example: Interactions - PyViz Tutorial 0.6.1).

The lasso-select will trigger an event, every time a new point falls into the currently active selection. How ever my attached event-action is very time consuming, therefore I only want it to be triggered, when the user is finished with his selection. Is there a way to bind an event to the end of a lasso selection?

Found an answer, managed to use this by using SelectionGeometry Event combined with checking that its attribute final is True:

        def select_group(event):
            if event.final is True:
                print(selector.selected.indices)

        scatter.on_event(SelectionGeometry, select_group)
1 Like