Community input required - should we change the default output mode from `inline` to `cdn`

Hi all,
We need thoughts/opinions on the following proposal:
Change the default output mode on output_file and output_notebook to be CDN.
Current stateYou may be doing the following:

from bokeh.io import output_notebook, show
output_notebook()

Make a plot p

show(p)

or

from bokeh.io import output_file, show
output_file(‘myplot.html’)

Make a plot p

show(p)

When you do this, the asset you’re creating - either the notebook, or the html file has all the of bokeh css and javascript inlined into it.

Using this default, the minimum size of the html/ipynb created is ~1.6M

The pro:

  • Your document will work completely standalone
  • Your document has the exact js & css that you used to make it

The con:

  • Your document is large

By contrast when using CDN, the minimum size is ~20k.

This minimum size then grows, with your data and plot definitions.

If you want to see this issue in action, I’ve created some notebooks you can test it out in: http://nbviewer.ipython.org/github/birdsarah/bokeh-miscellany/tree/master/tests/resources/

We’d love to get your thoughts on this issue.

There maybe other options e.g. make it clearer that there’s a CDN option.

Either by replying on the list here or the issue is open on github: output_notebook resources · Issue #2572 · bokeh/bokeh · GitHub

Sincerely,

Sarah Bird

Hey,
I don’t have a strong opinion on which should be the default value, changing the default is fine by me. I do like to emphasize that having an ‘offline mode’ is very useful, especially while traveling/commuting. But also for occasions when you are visiting someone where you can connect to a projector (for presentation) but aren’t allowed to plugin to the network. I do a lot of work in the IPython Notebook without having an internet connection.

Try for example creating a new Conda environment without an internet connection, even if you have all packages cached and/or in a local/offline repo, it still fails because it cant connect to the internet. Things like this make you appreciate when things work offline as well.

Besides both current options it could also be considered to place the js/css in the same folder as the notebook/html and using a relative link. This could reduce redundancy when having a lot of notebooks in the same folder, while still maintaining offline capability and remaining fairly portable (also a big plus for me).

Regards,
Rutger

···

On Friday, July 17, 2015 at 6:07:01 PM UTC+2, Sarah Bird wrote:

Hi all,
We need thoughts/opinions on the following proposal:
Change the default output mode on output_file and output_notebook to be CDN.
Current stateYou may be doing the following:

from bokeh.io import output_notebook, show
output_notebook()

Make a plot p

show(p)

or

from bokeh.io import output_file, show
output_file(‘myplot.html’)

Make a plot p

show(p)

When you do this, the asset you’re creating - either the notebook, or the html file has all the of bokeh css and javascript inlined into it.

Using this default, the minimum size of the html/ipynb created is ~1.6M

The pro:

  • Your document will work completely standalone
  • Your document has the exact js & css that you used to make it

The con:

  • Your document is large

By contrast when using CDN, the minimum size is ~20k.

This minimum size then grows, with your data and plot definitions.

If you want to see this issue in action, I’ve created some notebooks you can test it out in: http://nbviewer.ipython.org/github/birdsarah/bokeh-miscellany/tree/master/tests/resources/

We’d love to get your thoughts on this issue.

There maybe other options e.g. make it clearer that there’s a CDN option.

Either by replying on the list here or the issue is open on github: https://github.com/bokeh/bokeh/issues/2572

Sincerely,

Sarah Bird

Rutger,

Thanks for the feedback (comments inline)

I don't have a strong opinion on which should be the default value, changing the default is fine by me. I do like to emphasize that having an 'offline mode' is very useful, especially while traveling/commuting. But also for occasions when you are visiting someone where you can connect to a projector (for presentation) but aren't allowed to plugin to the network. I do a lot of work in the IPython Notebook without having an internet connection.

Right this was the main impetus for having INLINE be the default, and if we change the default to CDN it will still be possible (and easy) to use inline resources for offline usage.

Try for example creating a new Conda environment without an internet connection, even if you have all packages cached and/or in a local/offline repo, it still fails because it cant connect to the internet. Things like this make you appreciate when things work offline as well.

Conda really should work offline in the scenario you described. It's possible there is a regression bug, we've raised your comment with the Conda team.

Besides both current options it could also be considered to place the js/css in the same folder as the notebook/html and using a relative link. This could reduce redundancy when having a lot of notebooks in the same folder, while still maintaining offline capability and remaining fairly portable (also a big plus for me).

This should currently be possible with "relative" resources:

  http://bokeh.pydata.org/en/latest/docs/reference/resources_embedding.html#bokeh.resources.Resources

Thanks again for the feedback,

Bryan

Bryan,

Thanks for the tips, i didn’t know the ‘relative sources’ existed already, that’s great. I’ll try to figure out a repeatable case of what i’m experiencing with Conda, and file an issue once i do.

Regards,
Rutger

···

On Monday, July 20, 2015 at 3:23:32 PM UTC+2, Bryan Van de ven wrote:

Rutger,

Thanks for the feedback (comments inline)

I don’t have a strong opinion on which should be the default value, changing the default is fine by me. I do like to emphasize that having an ‘offline mode’ is very useful, especially while traveling/commuting. But also for occasions when you are visiting someone where you can connect to a projector (for presentation) but aren’t allowed to plugin to the network. I do a lot of work in the IPython Notebook without having an internet connection.

Right this was the main impetus for having INLINE be the default, and if we change the default to CDN it will still be possible (and easy) to use inline resources for offline usage.

Try for example creating a new Conda environment without an internet connection, even if you have all packages cached and/or in a local/offline repo, it still fails because it cant connect to the internet. Things like this make you appreciate when things work offline as well.

Conda really should work offline in the scenario you described. It’s possible there is a regression bug, we’ve raised your comment with the Conda team.

Besides both current options it could also be considered to place the js/css in the same folder as the notebook/html and using a relative link. This could reduce redundancy when having a lot of notebooks in the same folder, while still maintaining offline capability and remaining fairly portable (also a big plus for me).

This should currently be possible with “relative” resources:

    [http://bokeh.pydata.org/en/latest/docs/reference/resources_embedding.html#bokeh.resources.Resources](http://bokeh.pydata.org/en/latest/docs/reference/resources_embedding.html#bokeh.resources.Resources)

Thanks again for the feedback,

Bryan