Hi,
I am runnig a bokeh server, the application so far can update multi_line glyph’s data source defined outside of callback function using button click. However, I cannot do the same using js_on_change which is understandable as it runs on browser side. Can you suggest me how can I achieve the same desired functionality using bokeh server on browser side? You can find the code below:
I think my question also relates to this issue https://groups.google.com/a/continuum.io/forum/#!searchin/bokeh/on_change$20%22tap%22$20callback$20/bokeh/DE0sGO80x5I/ivjRh4BsEwAJ , do I need to use IPython.notebook.kernel.execute to pass data from *python into javascript ? *
from bokeh.plotting import figure, output_file, show
from bokeh.models import ColumnDataSource, CDSView
from bokeh.models import CustomJS,ColumnDataSource,Slider,Plot,DataRange1d,HoverTool,Button,Legend
from bokeh.plotting import figure, curdoc
from bokeh.layouts import row,column
p = figure(plot_width=400, plot_height=400)
source = ColumnDataSource(data=dict(x=,
y=,
color=,
alpha= ))
some_dic = {“x” : [[1,1],[1,1]],“y” : [[200,100],[100,0]],“color” : [“firebrick”,“navy”],“alpha”: [0.8,0.3]}
i = 1
p.multi_line(xs=‘x’,ys=‘y’,line_color=‘color’,alpha = ‘alpha’,line_width=4,source=source)
slider = Slider(start=1, end=12, value=1, step=1, title=“months”)
def callbackSummaryPlot():
print (‘Radio button option selected.’)
global some_dic,i
print(i,“i”)
i+=1
source.data = some_dic
button = Button(label=“Foo”, button_type=“success”)
button.on_click(callbackSummaryPlot)
#p.js_on_event(‘tap’,CustomJS.from_py_func(callbackSummaryPlot))
curdoc().add_root(column(button,p))
Thanks