Trigger JS-function in code

Hi,

I am trying to run some Javascript-code directly in Python (I want to focus on a text input). In Bokeh 2, I used to create a dummy element with the CustomJS as a callback. I understand that with Bokeh 3.5, it is possible to run CustomJS directly (by calling CustomJS.trigger). But I cannot find documentation on this, and am not able to do it.

How can I execute JS-code directly?

I’m not sure what gave you the impression, but it’s not the case. trigger is an implementation detail that unfortunately and unavoidably poked through. It’s not really meant to be used be users, which is why it is not documented.

With recent versions of Bokeh, you can define your own DataModel subclass for triggering change events, which is a bit nicer than re-purposing some random hidden object as before. I’ve described that approach here several times before that you can search for.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.