Updating a list via Callback for selection

Hello guys,

first let me say that I just discovered bokeh and it’s awesome, but I ran into some trouble, probably due to my lack of knowledge of javascript. So here’s my question.

Is it possible to update a list of indices via Callback for selection and use that list to iterate over rows of data and plot them?

Relevant piece of code (at the moment plotting only 1st, 3rd and 4th, row of the matrix):

indices = [1,3,4]
for i in indices:
    p.line(np.arange(0,11,1), '%s'%i ,  source=matrix)

Full question on StackOverflow: