There are two uses:
without server
If you can perform any updates in JS (no need to call valid python code), then it is very easy to add interactions using CustomJS callbacks . There are many examples on this link, but a simple simple code example looks like this:
from bokeh.io import vform from bokeh.models import CustomJS, ColumnDataSource, Slider from bokeh.plotting import Figure, output_file, show output_file("callback.html") x = [x*0.005 for x in range(0, 200)] y = x source = ColumnDataSource(data=dict(x=x, y=y)) plot = Figure(plot_width=400, plot_height=400) plot.line('x', 'y', source=source, line_width=3, line_alpha=0.6) callback = CustomJS(args=dict(source=source), code=""" var data = source.get('data'); var f = cb_obj.get('value') x = data['x'] y = data['y'] for (i = 0; i < x.length; i++) { y[i] = Math.pow(x[i], f) } source.trigger('change'); """) slider = Slider(start=0.1, end=4, value=1, step=.1, title="power", callback=callback) layout = vform(slider, plot) show(layout)
This will create a standalone HTML document with a Bokeh chart and a slider that will update the chart in response to the slider, without the need for a server (i.e. you can send it to someone or send it to a static page and it will work).
with server
If you want widgets, interactions, etc. Managed real Python code (e.g. scikit-learn or Pandas), you need to use a Bokeh server. Fortunately, the new server with version 0.11 is much more reliable, functional, scalable and easy to use. You can see several deployed Bokeh applications live (with links to their source code):
http://demo.bokehplots.com/
As well as extensive documentation on the various deployment types in the documentation:
http://bokeh.pydata.org/en/0.11.1/docs/user_guide/server.html
bigreddot
source share