Hi,
I have a bokeh server with multiple streaming plots in a single session. I am able to embed the entire document using autoload_server(model=None) option.
How do i embed a particular plot from the bokeh server session?
Let say, I have “bokeh_plot.py” containing:
plot1 = figure(plot_height=400, plot_width=400, title=“my sine wave”,
tools="crosshair,pan,reset,save,wheel_zoom",
x_range=[0, 4*np.pi], y_range=[-2.5, 2.5])
plot1.line(‘x’, ‘y’, source=source, line_width=3, line_alpha=0.6)
plot2 = figure(plot_height=400, plot_width=400, title=“my sine wave”,
tools="crosshair,pan,reset,save,wheel_zoom",
x_range=[0, 4*np.pi], y_range=[-2.5, 2.5])
plot2.circle(‘x’, ‘y’, source=source, line_width=3, line_alpha=0.6)
Some routines
curdoc().add_root(row(plot1, plot2))
curdoc().add_root(row(plot1))
curdoc().add_root(row(plot2))
``
and, “app.py” containing
@app.route(’/’)
def index():
session = pull_session(app_path=’/bokeh_plot’)
script = autoload_server(model=None, app_path="/bokeh_plot",session_id=session.id)
return render_template(‘index.html’, bokeh_script=script)
``
I first start the bokeh_plot server:
bokeh serve --allow-websocket-origin=127.0.0.1:5000 bokeh_plot.py
``
And, then run the “app.py”
python app.py
``
Here, In the app.py program, I am expecting something like model=plot.
Also, If i can get an example for creating multiple session within “bokeh_plot.py” serving for plot1 and plot2 separetly, It would be very helpful for me.
Thanks,
Satish.