When a CDS is updated inside a CustomJS call, one has to run a source.emit.change() for the plot to be updated. That works for me. But in addition to updating the values of the line, I would like to also update its color. I have managed to both capture the current color of the line, and the new color based on a Tap event that I capture and that leads to the CustomJS call, yet, I must be missing something similar to the change() call, as even though I change the line_color property, the color on the browser does not change. Here is a bit of code that I hope helps clarify my question:
from bokeh.models import Line, ColumnDataSource, CustomJS
from bokeh.plotting import figure
# This is the line whose color I would like to change
x = np.arange(100)
y = np.random.rand(100,)
CDS = ColumnDataSource(data=dict(x=x,y=y))
fig = figure(plot_width=1000,plot_height=100)
line = Line(x='x',y='y',line_color='#000000')
fig.add_glyph(CDS,line)
# This is a CustomJS call that has access to the line object above
# This is called after a tap event. the source contains the color for
# each element that could be tapped
CustomJS(args=dict(source=source, ts_line=ts_line_glyph), code="""
// Obtain Selected Component ID (what used tapped on)
// --------------------------------------------------
var data = source.data;
var selected = source.selected.indices;
// Obtain the new color
// --------------------
var colors = data['color']
var new_color = colors[selected]
// Update line color
// -----------------
var ts_line_color = ts_line.line_color;
""")


