JS callback not updating source data on server-side

I fortunately found an answer and solution here: https://discourse.bokeh.org/t/bokeh-server-is-there-a-way-to-manually-sync-all-models-between-python-and-js/3206/3.

Editing the CustomJS callback to the code below will update the source data on the python side.

callback_spinner = CustomJS(args=dict(source=source), code="""
    var data = source.data;
    data['x'].push(cb_obj.value);
    source.data = data;
    source.change.emit();
""")
1 Like