I am building a dashboard visualization with bokeh 0.9.2 and a flask server.
Currently I am struggling with updating glyph style attributes from JS callback code.
Say I want to update a segment color or alpha from a JS callback of a slider widget.
* trigger should not be needed when setting a Backbone property, that will generate a change event on its own. trigger is only needed when "reaching in" to a data source column and changing values in place without a call to .set
* As a workaround, you could put the alpha as a column in the data source, and change that. If you have a large number of segments, that's probably not ideal, but should definitely work until the plumbing is fixed.
I am building a dashboard visualization with bokeh 0.9.2 and a flask server.
Currently I am struggling with updating glyph style attributes from JS callback code.
Say I want to update a segment color or alpha from a JS callback of a slider widget.
Also I would like to give a try to the workaround you propose. As I am using AjaxDataSource, how could I avoid to have to push back to the flask server the new value of the alpha?
Unsure if this is clear
Rephrasing: say my AjaxDataSource contains columns x, y and now an empty one named alpha. I would prefer some way that the datasource keeps an empty alpha column that gets overriden locally by some code running in the browser. Is this possible ?
···
Le mercredi 5 août 2015 14:21:15 UTC+2, Bryan Van de ven a écrit :
A few notes:
trigger should not be needed when setting a Backbone property, that will generate a change event on its own. trigger is only needed when “reaching in” to a data source column and changing values in place without a call to .set
As a workaround, you could put the alpha as a column in the data source, and change that. If you have a large number of segments, that’s probably not ideal, but should definitely work until the plumbing is fixed.
I’m trying to answer my own question by using the data attribute of RemoteSource, but it seems it has no effect.
The doc says “Additional data to include directly in this data source object. The
columns provided here are merged with those from the Bokeh server.”
But I can’t see them.
···
Le mercredi 5 août 2015 15:39:11 UTC+2, Miguel Dardenne a écrit :
Also I would like to give a try to the workaround you propose. As I am using AjaxDataSource, how could I avoid to have to push back to the flask server the new value of the alpha?
Unsure if this is clear
Rephrasing: say my AjaxDataSource contains columns x, y and now an empty one named alpha. I would prefer some way that the datasource keeps an empty alpha column that gets overriden locally by some code running in the browser. Is this possible ?