A slider is a graphical track bar that controls the value by moving it on a horizontal scale. We can change the values of the graph without affecting its formatting. Let's see an example of a slider:
# Import the required modules
from bokeh.plotting import Figure
from bokeh.plotting import output_notebook
from bokeh.plotting import show
from bokeh.models import CustomJS
from bokeh.models import ColumnDataSource
from bokeh.models import Slider
from bokeh.layouts import column
# Show output in notebook
output_notebook()
# Create list of data
x = [x for x in range(0, 100)]
y = x
# Create a DataFrame
df = ColumnDataSource(data={"x_values":x, "y_values":y})
# Instantiate the Figure object
fig = Figure(plot_width=350, plot_height=350)
# Create a line plot
fig.line('x_values', 'y_values', source=df, line_width=2.5, line_alpha=0.8)
# Create a callback using CustomJS
callback = CustomJS(args=dict(source=df), code="""
var data = source.data...