I have two questions about the TapTool, that I couldn’t find an answer in the documentation.
i) My main question is, how to use multiple TapTools. I have two data sources and want to have different callbacks on each one.
I’ve tried the “add_Tools” function, but it didn’t work.
ii) My second question is, how to disable the “selective” behavior. When I click on a node, every other node gets grayed out.
Is there a way to disable this behavior?
There should not be any issue with adding multiple tap tools on a single plot. But it’s not clear what “it didn’t work” actually means (JS errors? Python errors? Unexpected behavior? If so, what?) What is really necessary to speculate is more information, as well as a Minimal Reproducible Example.
As it happens, TapTool with inspection and OpenURL are not yet compatible. There is an open WIP Pull Request right now to make things work together in that case:
This will hopefully land in one of the upcoming releases in the near future. In the immediate term, I can only suggest using standard selection (as in the OP) and if you don’t want the appearance change of “selection” than changing the default selection appearance to simply not look any different:
Okay, thanks. Glad I could help on improving TapTool
Now that I know, that this is simply not compatible yet, I will stick to the default behavior.
But I still have one question left. I’m unable to use both TapTools at the same time.
I can only select one TapTool at the time.
How can I activate both TapTools at the same time as default.
I’ve tried to follow the documentation here:
But I don’t know how to use it in my case.
I’ve tried something like this:
This was the missing clarification of “didn’t work” that I was looking for. Currently, only one tool of each gesture type (tap, pan, scroll, etc) can be active at one time, so this is expected. You will have to rework things to use a single tap tool. If you code above is an actual representation of your real code, you could potentially use a single source for and one call to circle, with a color column so color mapper to shade different circles differently, Alternatively, a CustomJS that calls window.open on URLs could be made work with multiple glyphs.