Is it possible to perform downsampling of multiple Bokeh plots with DataShader and export as HTML?

Hello,

I am using Bokeh patches method to plot peak objects that are containing min. 300 data points. When there are more than 1000 objects in a single plot and 20 plots within a column of Bokeh Layout object (containing more than 10^6 data points), output HTML file is too large to be displayed in a web browser (more than 600MB). Is there some convenient way for downsampling this amount of data so it could be rendered in a web browser without losing data structure and interactive tools. I saw some examples that are using DataShader but I am not sure whether an InteractiveImage object could be saved as HTML and displayed in a browser. If so, could somebody provide me with more details or some documentation regarding this issue?

Cheers,

Nemanja

Hi,

Datashader does its work by running really python code. Since browsers cannot run python code, the short answer to the question is no. In order to have an interactive plot that relies on Datashader directly, there has to be a real, running python process somewhere. This might be a Jupyter Notebook kernel, or a Bokeh server. There is no way to make a pure static HTML+JS only page that uses DataShader interactively.

Thanks,

Bryan

···

On Oct 15, 2017, at 16:13, [email protected] wrote:

Hello,

I am using Bokeh patches method to plot peak objects that are containing min. 300 data points. When there are more than 1000 objects in a single plot and 20 plots within a column of Bokeh Layout object (containing more than 10^6 data points), output HTML file is too large to be displayed in a web browser (more than 600MB). Is there some convenient way for downsampling this amount of data so it could be rendered in a web browser without losing data structure and interactive tools. I saw some examples that are using DataShader but I am not sure whether an InteractiveImage object could be saved as HTML and displayed in a browser. If so, could somebody provide me with more details or some documentation regarding this issue?

Cheers,
Nemanja

--
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/050badf2-76fd-4c7f-bfdd-7000140853e8%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Thanks Bryan,

saved me a lot of time.

Cheers

···

On Monday, October 16, 2017 at 5:43:57 AM UTC+2, Bryan Van de ven wrote:

Hi,

Datashader does its work by running really python code. Since browsers cannot run python code, the short answer to the question is no. In order to have an interactive plot that relies on Datashader directly, there has to be a real, running python process somewhere. This might be a Jupyter Notebook kernel, or a Bokeh server. There is no way to make a pure static HTML+JS only page that uses DataShader interactively.

Thanks,

Bryan

On Oct 15, 2017, at 16:13, [email protected] wrote:

Hello,

I am using Bokeh patches method to plot peak objects that are containing min. 300 data points. When there are more than 1000 objects in a single plot and 20 plots within a column of Bokeh Layout object (containing more than 10^6 data points), output HTML file is too large to be displayed in a web browser (more than 600MB). Is there some convenient way for downsampling this amount of data so it could be rendered in a web browser without losing data structure and interactive tools. I saw some examples that are using DataShader but I am not sure whether an InteractiveImage object could be saved as HTML and displayed in a browser. If so, could somebody provide me with more details or some documentation regarding this issue?

Cheers,

Nemanja


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/050badf2-76fd-4c7f-bfdd-7000140853e8%40continuum.io.

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

You can save a Datashader-based Bokeh plot as HTML, but only a single static rendering of your data will be in the exported file. So you can interactively zoom on the results, but you’ll always see the same set of previously rendered pixels when you do. If what you want is to provide a small amount of zoomability, you can render the datashader data at a size somewhat larger than you can currently see, so that when you zoom you’ll reveal additional detail without having to store all of the data in the HTML. Or you can downsample the original data (e.g. to simplify the shape) before creating your plot. There is usually a way around it, but as Bryan suggests, the only practical way to have all your data available when it’s more than the browser can handle is usually to provide a running Python process to provide it to the browser on demand.

Jim

···

On Sunday, October 15, 2017 at 4:13:54 PM UTC-5, [email protected] wrote:

Hello,

I am using Bokeh patches method to plot peak objects that are containing min. 300 data points. When there are more than 1000 objects in a single plot and 20 plots within a column of Bokeh Layout object (containing more than 10^6 data points), output HTML file is too large to be displayed in a web browser (more than 600MB). Is there some convenient way for downsampling this amount of data so it could be rendered in a web browser without losing data structure and interactive tools. I saw some examples that are using DataShader but I am not sure whether an InteractiveImage object could be saved as HTML and displayed in a browser. If so, could somebody provide me with more details or some documentation regarding this issue?

Cheers,

Nemanja