
what i am trying to do:
have a slider that selects data from a list, and plots that. moving the slider should cause the data with index corresponding to the slider value to be plotted
code that i have so far:
# make some fake data
time = np.linspace(0,1,100)
all_traces = [np.random.random(100) + x for x in np.arange(10)]
output_notebook()
source = ColumnDataSource(data=dict(x=time, y=all_traces[0],all_traces=all_traces))
trace_fig = figure(width=500, height=500)
trace_fig.line('x','y',source=source)
slider = Slider(start=0, end=10, step=1, value=2, max_height=30, max_width=500)
callback = CustomJS(args=dict(source=source,
slider=slider),
code="""
source.data.y = source.data['all_traces'][slider.value]
source.change.emit();
""")
slider.js_on_change('value', callback)
show(layout([
[slider],
[trace_fig],
]))
the problem:
bokeh yells at me that:
BokehUserWarning: ColumnDataSource's columns must be of the same length. Current lengths: ('all_traces', 10), ('x', 100), ('y', 100)
which is correct. and it only plots the first 10 points. any help here would be much appreciated! thank you!

