Hey Folks, I’ve asked this on Stackoverflow but I think here is best
So, I am not a Web person so forgive-me if this is trivial.
I am trying to create a visualization using bokeh. I am using a custom Jijna template without the default {{ plot_div|indent(8) }} as I have my own schema:
where createBokehPlot returns a layout with the figure. The sidebar is created in the same manner.
The problem that I have is that by doing this the callbacks from the buttons on the sidebar are not called on the bokeh server side. I think that I have to add my elements to the document with add_root() but I am not sure exactly how. Any suggestions?
The components function only support standalone documents, not Bokeh server apps. For apps, you can use autoload_server, or iframe the app URL in your template. Currently this means apps can only be in "one piece". The ability to separately template different parts of an app in different locations on the page is an open feature request:
I can imagine some possible "workarounds" that are clunky/hacky (e.g. put in an HTML button with a JS callback that updates some bokeh object to communicate with the Bokeh server app in a roundabout way) but I'm not sure I'd advise them.
Hey Folks, I've asked this on Stackoverflow but I think here is best
So, I am not a Web person so forgive-me if this is trivial. I am trying to create a visualization using bokeh. I am using a custom Jijna template without the default {{ plot_div|indent(8) }} as I have my own schema:
<!-- *CustomCSS -->
<style>
{% include 'plots.css' %}
</style>
I add the plots to the template using components:
plotScripts, plotsDiv = createBokehPlot(df)
templateElements = dict(bokehPlotsScript=plotScripts, bokehSidebarScript=sidebarScripts, sidebar = sidebarDiv, bokehPlots = plotsDiv)
curdoc().template_variables.update(templateElements)
where createBokehPlot returns a layout with the figure. The sidebar is created in the same manner.
The problem that I have is that by doing this the callbacks from the buttons on the sidebar are not called on the bokeh server side. I think that I have to add my elements to the document with add_root() but I am not sure exactly how. Any suggestions?