Can boxzoom tool emit event

Hi,

Is it possible to emit some sort of event when using the boxzoom tool? Ideally I would like to disable/prevent inspect tools (i.e hover) from working while I am clicking in the plot area to zoom-in? I’ve looked in the documentation and didn’t come up with much. I also tried adding a customjs event with “Tap” but that didn’t work.

The reason I would like to do this is that if I have a plot with large number of data points and the hover tool is visible/active in the plot area and I try to zoom, that action is extremely slow. The moment the hover tool is not visible, the zooming action becomes very responsive.

Thanks,

Lukasz

Hi,

There is not currently any externally accessible event emitted upon BoxZoom. However, there are PanStart and PanEnd events:

  bokeh.events — Bokeh 3.3.2 Documentation
  bokeh.events — Bokeh 3.3.2 Documentation

These are emitted as soon as a mouse "drag" motion starts, and as soon as it ends, respectively. It's possible that these could be used to turn off hover tools at pan start and turn then back on again at pan end, and this might accomplish what you have described. However it's speculation, you will have to try and see. Also, This approach would turn off hover during any "drag" event, e.g. plot panning, box selection, not just box zoom (although perhaps it could be made more clever and look at the active tool first).

Thanks,

Bryan

···

On Aug 20, 2018, at 14:36, Lukasz Migas <[email protected]> wrote:

Hi,

Is it possible to emit some sort of event when using the boxzoom tool? Ideally I would like to disable/prevent inspect tools (i.e hover) from working while I am clicking in the plot area to zoom-in? I've looked in the documentation and didn't come up with much. I also tried adding a customjs event with "Tap" but that didn't work.

The reason I would like to do this is that if I have a plot with large number of data points and the hover tool is visible/active in the plot area and I try to zoom, that action is extremely slow. The moment the hover tool is not visible, the zooming action becomes very responsive.

Thanks,
Lukasz

--
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 [email protected].
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/f750d1d4-ddb5-4c1a-acbe-ee99892fdf79%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Thanks for the reply Bryan.

Indeed PanStart/PanEnd emit the sort of event I need to enable/disable the hover tool. One problem I encountered is that if the tooltip is visible (i.e. when the mode is set to “vline”) the tooltip remains visible even after it was disable. Is there any way I can force remove it? It seems that if the tooltip is visible, the zooming-in is still as slow. The way I enable/disable hovertool is by using “hover.active = false” in the customjs script.

Thanks,

Lukasz

···

On Tuesday, August 21, 2018 at 12:15:22 AM UTC+1, Bryan Van de ven wrote:

Hi,

There is not currently any externally accessible event emitted upon BoxZoom. However, there are PanStart and PanEnd events:

    [https://bokeh.pydata.org/en/latest/docs/reference/events.html#bokeh.events.PanStart](https://bokeh.pydata.org/en/latest/docs/reference/events.html#bokeh.events.PanStart)

    [https://bokeh.pydata.org/en/latest/docs/reference/events.html#bokeh.events.PanEnd](https://bokeh.pydata.org/en/latest/docs/reference/events.html#bokeh.events.PanEnd)

These are emitted as soon as a mouse “drag” motion starts, and as soon as it ends, respectively. It’s possible that these could be used to turn off hover tools at pan start and turn then back on again at pan end, and this might accomplish what you have described. However it’s speculation, you will have to try and see. Also, This approach would turn off hover during any “drag” event, e.g. plot panning, box selection, not just box zoom (although perhaps it could be made more clever and look at the active tool first).

Thanks,

Bryan

On Aug 20, 2018, at 14:36, Lukasz Migas [email protected] wrote:

Hi,

Is it possible to emit some sort of event when using the boxzoom tool? Ideally I would like to disable/prevent inspect tools (i.e hover) from working while I am clicking in the plot area to zoom-in? I’ve looked in the documentation and didn’t come up with much. I also tried adding a customjs event with “Tap” but that didn’t work.

The reason I would like to do this is that if I have a plot with large number of data points and the hover tool is visible/active in the plot area and I try to zoom, that action is extremely slow. The moment the hover tool is not visible, the zooming action becomes very responsive.

Thanks,

Lukasz


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 [email protected].

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/f750d1d4-ddb5-4c1a-acbe-ee99892fdf79%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.