Updating embedded plot from JavaScript

I created a bokeh plot in Python (annular_wedge), gave it a name, and exported it to json, as I found information in other posts:

plot = figure(..., name='my_plot')
data = json.dumps(json_item(plot))

and embedded it in JavaScript with

Bokeh.embed.embed_item(data, "divId")

and that works fine. I would now like to update that plot from JavaScript, possibly data and some colors. I tried exploring in the browser:

Bokeh.index.query_one((view) => view.model.name == "my_plot")

which has plenty of stuff but couldn’t find a way to do it. Is there a way to access the data and some properties?
Thanks!

It would be helpful if you showed some part of what is returned so that we can ensure we are on the same page going in. I have to assume a plot object was returned, and in that case, the plot has a renderers property that contains all the glyph renderers. Each glyph renderer in turn has a data source property with the ColumnDataSource for that renderer. That CDS is what you could potentially update.

In general, the best way to obtain help is to provide a complete Minimal Reproducible Example of th code that you have tried. That reduces speculation and allows for direct experimentation and generally will get you better answers, faster.

Thanks Bryan! I’ll try to make a MRE.