Question: how exactly does jinja2 embedding work in a Bokeh server? which parts of the code handle the embedding itself?
The reason I ask is that I hope it helps us in finding the root cause or a workaround for the following:
We are running into the issue that in some situations embedded jinja2 code inside a Bokeh app is placed outside of the divs in which the embed block is put in the HTML. This issue is described in this bug report:
Earlier it was just an annoyance as it only happened when one did not focus the browser during initialization, but now that we deployed the app on a virtual machine the issue consistently happens. The VM is a bit slower than our laptops, so it may be related to a timeout somewhere where the embedding happens too slowly and Bokeh server “decides” to put the HTML in before the embedded code is ready, after which the embedded code is just appended to the document. Does this make sense?
Any help or directions are appreciated