@Kyle_Marcroft ColumnDataSource
objects do not have a "value"
property so I would expect that to do nothing at best, though failing in some way would not surprise me, either. I was perhaps assuming too much context with the terminology. In Bokeh, properties are very nearly exactly what is listed in the Reference Guide for bokeh.models
, e.g. for DataRange1d
you can see lots of properties:
Anything listed there could be used with .js_on_change
, e.g.
range.js_on_change('end', ...) # respond when range.end changes
You can respond to any changes in any property on any Bokeh model in this same way, i.e. anything that is listed as a property in the reference guide is fair game.
Conversely, if something is not listed as a property on a Bokeh model class (or a parent class), then it is not something that will have any relevance with .js_on_change
. As I mentioned above, ColumnDataSource
does not have any property named "value"
, so that is definitely not expected to do anything useful.
It’s not really clear to me what you are trying to accomplish so unfortunately I can’t really offer any more specific guidance. I’ll mention that .data
is probably the most common CDS property one might care about, but I should reiterate, due to inherent limitations, Bokeh an only detect when .data
changes in entirety, i.e. when it is assigned to:
source.js_on_change('data', ...) # respond when source.data = new_data
There is no good way to pick up changes inside .data
. That said, usually callbacks are setting CDS data, not waiting to respond to changes in it. Again it’s unclear what you are tryin to do. Alternatively maybe you want to respond to selections? Selections are stored on a Selection
model that itself is a property on a CDS. So that would be something like:
source.selection.js_on_change('indices', ...) # respond when a selection is updated