Bokeh callbacks with CustomJS: trigger a callback from another callback with custom JS?

Is there a way to trigger a callback with CustomJS from inside another callback with custom JS? Additionally and related to the first question: is there a way to prevent triggering a callback when modifying the property or producing the event that triggers that callback? I have been trying to find information or a way to do this from the Bokeh docs but I can’t find anything.


Bokeh models have a tag property. You can set up some simple state machinery in your code to set that, and if there is an on-change callback registered to the tag, a callback that modifies the tag will cause the tag’s on-change callback to run.

I’ve also used tags in situations similar to what I think you’re describing in the second, related question, to basically limit recurrence of callbacks due to interactions between elements that are necessary (i.e. your prevent triggering requirement).

Other’s might have better suggestions on how to proceed, but judicious use of the tag property has served my applications well in the occasional circumstance where needed.


I thought of that, I will give it a try, because it seems like a good solution to my problem, for both questions.