How do I pass my nested data into ColumnDataSource?

I have 9 variables. Each of these variables has 100 trials, which each have 500 data points. For each variable, I’d like to add one line (containing all 500 data points) for each trial onto a plot. I’d then like to put all 9 plots on the same page so that when I select a trial on one plot, all trial number is selected on all other plots.

I’ve been losing my mind trying to make this happen, but no matter what I try, it seems that the only way to ensure shared selection across the plots is to use ColumnDataSource, and I can’t fit my data into ColumnDataSource because I need to be able to iterate over each trial and generate a line.

By and large Bokeh glyphs always and only expect flat, tabular data. There are very few glyphs that expect different. However, one of the exceptiones is multi_line for which the columns can contain nested lists, one for each sub-line.

Multi_line did the trick – thank you!

1 Like