Embed individual live graphs in Flask

Dear bokeh community,
I am running a bokeh server with several live-update (streaming) figures, interactive widgets and also static components.
I am trying to embed parts(!) of that webpage into a flask webpage.
After trying very hard to get this to work i have the impression that i have the choice between two things:

  1. Use server_session or server_document to get the script code from the entire bokeh webpage. This can be successfully integrated into the html and the entire application can be nicely embedded into flask (keeping the live update and interactive functionality)
  2. Use script_k, div_k = component(session.document.roots[k]) to extract an individual component and then try to embed that in the html. However, doing so, the live upadate and interactive functionality is lost.

Is there a way to fetch individual components from the bokeh server side (figures, widgets, etc…), embed those at individual places in the flask app and keeping the functionality (live updates, interaction, etc…)

Would be great to get some more info on this! Thanks already in advance.

The components API is only for standalone (i.e. non-server) content. It is not intended or suitable for Bokeh server apps. The options for apps are server_session and server_document

Is there a way to fetch individual components from the bokeh server side

In principle this should possible, however I have to be up front that it is very much not well-established practice. The server_session API accepts a model as its first parameter, which is intended to be able to render specific models from an existing session (e.g. initiated by pull_session). There are some basic unit tests for this usage but in nearly a decade almost no-one has ever asked about, so I can’t point to any concrete examples, either official or otherwise. (As with all things OSS, the most frequently used thigns get the most of limited maintainer bandwidth.)

Thank you very much Bryan,
I appreciate your feedback - I take it from there that this is currently not really possible.
Would you mind quickly having a look at my other question at:
Problems with signed session ids from bokeh - Community Support - Bokeh Discourse
?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.