Это не отвечает на вопрос о том, как передавать списки из ColumnDataSource
для построения линий, но, вероятно, есть и другой лучший способ.Вот пример, который выполняет пункты 2 и 3 сверху.
from bokeh.plotting import figure, curdoc, show, output_file
from bokeh.models import ColumnDataSource
from bokeh.layouts import column, row
from bokeh.io import curdoc
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randint(0,10,size=(5, 2)), columns=list('XY'),index=['A','B','C','D','E'])
#Plotting points on first chart.
pointchart=figure(plot_width=400, plot_height=400, tools='lasso_select',title="Point scatter")
pointchart_source= ColumnDataSource(df)
pointchart_glyph= pointchart.circle("X","Y",source=pointchart_source)
#Making point plot with same source.
linkedpointchart=figure(plot_width=400, plot_height=400, title="Point scatter_LinkedSource")
linkedpointchart.circle("X","Y",source=pointchart_source)
#Making plot populated by updated source.
newplot=figure(plot_width=400, plot_height=400, title="Point scatter New Source via Callback")
newdatasource= ColumnDataSource(df)
pglyph = newplot.circle(x='X', y='Y', source=newdatasource)
def newsourcecallback(attr, old, new):
indexvalues =list(pointchart_source.data['index'][new])
newdataframe= df.loc[indexvalues,:]
newsource=ColumnDataSource(newdataframe[["X","Y"]])
pglyph.data_source.data=newsource.data
print(indexvalues)
pointchart_glyph.data_source.selected.on_change('indices',newsourcecallback)
layout= row(pointchart,linkedpointchart,newplot)
show(layout)
curdoc().add_root(row(pointchart,linkedpointchart,newplot))
#bokeh serve --show Callback_workingExample.py