Is there an attribute of bokeh.models.widgets.tables.DataTable, or the underlying ColumnDataSource, that indicates the order of the data? I would like to have the columns of a bar chart reorder when the table is sorted by clicking on the column headers, but I can’t find any attribute that I can use to trigger the figure update.
For example:
`import pandas as pd
from bokeh.models.sources import ColumnDataSource
from bokeh.models.widgets.tables import DataTable, TableColumn
from bokeh.plotting import figure
from bokeh.layouts import layout
from bokeh.io import curdoc
df = pd.DataFrame({‘x’: [‘a’, ‘b’, ‘c’],
‘y’: [1, 2, 3]})
source = ColumnDataSource(df)
my_table = DataTable(source=source,
columns=[TableColumn(field=x, title=x) for x in source.column_names])
my_figure = figure(x_range=source.data[‘x’])
my_figure.vbar(x=‘x’,
top=‘y’,
width=0.9,
source=source)
l = layout([my_table, my_figure])
curdoc().add_root(l)`