On Jun 18, 2018, at 09:16, Mateusz Paprocki <mpaprocki@anaconda.com> wrote:
Hi,
On Mon, Jun 18, 2018 at 4:18 PM, Sébastien Roche <sebastienroche11@gmail.com> wrote:
Is there a way to access the active attribute of a hovertool from a python callback? Just like what that JS callback does:
Tool.active is an internal property (to bokehjs), so no. However, I'm not sure exactly why it is this way. I don't see any reason for not allowing users to configure active tools programmatically. Perhaps this has something to do with initialization of toolbars, which is pretty complicated. Maybe Bryan will have some more concrete feedback. Otherwise this seems something that could be improved.
Mateusz
from bokeh.models import CustomJS, Button
from bokeh.plotting import figure
from bokeh.layouts import gridplot
from bokeh.io import show
fig = figure(tools='hover')
hover = fig.toolbar.tools[0]
button = Button(label='HoverOnOff',width=150)
button.callback = CustomJS(args={'hover':hover},code="hover.active = !hover.active;")
x = range(10)
fig.scatter(x,x)
grid = gridplot([[button,fig]])
show(grid)
--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/a1e07f09-668e-413a-a637-83023771d448%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CANFzp8jqdyz9ybeOe9YXkkZ7r0hRqxhxy9ARaFa-m9Kv3BfXRg%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.