How to attach a CustomJS callback to the ResetTool?

Hi all,
How can I attach a CustomJS callback to the ResetTool?

I successfully did the same for the BoxSelectTool - thanks to its ‘callback’ attribute.

Unfortunately, the ResetTool has no such attribute.

N.

The new js_on_change method on Bokeh models, added in 0.12.4, can attach CustomJS to arbitrary property changes. But it can also actually be attach to arbitrary backbone events. We've only advertised a few of these (e.g. "stream" and "patch") but I think the following would work for what you are asking:

  reset_tool.js_on_change('do', my_callback)

Apologies, I normally try to test things out to be sure but I don't have the bandwidth to do that right now.

Thanks,

Bryan

···

On Jan 18, 2017, at 6:08 PM, nicolas.fr <[email protected]> wrote:

Hi all,
How can I attach a CustomJS callback to the ResetTool?
I successfully did the same for the BoxSelectTool - thanks to its 'callback' attribute.
Unfortunately, the ResetTool has no such attribute.
N.

--
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/58ed1a91-7503-4df4-8209-ff7f5706e065%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

That works. Thanks a lot Bryan.
N.

···

Le jeudi 19 janvier 2017 01:49:02 UTC+1, Bryan Van de ven a écrit :

The new js_on_change method on Bokeh models, added in 0.12.4, can attach CustomJS to arbitrary property changes. But it can also actually be attach to arbitrary backbone events. We’ve only advertised a few of these (e.g. “stream” and “patch”) but I think the following would work for what you are asking:

    reset_tool.js_on_change('do', my_callback)

Apologies, I normally try to test things out to be sure but I don’t have the bandwidth to do that right now.

Thanks,

Bryan

On Jan 18, 2017, at 6:08 PM, nicolas.fr [email protected] wrote:

Hi all,

How can I attach a CustomJS callback to the ResetTool?

I successfully did the same for the BoxSelectTool - thanks to its ‘callback’ attribute.

Unfortunately, the ResetTool has no such attribute.

N.


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/58ed1a91-7503-4df4-8209-ff7f5706e065%40continuum.io.

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