The HoverTool works fine, but when we click on a glyph, the tooltip disappears and the callback is not triggered. Furthermore, an error message displays in the browser console :
TypeError: m is undefined
Bokeh</<[“models/tools/inspectors/hover_tool”]</s</e.prototype._update()
bokeh-0.12.0.min.js:17
Bokeh</<.backbone</</</y()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</g()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</p()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</c.trigger()
bokeh-0.12.0.min.js:23
Bokeh</<[“common/selection_manager”]</o</e.prototype.inspect()
bokeh-0.12.0.min.js:3
bound ()
self-hosted:760
Bokeh</<[“models/tools/gestures/tap_tool”]</i</e.prototype._select()
bokeh-0.12.0.min.js:17
Bokeh</<[“models/tools/gestures/tap_tool”]</i</e.prototype._tap()
bokeh-0.12.0.min.js:17
Bokeh</<.backbone</</</y()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</g()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</p()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</c.trigger()
bokeh-0.12.0.min.js:23
Bokeh</<[“common/ui_events”]</s</e.prototype._trigger_event()
bokeh-0.12.0.min.js:3
Bokeh</<[“common/ui_events”]</s</e.prototype._trigger()
bokeh-0.12.0.min.js:3
Bokeh</<[“common/ui_events”]</s</e.prototype._tap()
bokeh-0.12.0.min.js:3
Bokeh</<[“common/ui_events”]</s</e.prototype._hammer_element/</<()
bokeh-0.12.0.min.js:3
Bokeh</<[“hammerjs/hammer”]</</ct.prototype.emit()
bokeh-0.12.0.min.js:35
Bokeh</<[“hammerjs/hammer”]</</<.emit()
bokeh-0.12.0.min.js:35
Bokeh</<[“hammerjs/hammer”]</</K.prototype.tryEmit()
bokeh-0.12.0.min.js:35
Bokeh</<[“hammerjs/hammer”]</</<.process/this._timer<()
bokeh-0.12.0.min.js:35
h/<()
``
I have written a simple code to reproduce the problem :
# coding=utf-8
from bokeh.io import output_file, show
from bokeh.models import ColumnDataSource, TapTool, HoverTool, CustomJS
from bokeh.plotting import Figure
output_file("layout.html")
source = ColumnDataSource(
data=dict(x=[2,3,5], y=[8,5,2]),
name='source'
)
p = Figure(plot_width=550, plot_height=550, sizing_mode="fixed")
p.circle(x='x', y='y', source=source, size=50)
p.add_tools(TapTool(behavior='inspect', callback=CustomJS(code="alert('foo');")))
p.add_tools(HoverTool())
show(p)
``
If one removes the ‘inspect’ attribute from the TapTool, all works perfectly. Is there any reason for this conflict ?
" But, we
don’t want the “selective” effect of the TapTool" - I thought
TapTool always does a selection. I have never heard of setting the
behavior attribute - I wouldn’t be surprised if it’s broken - you
should feel free to open an issue though.
In the meantime I would suggest just manually styling the
selection/nonselection glyph so that even if it does a selection you
can’t tell - does that make sense?
Best,
Bird
To post to this group, send email to [email protected].
To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/b1c26bd7-072d-45ef-bed6-d1620f2ca519%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/b1c26bd7-072d-45ef-bed6-d1620f2ca519%40continuum.io?utm_medium=email&utm_source=footer).
For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).
This does seem like a bug, please file an issue with the sample code to reproduce.
Thanks,
Bryan
···
On Jul 18, 2016, at 5:24 PM, Sarah Bird - Continuum <[email protected]> wrote:
Hi!
"But, we don't want the "selective" effect of the TapTool" - I thought TapTool always does a selection. I have never heard of setting the behavior attribute - I wouldn't be surprised if it's broken - you should feel free to open an issue though.
In the meantime I would suggest just manually styling the selection/nonselection glyph so that even if it does a selection you can't tell - does that make sense? Appearance — Bokeh 3.3.2 Documentation
We try to use both HoverTool and TapTool on the same plot as you did in this Jupyter notebook : Jupyter Notebook Viewer
But, we don't want the "selective" effect of the TapTool, we just want it to trigger a callback, so its behavior attribute is set to 'inspect'.
The HoverTool works fine, but when we click on a glyph, the tooltip disappears and the callback is not triggered. Furthermore, an error message displays in the browser console :
TypeError: m is undefined
Bokeh</<["models/tools/inspectors/hover_tool"]</s</e.prototype._update()
bokeh-0.12.0.min.js:17
Bokeh</<.backbone</</</y()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</g()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</p()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</c.trigger()
bokeh-0.12.0.min.js:23
Bokeh</<["common/selection_manager"]</o</e.prototype.inspect()
bokeh-0.12.0.min.js:3
bound ()
self-hosted:760
Bokeh</<["models/tools/gestures/tap_tool"]</i</e.prototype._select()
bokeh-0.12.0.min.js:17
Bokeh</<["models/tools/gestures/tap_tool"]</i</e.prototype._tap()
bokeh-0.12.0.min.js:17
Bokeh</<.backbone</</</y()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</g()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</p()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</c.trigger()
bokeh-0.12.0.min.js:23
Bokeh</<["common/ui_events"]</s</e.prototype._trigger_event()
bokeh-0.12.0.min.js:3
Bokeh</<["common/ui_events"]</s</e.prototype._trigger()
bokeh-0.12.0.min.js:3
Bokeh</<["common/ui_events"]</s</e.prototype._tap()
bokeh-0.12.0.min.js:3
Bokeh</<["common/ui_events"]</s</e.prototype._hammer_element/</<()
bokeh-0.12.0.min.js:3
Bokeh</<["hammerjs/hammer"]</</ct.prototype.emit()
bokeh-0.12.0.min.js:35
Bokeh</<["hammerjs/hammer"]</</<.emit()
bokeh-0.12.0.min.js:35
Bokeh</<["hammerjs/hammer"]</</K.prototype.tryEmit()
bokeh-0.12.0.min.js:35
Bokeh</<["hammerjs/hammer"]</</<.process/this._timer<()
bokeh-0.12.0.min.js:35
h/<()
I have written a simple code to reproduce the problem :
# coding=utf-8
from bokeh.io import output_file,
show
from bokeh.models import ColumnDataSource, TapTool, HoverTool, CustomJS
from bokeh.plotting import Figure
output_file
("layout.html")
source
= ColumnDataSource(
data=dict(x=[2,3,5], y=[8,5,2]),
name='source'
)
p
= Figure(plot_width=550, plot_height=550, sizing_mode="fixed")
p
.circle(x='x', y='y', source=source, size=50)
p
.add_tools(TapTool(behavior='inspect', callback=CustomJS(code="alert('foo');")))
p
.add_tools(HoverTool())
show
(p)
If one removes the 'inspect' attribute from the TapTool, all works perfectly. Is there any reason for this conflict ?
The HoverTool works fine, but when we click on a glyph, the tooltip disappears and the callback is not triggered. Furthermore, an error message displays in the browser console :
TypeError: m is undefined
Bokeh</<[“models/tools/inspectors/hover_tool”]</s</e.prototype._update()
bokeh-0.12.0.min.js:17
Bokeh</<.backbone</</</y()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</g()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</p()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</c.trigger()
bokeh-0.12.0.min.js:23
Bokeh</<[“common/selection_manager”]</o</e.prototype.inspect()
bokeh-0.12.0.min.js:3
bound ()
self-hosted:760
Bokeh</<[“models/tools/gestures/tap_tool”]</i</e.prototype._select()
bokeh-0.12.0.min.js:17
Bokeh</<[“models/tools/gestures/tap_tool”]</i</e.prototype._tap()
bokeh-0.12.0.min.js:17
Bokeh</<.backbone</</</y()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</g()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</p()
bokeh-0.12.0.min.js:23
Bokeh</<.backbone</</</c.trigger()
bokeh-0.12.0.min.js:23
Bokeh</<[“common/ui_events”]</s</e.prototype._trigger_event()
bokeh-0.12.0.min.js:3
Bokeh</<[“common/ui_events”]</s</e.prototype._trigger()
bokeh-0.12.0.min.js:3
Bokeh</<[“common/ui_events”]</s</e.prototype._tap()
bokeh-0.12.0.min.js:3
Bokeh</<[“common/ui_events”]</s</e.prototype._hammer_element/</<()
bokeh-0.12.0.min.js:3
Bokeh</<[“hammerjs/hammer”]</</ct.prototype.emit()
bokeh-0.12.0.min.js:35
Bokeh</<[“hammerjs/hammer”]</</<.emit()
bokeh-0.12.0.min.js:35
Bokeh</<[“hammerjs/hammer”]</</K.prototype.tryEmit()
bokeh-0.12.0.min.js:35
Bokeh</<[“hammerjs/hammer”]</</<.process/this._timer<()
bokeh-0.12.0.min.js:35
h/<()
``
I have written a simple code to reproduce the problem :
# coding=utf-8
from bokeh.io import output_file, show
from bokeh.models import ColumnDataSource, TapTool, HoverTool, CustomJS
from bokeh.plotting import Figure
output_file("layout.html")
source = ColumnDataSource(
data=dict(x=[2,3,5], y=[8,5,2]),
name='source'
)
p = Figure(plot_width=550, plot_height=550, sizing_mode="fixed")
p.circle(x='x', y='y', source=source, size=50)
p.add_tools(TapTool(behavior='inspect', callback=CustomJS(code="alert('foo');")))
p.add_tools(HoverTool())
show(p)
``
If one removes the ‘inspect’ attribute from the TapTool, all works perfectly. Is there any reason for this conflict ?