How to add doubletap tool in a bokeh plot

How can I create doubletap event on a glyph and use callback like OpenUrl for a bokeh plot?
By using TapTool I can use OpenUrl callback on clicking on a glyph but I am wondering is there any way to do the same using doubletap?

If you don’t actually need a tool icon in the toolbar then the simplest thing would be an on_event or js_on_event callback for the DoubleTap event. If you need an actual tool, that would require making a custom extension.

1 Like

Appreciating your response @Bryan . By using js_on_event callback I am able create a DoubleTap event in my network plot. By using cb_obj I can control the position(x, y, sx, sy) of the DoubleTap event. However I want to trigger the DoubleTap event only double-tapping over a glyph. After many trials I could not find a way to get the selected position of a glyph and I am stuck in it.
In my scenario I have a network plot with nodes and edges. I want to trigger the DoubleTap only after double-tapping on any node(a glyph). I am very very new to javascript. Any reference or example code will be really helpful.
P.S. I was able to achieve the same functionality for single tap using TapTool callback.

I am afraid there is not any quick/easy way to achieve this currently. The DoubleTap event just tells you the location of the event, but does not do any hit-testing on glyphs. You could potentially do hit testing manually yourself, either in Python or JS, but neither case would a trivial undertaking, and I don’t have any example code to share for it. Conversely, the TapTool, which does do hit-testing on glyphs, is not currently configurable to respond to anything except double taps. It seems like it might be fairly easy to ad support for that, so please feel free to open a GitHub issue to propose it as a new feature.

1 Like

Thanks @Bryan for clarifying the things out.
Added a new feature request github issue #10309

1 Like