Hi Jim,
I don’t have any help for you unfortunately, but I’m interested in the problem. I looked at the notebook you provided. Does that method of setting the selected
property of the datasource work for other chart types? If so, maybe the events aren’t propagating in data_table.coffee they way they do in other objects?
For others, here’s the code from the notebook Jim attached:
import bokeh
from bokeh.plotting import figure, output_notebook, show
from bokeh.models import DataTable, ColumnDataSource, TableColumn
from bokeh.io import push_notebook
import pandas as pd
print(‘bokeh version: %s’ % bokeh.version)
output_notebook()
df = pd.DataFrame( {‘AAA’ : [4,5,6,7], ‘BBB’ : [10,20,30,40],‘CCC’ : [100,50,-30,-50]})
data = df.to_dict(orient=‘list’)
tableSource = ColumnDataSource(df)
columns = [TableColumn(field=“AAA”, title=“AAA”),
TableColumn(field=“BBB”, title=“BBB”),
TableColumn(field=“CCC”, title=“CCC”)]
bokehTable = DataTable(columns=columns, source=tableSource,
editable=False, fit_columns=True, height=300,
row_headers=True, selectable=True, sortable=True)
tableSource.selected = {‘1d’:{‘True’:(0,1)}}
show(bokehTable)
I looked through the examples for anything similar to this but didn’t find anything. Maybe others will have ideas.
cheers,
Dennis
···
On Wed, Feb 17, 2016 at 6:27 AM Schaun Wheeler [email protected] wrote:
Does anyone have any ideas on this? I have a very similar need.
On Friday, February 12, 2016 at 1:12:17 PM UTC-5, Jim Sharpe wrote:
I’m trying to figure out how to select various rows in a Table programmatically. The attached notebook is a small example that I thought might work based on the documentation for the selected attr for a DataSource but unfortunately it doesn’t. (I tried both 0d and 1d thinking that might be the problem but neither seemed to do anything, and since I wanted entire rows selected it didn’t seem like 2d would apply).
I’ve looked everywhere I can think of for an example of how to do this or additional documentation but have come up short. Could someone please describe the correct way to specify which rows in a table should be selected?
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/58f8228d-7b91-4edd-b39a-4692bbb127fe%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.