On Jan 12, 2017, at 4:29 PM, dekrion@gmail.com wrote:
I think that you should use a list with variable instead of a variable: [new_x_field] instead of new_x_field
I learned that it is always better to update all field at once with "stream". Could you try this?
from bokeh.models import ColumnDataSource
from bokeh.plotting import *
data_source_dictionary = dict(x = , y = )
data_source = ColumnDataSource(data_source_dictionary)
fig = Figure()
renderer = fig.circle( x = 'x', y = 'y', source = data_source)
new_source_data = dict(x = [new_x], y = [new_y])
data_source.stream(new_source_data)
Alternative way is that you update the data separately but it is not recommended:
renderer.data_source.data['x'] = [new_x]
renderer.data_source.data['y'] = [new_y]
On Thursday, January 12, 2017 at 11:01:42 AM UTC+1, ionu...@gmail.com wrote:
Hello,
After trying multiple options I decided to ask for experts help in the following issue:
In my project I have a scatter plot (Figure.circle) that is connected to a ColumnDataSource and two of its fields.
In my bokeh server applicationI must change based on a widgets.Select the two columns that the circle glyph is plotting.
Initially I create the GlyphRenderer with:
renderer = fig.circle( x_field, y_field, source)
This works fine and initial plot is showed.
However when I must change the "axis" I use the Select and within on_change of Select if do:
renderer.glyph.x = new_x_field
renderer.glyph.y = new_y_field
Certainly the ColumnDataSource has all required fields/data however nothing changes visually when above code is run.
I kindly as for your help,
Thank you in advance!
--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c9addd7d-e83e-4e63-b441-9f29d648f39d%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.