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=0.1, title='power',
    callback=callback)
layout = vform(slider, plot)
show(layout)
Make bokeh charts with interactive controls in django