python 2.7 - Saving Interactive Bokeh Chart -
i have created interactive bokeh chart various widgets allow manipulation of data. want understand standard way of sharing such plot or how save sharing.
the plot created curdoc method , output bokeh server using session.show().
#create current visualization using plot p , widgets inputs curdoc().add_root(hbox(inputs, p, width=1100)) #run session session = push_session(curdoc()) session.show() # open document in browser session.loop_until_closed() # run forever
does app trigger actual python code?
if not, might consider reworking non-server standalone document (using customjs
callbacks, instance). generate self-contained static html file publish or send anywhere, , have accessible.
if app does rely on executing actual python code work, needs running somewhere users interact it. first off, suggest make real app runs in server, ones in demo app gallery (see use case scenarios in user's guide). real server app, i.e. 1 run bokeh serve myapp.py
, preferred on using bokeh.client
, "publishing" scenarios (it simpler/less code , more performant). then, distributing app mean few things:
- you give them script , run
bokeh serve app.py
locally themselves - you "deploy" app leaving running on server url accessible users want able see it
depending on how compute app does, , how many users expect @ given time, second option simple running bokeh serve app.py
somewhere. if there heavy compute or expect lot of traffic, may need more sophisticated "scale out" deployments behind load balancer. more information in deployment scenarios in user's guide, , of course happy wth more extended discussions on public mailing list. finally, should mention in near future, automated scalable publishing of bokeh applications available feature on https://anaconda.org/
Comments
Post a Comment