@Bryan I add an example, this one also fails in 2.3.0, it doesn’t in 2.2.3, the column length of the column data source changes when you choose a different number in the MultiSelect, the plot also updates when the MultiSelect value changes
from bokeh.models.widgets import MultiSelect
from bokeh.layouts import layout
from bokeh.plotting import figure, curdoc
from bokeh.models import ColumnDataSource, HoverTool
import numpy as np
import pandas as pd
#Column Data Sources
source_data = ColumnDataSource(
data=dict(X=[], Y=[], main_legend=[], color=[], marker=[], alpha=[])
)
def update(attr, old, new):
if plot_multi_select.value:
val = int(plot_multi_select.value[0])
else:
val = 1
x = np.linspace(0,val,val*10)
y = np.zeros_like(x)
y = x**val
df = pd.DataFrame()
df["X"] = x
df["Y"] = y
df["color"] = "blue"
df["alpha"] = 0.7
df["marker"] = "circle"
df["main_legend"] = str(val)
source_data.data.update(ColumnDataSource(data=df).data)
#Multiselect
plot_multi_select = MultiSelect(
title="Plot Select:",
value=["2"],
options=["2","3","4"],
height=200
)
plot_multi_select.on_change("value", update)
#main plot
plot = figure(
plot_width=1270,
plot_height=900,
tools="pan,wheel_zoom,box_zoom,reset,save",
toolbar_location="left",
output_backend="canvas",
)
# Plot scatter artist
sc = plot.scatter(
x="X",
y="Y",
source=source_data,
legend_field="main_legend",
size=10,
color="color",
marker="marker",
alpha='alpha',
)
TOOLTIPS = [
("(x,y)", "(@X,@Y)"),
("COLOR","$color[swatch]:color"),
]
hover = HoverTool(tooltips=TOOLTIPS, renderers=[sc])
plot.renderers.extend([sc])
plot.add_tools(hover)
plot.toolbar.logo = None
#legend
plot.add_layout(plot.legend[0], "right")
plot.legend.click_policy = "hide"
plot.legend.label_text_font_size = "8pt"
#grid
plot.grid.minor_grid_line_color = "#f2f2f2"
plot.grid.minor_grid_line_dash = "dashed"
#axis
plot.xaxis.axis_label = "X"
plot.yaxis.axis_label = "Y"
plot.xaxis.axis_label_text_font_size = "14pt"
plot.yaxis.axis_label_text_font_size = "14pt"
l = layout(children=[[plot,plot_multi_select]])
curdoc().add_root(l)
curdoc().title = "MINIMAL EXAMPLE"
curdoc().theme = 'light_minimal'