from __future__ import print_function

from bokeh.session import PlotServerSession

try:
    session = PlotServerSession(serverloc="http://localhost:5006", username="defaultuser", userapikey="nokey")
except requests.exceptions.ConnectionError:
    print("ERROR: This example requires the plot server. Please make sure plot server is running, by executing 'bokeh-server'")
    sys.exit(1)

sess.use_doc('widgets_server')

if __name__ == "__main__":
    print("\nPlease visit http://localhost:5006/bokeh to see the plots\n")

@@ -36,51 +36,1699 @@
 on%0A%0A
-from bokeh.session import PlotServerSession
+import sys%0Aimport requests%0Afrom datetime import date%0A%0Afrom bokeh.widgetobjects import HBox, VBox, HandsonTable, ObjectExplorer%0Afrom bokeh.objects import Plot, ColumnDataSource, DataRange1d, Glyph, LinearAxis, DatetimeAxis, Grid, HoverTool%0Afrom bokeh.glyphs import Line, Circle%0Afrom bokeh.session import PlotServerSession%0A%0Adef make_plot():%0A    source = ColumnDataSource(dict(%0A        dates  = %5B date(2014, 3, i) for i in %5B1, 2, 3, 4, 5%5D %5D,%0A        downloads = %5B100, 27, 54, 64, 75%5D,%0A    ))%0A    xdr = DataRange1d(sources=%5Bsource.columns(%22dates%22)%5D)%0A    ydr = DataRange1d(sources=%5Bsource.columns(%22downloads%22)%5D)%0A    plot = Plot(title=%22Product downloads%22, data_sources=%5Bsource%5D, x_range=xdr, y_range=ydr, width=400, height=400)%0A    line = Line(x=%22dates%22, y=%22downloads%22, line_color=%22blue%22)%0A    line_glyph = Glyph(data_source=source, xdata_range=xdr, ydata_range=ydr, glyph=line)%0A    plot.renderers.append(line_glyph)%0A    circle = Circle(x=%22dates%22, y=%22downloads%22, fill_color=%22red%22)%0A    circle_glyph = Glyph(data_source=source, xdata_range=xdr, ydata_range=ydr, glyph=circle)%0A    plot.renderers.append(circle_glyph)%0A    hover = HoverTool(plot=plot, tooltips=dict(downloads=%22@downloads%22))%0A    plot.tools.append(hover)%0A    xaxis = DatetimeAxis(plot=plot, dimension=0)%0A    yaxis = LinearAxis(plot=plot, dimension=1)%0A    xgrid = Grid(plot=plot, dimension=0, axis=xaxis)%0A    ygrid = Grid(plot=plot, dimension=1, axis=yaxis)%0A    return plot, source%0A%0Adef make_ui():%0A    plot, source = make_plot()%0A    data_table = HandsonTable(source=source)%0A    obj_explorer = ObjectExplorer(data_widget=data_table)%0A    vbox = VBox(children=%5Bplot, data_table%5D)%0A    hbox = HBox(children=%5Bobj_explorer, vbox%5D)%0A    return hbox
 %0A%0Atr
@@ -2034,16 +2034,19 @@
 1)%0A%0Asess
+ion
 .use_doc
@@ -2063,16 +2063,64 @@
 server')
+%0Asession.add_plot(make_ui())%0Asession.store_all()
 %0A%0Aif __n
@@ -2210,13 +2210,11 @@
 he plots
-%5Cn
 %22)%0A

Add glyphs/widgets_server.py example