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
Toggle selection of objects with shift+click #2326
Comments
This seems like a pretty reasonable feature, and perhaps not hard to implement. Would you be interested in working up a PR @jakirkham ? |
Could you please give me some pointers on where this would go? I'm a little unsure of how to start. |
My best guess is this code would have to change somehow. Does that seem right? |
As noted in the aforementioned PR, I don't think that change is working from a testing point of view and apparently has larger ramifications that I do not necessarily intend. It would be nice if someone else could try to address this issue as I still would like to see it solved. However, it is becoming clear to me that it is not an issue that I can easily solve myself. |
I've given this some more thought and wanted to run an idea by you and see what you thought. Is there or could there be a way to get just the item(s) that was selected in the last UI event? Simplest case being this shift+click case. It seems like with that information alone one could probably implement something in a callback that would give the desired behavior. |
well, offhand an idea would be that selection tools could save the old state of selection indices before updating them, and then stuff the old value into the not-very-used-or-documented |
Indeed currently I have a way of doing this now. However one of the problems I'm running into is it appears shift+clicking a selected object does not result in the callback being run. Instead it appears to be suppressed. Would it be reasonable to make a change to the selector logic in Bokeh to pick up these events? |
To advance the discussion, have put together PR ( #5781 ), which allows objects to be reselected. Even though it doesn't provide toggling of selected object in and of itself, it does provide the needed information to implement such functionality. Namely some history about how many times any object has been clicked. |
So I admit I have not been following recent discussion related to how selection should work in Bokeh. Is this issue still blocked or is there a way forward? |
A variant of this issue was implemented in PR #9994. Removal of a selection can be achieved through subtraction mode of a select tool (activated with Ctrl+Shift+gesture or from a context menu). |
Taking this example ( http://nbviewer.ipython.org/github/jakirkham/bokeh_examples/blob/master/Bokeh_Example_12.ipynb ), a user can shift click to select several objects. Currently, shift click on already selected object does nothing. It would be nice if this resulted in deselection of the currently selected glyph.
The text was updated successfully, but these errors were encountered: