Can Selection Tool use an index defined in the dataset?


I have a plot that uses the Lasso Tool.

I have the following code

column_datasource.selected.on_change(“indices”, do_something)

so that I can work on the selected nodes in my plot based on indices of the Selection with the handler do_something

I was wondering if we could set the indices to an id column defined in the column_datasource. Right now, I’m wondering how the indices are generated by the column_datasource.

Thank you in advance!

Hi @Justin.Rouauld,

This is not possible. The index for selections is always the basic positional index in to the list / array / Series that makes the column. And often times, it is also completely implicit (there need not be an actual column that has just the indices).

1 Like