Skip to content
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

Closed
jakirkham opened this issue May 21, 2015 · 11 comments
Closed

Toggle selection of objects with shift+click #2326

jakirkham opened this issue May 21, 2015 · 11 comments

Comments

@jakirkham
Copy link
Contributor

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.

@bryevdv
Copy link
Member

bryevdv commented Apr 8, 2016

This seems like a pretty reasonable feature, and perhaps not hard to implement. Would you be interested in working up a PR @jakirkham ?

@jakirkham
Copy link
Contributor Author

Could you please give me some pointers on where this would go? I'm a little unsure of how to start.

@jakirkham
Copy link
Contributor Author

My best guess is this code would have to change somehow. Does that seem right?

@jakirkham
Copy link
Contributor Author

jakirkham commented Nov 23, 2016

I think PR ( #5484 ) should fix this.

Unfortunately I had trouble with the development build so was unable to test myself. 😞 Would appreciate advice on that if you are able.

Edit: In fact it seems to be this problem resurfacing.

@jakirkham
Copy link
Contributor Author

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.

@jakirkham
Copy link
Contributor Author

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.

@bryevdv
Copy link
Member

bryevdv commented Jan 6, 2017

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 cb_data parameter to customJS callbacks. They don't currently do this, but could be made to fairly straightforwardly I imagine.

@jakirkham
Copy link
Contributor Author

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?

@jakirkham
Copy link
Contributor Author

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.

@bryevdv bryevdv modified the milestones: 0.12.6, short-term Mar 15, 2017
@bryevdv bryevdv modified the milestones: 0.12.7, 0.12.6 May 16, 2017
@bryevdv bryevdv modified the milestones: 0.12.7, 0.12.8 Aug 21, 2017
@jakirkham
Copy link
Contributor Author

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?

@bryevdv bryevdv added this to the short-term milestone Sep 11, 2018
@mattpap
Copy link
Contributor

mattpap commented May 23, 2020

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants