
I am currently looking for more information on using BokehJs as a frontend library for React.
So far I have not find any useful information except this post.
I’m embedding a plot created from a Flask backend. So far what I found by myself was is to use Bokeh like bellow, after installing @bokeh/bokehjs
import Bokeh from '@bokeh/bokehjs/build/js/bokeh.esm.min.js';
…
// and then
PlotGraph(){
fetch('http://localhost:5000/plot',
{
method: 'post',
body: ''
}
).then(response => response.json().then(data => {
const myNode = document.getElementById("bokeh_plot");
myNode.replaceChildren(); // clean previous plot
Bokeh.embed.embed_item(data, "bokeh_plot");
})
)
}
So far it’s working but I could not find any more information if this is the recommended approach. Couldn’t find more information regarding this use case.
Is there any? Could not find here either.
I’m also posting in here in case someone suffers as much as I did and this might be useful for her.

