I have a project that displays “live” plots in a web interface. The web interface is a Flask application, and the plots are generated in a client process that generates png files continuously and notifies the Flask application that there is a new image to show. I am interested in replacing this setup with something that uses Bokeh if I can. From what I can tell (e.g. https://stackoverflow.com/a/39535545, https://bokeh.pydata.org/en/latest/docs/reference/client/session.html), with Bokeh it is not recommended to generate server plots in a client. I have a lot of different clients (i.e. Python scripts) that generate different plots. The only things that change as a client is running are the data and annotations. So it seems like one a approach I could take is to put all of the plotting functions into the Bokeh server app and have the client ask Bokeh to generate a particular plot and then stream updates to the data. One disadvantage with doing this is that it seems that the one Bokeh server has to contain the plotting logic for all of my plotting clients/scripts (barring dynamically loading code in some way) and would need to be restarted if any plotting code changed.
Does this seem like a good approach to using Bokeh in my project? If so, what could I look at to see how to communicate with a server, so my client could connect to the server, trigger it to generate a particular plot, and stream data updates to it? Another approach might be to split all of my client scripts into two – a data acquisition/processing process and a Bokeh server process for plotting (so every client starts a new Bokeh server). Or maybe there is a better way to do what I want to do?