Save data together with `.ipynb` file when using `output_notebook` and `show`

Hi there

I’m using bokeh from Jupyter Lab using output_notebook (following Using with Jupyter — Bokeh 2.4.2 Documentation). We push our notebooks to GitHub which renders them for us so we can look at them as if they were web pages. This works very well for matplotlib plots. However, bokeh plots are not rendered and all we see is something like Loading BokehJS. My guess is this is because the data on which the plots are based are not saved to the .ipynb file and therefore a Bokeh server needs to be running which is obviously not the case on GitHub.

My question, therefore, is if there’s a way to embed the data in the .ipynb file or more generally if we can have “pre-rendering” on GitHub and the interactivity of Bokeh plots (i.e. not have to resort to matplotlib plots).


No there is not and it is out of our control. GitHub scrubs all JavaScript from it’s rendered notebook previews. It will never be possible to view Bokeh content directly on GitHub as long as this is their policy. You might look at using Binder, which launches live notebooks from GitHub repos.

Ah, I see, that makes sense, thanks!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.