I have a Flask App in which my plots are created using Bokeh in the controller python code with below commands:
p = figure(tools = TOOLS, x_axis_label ...) p.line(....) script, div = components(p)
and I pass script & div elements to my HTML page by:
render_template(.html, script = script, div =div)
I want to add a interactive slider bar on top of my Bokeh plot.
Based on the Bokeh website with the following command, I should be able to do it.
slider = Slider(start=0, end=10, value=1, step=.1, title="Stuff")
So my first question is, how can I put slider information to the components function to generate correct “script” and “div” elements that I could pass it to my HTML file?
My second question is: Having a value on the slider, how can I post it back to my controller to update my plots and send the new “div” and “script” elements to the HTML file to update my plots?
I really appreciate if you could explain necessary steps to me to achieve this solution.