[bokeh] Interactive Bokeh: how to show only last points without squeezing the whole data set?

Hi,

You can try setting the .follow and .follow_interval on a DataRange1d:

  http://bokeh.pydata.org/en/latest/docs/reference/models/ranges.html#bokeh.models.ranges.DataRange1d.follow

This is similar to what you ask, it will allow you to control over the width of the x-range in data space, e.g. But there is nothing currently built into Bokeh that allows you to control by specifying "last N points". For that you would have to write some kind of custom extension.

However, be advised that streaming data into the browser indefinitely is effectively an intentional memory leak -- do it for long enough or at a high enough rate and the browser will eventually become very unhappy. It's for this reason that the .stream method on column data sources accept a "rollover" limit to automatically truncate data source columns. Of course, you could handle periodically truncating your data source columns manually somehow too.

As an aside, there has been interest in developing the "dataframe" qualities of CDS on the JS side, so things like slices could be used to inform glyph renderers. It's just obviously not a trivial task, and no one has been available to work on it yet.

Thanks,

Bryan

···

On Jan 6, 2017, at 6:11 AM, [email protected] wrote:

With a periodic callback I update an interactive plot.
The whole graph squeezes to accomodate all the data.

How is it possibile to visualize the last, say, 10000 points without removing the old ones from data_source?
It is just a visualization property that I cannot find anywhere and I am (almost) sure it is hidden between the lines...

--
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/78f9a665-3c06-448a-906e-16b9c2b19eb8%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thank you Brian, I will try this.
I am not enough into Bokeh to understand where to search what I need.
Interesting indeed.

I deleted this post, strange you can read and answer it.
Could you please copy and paste your answer into the other post? Just for posterity :slight_smile: I can do it myself but I like that there is your name there.
I prefer the other one as there is some working code to work with.

Have a nice day
Alex

···

Il giorno venerdì 6 gennaio 2017 20:23:56 UTC+1, Bryan Van de ven ha scritto:

Hi,

You can try setting the .follow and .follow_interval on a DataRange1d:

    [http://bokeh.pydata.org/en/latest/docs/reference/models/ranges.html#bokeh.models.ranges.DataRange1d.follow](http://bokeh.pydata.org/en/latest/docs/reference/models/ranges.html#bokeh.models.ranges.DataRange1d.follow)

This is similar to what you ask, it will allow you to control over the width of the x-range in data space, e.g. But there is nothing currently built into Bokeh that allows you to control by specifying “last N points”. For that you would have to write some kind of custom extension.

However, be advised that streaming data into the browser indefinitely is effectively an intentional memory leak – do it for long enough or at a high enough rate and the browser will eventually become very unhappy. It’s for this reason that the .stream method on column data sources accept a “rollover” limit to automatically truncate data source columns. Of course, you could handle periodically truncating your data source columns manually somehow too.

As an aside, there has been interest in developing the “dataframe” qualities of CDS on the JS side, so things like slices could be used to inform glyph renderers. It’s just obviously not a trivial task, and no one has been available to work on it yet.

Thanks,

Bryan

ut.

Hi Alex,

I already deleted the other message from my local mail client, so I'd have to go search for it in the web UI, and I am just swamped with work to get the release out. Can you copy/paste the info into the other message? Would be appreciated, thanks,

Bryan

···

On Jan 6, 2017, at 2:00 PM, Alessandro Pocaterra <[email protected]> wrote:

Thank you Brian, I will try this.
I am not enough into Bokeh to understand where to search what I need.
Interesting indeed.

I deleted this post, strange you can read and answer it.
Could you please copy and paste your answer into the other post? Just for posterity :slight_smile: I can do it myself but I like that there is your name there.
I prefer the other one as there is some working code to work with.

Have a nice day
Alex

Il giorno venerdì 6 gennaio 2017 20:23:56 UTC+1, Bryan Van de ven ha scritto:
Hi,

You can try setting the .follow and .follow_interval on a DataRange1d:

        http://bokeh.pydata.org/en/latest/docs/reference/models/ranges.html#bokeh.models.ranges.DataRange1d.follow

This is similar to what you ask, it will allow you to control over the width of the x-range in data space, e.g. But there is nothing currently built into Bokeh that allows you to control by specifying "last N points". For that you would have to write some kind of custom extension.

However, be advised that streaming data into the browser indefinitely is effectively an intentional memory leak -- do it for long enough or at a high enough rate and the browser will eventually become very unhappy. It's for this reason that the .stream method on column data sources accept a "rollover" limit to automatically truncate data source columns. Of course, you could handle periodically truncating your data source columns manually somehow too.

As an aside, there has been interest in developing the "dataframe" qualities of CDS on the JS side, so things like slices could be used to inform glyph renderers. It's just obviously not a trivial task, and no one has been available to work on it yet.

Thanks,

Bryan
ut.

--
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/06e591d3-23c6-4ab6-9e77-7b1b1c73f00f%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.