Viewing Bokeh plots in online Jupyter Notebooks

Is it possible to have Bokeh render plots in Jupyter Notebooks without having to run them first?

For example, in this notebook on the Bokeh GitHub repo, you can’t see any of the plots, you have to run them first. I find this quite unfortunate, as often you don’t want people to download and run your notebook, you just want them to view it in a browser.

I suppose a workaround, if this is not possible, is to save the plot to a separate HTML file, upload it somewhere, and embed it directly into a markdown cell of the notebook.

— Ólavur Mortensen

Hi Ólavur,

In general, Bokeh works perfectly well in statically rendered Jupyter notebooks. You can see many example notebooks with inline Bokeh plots and widgets on nbviewer page for the bokeh-notebooks repo:

  Jupyter Notebook Viewer

However, Bokeh specifically does *not* render on GitHub, because GitHub strips out all JavaScript code from all notebooks that they render. Bokeh plots are created by the BokehJS JavaScript library, so stripping out JavaScript means that Bokeh cannot function, full stop. I think it is unfortunate that GitHub does this, however it is also wholly outside of our control.

Thanks,

Bryan

···

On Dec 22, 2016, at 7:06 AM, [email protected] wrote:

Is it possible to have Bokeh render plots in Jupyter Notebooks without having to run them first?

For example, in this notebook on the Bokeh GitHub repo, you can’t see any of the plots, you have to run them first. I find this quite unfortunate, as often you don’t want people to download and run your notebook, you just want them to view it in a browser.

I suppose a workaround, if this is not possible, is to save the plot to a separate HTML file, upload it somewhere, and embed it directly into a markdown cell of the notebook.

— Ólavur Mortensen

--
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/ef30a1ee-a334-422a-8423-b15c61dbe47c%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Ah, I see. Yes, that is very unfortunate. Thanks for the help.

···

On Thursday, December 22, 2016 at 2:25:49 PM UTC, Bryan Van de ven wrote:

Hi Ólavur,

In general, Bokeh works perfectly well in statically rendered Jupyter notebooks. You can see many example notebooks with inline Bokeh plots and widgets on nbviewer page for the bokeh-notebooks repo:

    [http://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/index.ipynb](http://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/index.ipynb)

However, Bokeh specifically does not render on GitHub, because GitHub strips out all JavaScript code from all notebooks that they render. Bokeh plots are created by the BokehJS JavaScript library, so stripping out JavaScript means that Bokeh cannot function, full stop. I think it is unfortunate that GitHub does this, however it is also wholly outside of our control.

Thanks,

Bryan

On Dec 22, 2016, at 7:06 AM, [email protected] wrote:

Is it possible to have Bokeh render plots in Jupyter Notebooks without having to run them first?

For example, in this notebook on the Bokeh GitHub repo, you can’t see any of the plots, you have to run them first. I find this quite unfortunate, as often you don’t want people to download and run your notebook, you just want them to view it in a browser.

I suppose a workaround, if this is not possible, is to save the plot to a separate HTML file, upload it somewhere, and embed it directly into a markdown cell of the notebook.

— Ólavur Mortensen


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/ef30a1ee-a334-422a-8423-b15c61dbe47c%40continuum.io.

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