I have a problem, and I did not find a soltion with Bokeh v 0.12.2, so I am asking this here:
I have a simple line graph:
p = figure(x_axis_type="datetime", plot_width=1000) #, responsive = True)
p.line(df.date, df.close, name = 'Line')
renderer = p.select(dict(name="Line"))
self.ds = renderer[0].data_source
show(p)
``
I am displaying that via bokeh server in a browser, and whenever a new data point is added to the line, I would like to add it to the already open display in the browser:
df = self.graphDataFrame.tail(250) ## only the last
self.ds.data['x'] = df.date
self.ds.data['y'] = df.close
self.ds._dirty = True
session = pull_session(curdoc())
session.store_objects(self.ds)
``
But it is not working, the screen does not change. Can you help me - what am I doing wrong?
To post to this group, send email to [email protected].
To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/87ab80f2-8630-4d8b-a8b6-f1ec52b0185e%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/87ab80f2-8630-4d8b-a8b6-f1ec52b0185e%40continuum.io?utm_medium=email&utm_source=footer).
For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).
Hi Sarah,
thank you very much for your mail. It is working and looks great, but it runs as an app to be started with bokeh --serve.
However, I have quite a big python code (involving TensorFlow and such) and I would rather have the bokeh code in a few functions I can call whenever something is happening in TensorFlow. So I do not want to run the whole stuff as Bokeh server app, but control the Bokeh parts from inside my python code.
Is this possible with the example you sent me?
Thanks and kind regards
Ernst
···
On Sunday, October 9, 2016 at 9:16:28 AM UTC+2, Sarah Bird wrote:
Seems like you’re going about that in a very complicated way.
To post to this group, send email to [email protected].
To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/87ab80f2-8630-4d8b-a8b6-f1ec52b0185e%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/87ab80f2-8630-4d8b-a8b6-f1ec52b0185e%40continuum.io?utm_medium=email&utm_source=footer).
For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).
The only simple way to update the front end from python code is:
use bokeh server
use p ush_notebook
in the notebook environment
I can't immediately think
of any way of achiev ing
what you want to.
···
On 10/9/16 11:24 PM, Ernst wrote:
Hi Sarah,
thank you very much for your mail. It is working and looks
great, but it runs as an app to be started with bokeh --serve.
However, I have quite a big python code (involving TensorFlow
and such) and I would rather have the bokeh code in a few
functions I can call whenever something is happening in
TensorFlow. So I do not want to run the whole stuff as Bokeh
server app, but control the Bokeh parts from inside my python
code.
Is this possible with the example you sent me?
Thanks and kind regards
Ernst
On Sunday, October 9, 2016 at 9:16:28 AM UTC+2, Sarah Bird
wrote:
Seems like you're going about that in a very complicated
way.
Why not use source.stream or source.patch?
There's an example of source.stream here: [https://github.com/bokeh/bokeh/blob/master/examples/app/ohlc/main.py](https://github.com/bokeh/bokeh/blob/master/examples/app/ohlc/main.py)
On 10/7/16 7:27 AM, Ernst wrote:
Hi,
I have a problem, and I did not find a soltion with
Bokeh v 0.12.2, so I am asking this here:
I have a simple line graph:
p = figure(x_axis_type="datetime", plot_width=1000) #, responsive = True)
p.line(df.date, df.close, name = 'Line')
renderer = p.select(dict(name="Line"))
self.ds = renderer[0].data_source
show(p)
``
I am displaying that via bokeh server in a browser, and
whenever a new data point is added to the line, I would
like to add it to the already open display in the
browser:
df = self.graphDataFrame.tail(250) ## only the last
self.ds.data['x'] = df.date
self.ds.data['y'] = df.close
self.ds._dirty = True
session = pull_session(curdoc())
session.store_objects(self.ds)
``
But it is not working, the screen does not change. Can
you help me - what am I doing wrong?
Thanks,
Ernst
–
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
To post to this group, send email to [email protected].
To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/87ab80f2-8630-4d8b-a8b6-f1ec52b0185e%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/87ab80f2-8630-4d8b-a8b6-f1ec52b0185e%40continuum.io?utm_medium=email&utm_source=footer).
For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).
To post to this group, send email to [email protected].
To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/6047c9d1-673c-4fd2-aef6-1873241f6285%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/6047c9d1-673c-4fd2-aef6-1873241f6285%40continuum.io?utm_medium=email&utm_source=footer).
For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).