Access Bokeh widgets with javascript from react frontend

I am trying to connect my react widgets with my bokeh widgets. In the picture below you see on top my react widgets and in the bottom my bokeh widgets. The bokeh session is loaded by an autoload script.

Is there a way to access the input of these widgets by Javascrpit? I tried the standard approach, but ir only does change the input of the field and does not trigger the bokeh server.

var x = document.getElementById("widgetID");

x.value = "Example";

You can assign IDs to models and later get the models by calling Bokeh.documents[0].get_model_by_id. To trigger the change, you can then just alter the appropriate model.

1 Like