Bokeh Widgets Update Method access from Javascript

The documentation makes mention of a widget’s update method, for example,

image

I use flask and the components feature of bokeh to embed plots and widgets.

I find bokeh widgets by name in Javascript with,

            function getBokehElByName(name) {
                for (let i in Bokeh.index) {
                    bokeh = Bokeh.index[i];
                    var el = bokeh.model.document.get_model_by_name(name);
                    //console.log(bokeh, el);
                    if (!bokeh) {
                        continue;
                    }
                    if (el) {
                        return el;
                    }
                }
                return el;
            }

And then I try and modify some aspect of the widget, for example, a slider like this,

el.start = new_start;
el.end = new_end;

I have been using this architecture from ver 0.11! And it has served well.

However, I think modifying the widget in this way is not correct. I have tried to inspect and find the update method, but I can’t find or access it…

Q: Can I access the widget’s update method from Javascript?

There is no update method on the BokehJS side, however I believe setv will do what you want.