live data source types

Hello,
I would like to know if it is possible to update a chart using an url as the data source that could provide live values?
Could that url be used either as:

  • a long-polling http calls?
  • or recurrent polls using a “Last-Modified” header from previous requests?
  • or an http push using websocket or SSE?

thanks,
Mat

Hi Mat,

Can you provide a few more details about your use case? There are a few ways to achieve what you describe (as far as I understand right your need) but it depends on your use case, the data format, etc… All solutions I can think of require some effort to write code that matches specific use cases.

That said… we are working on a very high level command line tool that can do something similar to what you describe. With that you can specify an input (local file or a csv file that can retrieved from a specific url) and tell the tool to monitor the file and append new records as soon as they arrive updating the chart stored on bokeh-server. You can see a bit of the discussions on the related github issue and take a look at the PR for the CLI Tool. Please notice that this is very experimental and is limited to the bokeh.charts interface but seems to go in the direction of your use case.

As I said before, It’d be great if you could provide more details about your use case and [in case you have] some code.

Thank you

Fabio

···

On Tuesday, January 6, 2015 7:10:12 AM UTC+1, [email protected] wrote:

Hello,
I would like to know if it is possible to update a chart using an url as the data source that could provide live values?
Could that url be used either as:

  • a long-polling http calls?
  • or recurrent polls using a “Last-Modified” header from previous requests?
  • or an http push using websocket or SSE?

thanks,
Mat

It’s amazing how the timing on these works out. We are discussing a “JSON” or “AJAX” data source for just this. It is a high priority but does not exist yet. But, you can still do things “by hand” with a little JS. Checkout the spectrogram demo under examples/embed.

Thanks,

Bryan

···

On Jan 6, 2015, at 00:10, [email protected] wrote:

Hello,
I would like to know if it is possible to update a chart using an url as the data source that could provide live values?
Could that url be used either as:

  • a long-polling http calls?
  • or recurrent polls using a “Last-Modified” header from previous requests?
  • or an http push using websocket or SSE?

thanks,
Mat

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 [email protected].

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/5111983a-acd1-48fd-95e2-b7898db9702d%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thanks Fabio and Bryan for your responses!

Fabio:

I am planning on using bokeh behind a web server and rendering the script in web pages. The data is served by an api in front of a timeseries db. So I could control the way to deliver the data and its format…

Basically, I would want to tell the plots to get live data from a provided url without messing to much with js, rather fixing the backend.

Bryan:

I don’t really want to fork out a process on the web server to push data unless using websockets. I would prefer let the plot pull data from the backend at a provided rate.

Thanks,

Mat

···

On Tuesday, January 6, 2015 7:23:56 AM UTC-5, Bryan Van de ven wrote:

It’s amazing how the timing on these works out. We are discussing a “JSON” or “AJAX” data source for just this. It is a high priority but does not exist yet. But, you can still do things “by hand” with a little JS. Checkout the spectrogram demo under examples/embed.

Thanks,

Bryan

On Jan 6, 2015, at 00:10, [email protected] wrote:

Hello,
I would like to know if it is possible to update a chart using an url as the data source that could provide live values?
Could that url be used either as:

  • a long-polling http calls?
  • or recurrent polls using a “Last-Modified” header from previous requests?
  • or an http push using websocket or SSE?

thanks,
Mat

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 [email protected].

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/5111983a-acd1-48fd-95e2-b7898db9702d%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi Mat,

Yah sorry I was on my phone earlier, so I was a bit briefer that I would be normally. The part of the spectrogram demo that I was referring to was not the server supplying data part. Rather, it was the fact that you an add a little bit of JS to a Bokeh plot (created in python) that pulls data (in the client) via an AJAX call, and then updates the plot (in the client, for JS). The spectrogram happens to have it's own server that serves the audio data through REST endpoints, but in principal you could hit any public API for data to update your plots.

Bryan

···

On Jan 6, 2015, at 9:27 AM, [email protected] wrote:

Thanks Fabio and Bryan for your responses!

Fabio:
I am planning on using bokeh behind a web server and rendering the script in web pages. The data is served by an api in front of a timeseries db. So I could control the way to deliver the data and its format...
Basically, I would want to tell the plots to get live data from a provided url without messing to much with js, rather fixing the backend.

Bryan:
I don't really want to fork out a process on the web server to push data unless using websockets. I would prefer let the plot pull data from the backend at a provided rate.

Thanks,
Mat

On Tuesday, January 6, 2015 7:23:56 AM UTC-5, Bryan Van de ven wrote:
It's amazing how the timing on these works out. We are discussing a "JSON" or "AJAX" data source for just this. It is a high priority but does not exist yet. But, you can still do things "by hand" with a little JS. Checkout the spectrogram demo under examples/embed.

Thanks,

Bryan

On Jan 6, 2015, at 00:10, matdr...@gmail.com wrote:

Hello,
I would like to know if it is possible to update a chart using an url as the data source that could provide live values?
Could that url be used either as:
- a long-polling http calls?
- or recurrent polls using a "Last-Modified" header from previous requests?
- or an http push using websocket or SSE?

thanks,
Mat

--
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+un...@continuum.io.
To post to this group, send email to bo...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/5111983a-acd1-48fd-95e2-b7898db9702d%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
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 [email protected].
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/e9405073-cb66-480b-823c-ac4efa5e052e%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hello Bryan and thanks for the response.

It appears that must of the functionality is in the coffescript file where pulling the data from an api is pretty simple. On the other hand, the way to push new data points into the charts is not obvious, and how to shift the view (in the case of a time series chart) seems harsh to understand unless you dig into bokehjs script.

I've seen another question lately that is suggesting to expose a simpler js api and I think it would be great too. :wink:

Thanks,
Mat

Hi Mat,

Providing a first-class interface to BokehJS is a priority for us, we hope to have something in place for 0.8 in February. You can follow the GH issue here:

  https://github.com/bokeh/bokeh/issues/1515

Any input, suggestions, or contributions from experienced JS devs would be extremely welcome (for reference, I was completely new to JS and web dev before Bokeh, I would very much welcome some experienced voices weighing in).

Bryan

···

On Jan 11, 2015, at 9:17 AM, [email protected] wrote:

Hello Bryan and thanks for the response.

It appears that must of the functionality is in the coffescript file where pulling the data from an api is pretty simple. On the other hand, the way to push new data points into the charts is not obvious, and how to shift the view (in the case of a time series chart) seems harsh to understand unless you dig into bokehjs script.

I've seen another question lately that is suggesting to expose a simpler js api and I think it would be great too. :wink:

Thanks,
Mat

--
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 [email protected].
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/fea29de3-4878-4e82-b855-7c687bebde74%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.