Best way to go through the examples folder

Hi,

I am trying to run some of the examples in the Boke repository with the latest build dev. I see several files folders in the examples folder. What is the best way to go through the examples? The README.md file has the text shown below, but I see many more folders under the examples folder, and it’s unclear which one is which. Also, are the examples in the gallery included in the examples folder as well?

This directory contains example using the high level plotting interface, and is the interface most users should want to start with. There are three subdirectories illustrating output in three different modes:

file - output static HTML file
notebook - output inline in IPython notebooks
server - out put using the Bokeh server

Note that the server examples require the Bokeh server to be running (execute ‘bokeh-server’)

Thanks,

Josh

I think I got it. It looks like:

  • plotting includes the high-level plotting interface (except for charts)

  • glyphs: includes the low-level plotting interface

  • charts: charts interface (histogram)

  • compat includes examples illustrating ggplot and seaborn (compatibility with other packages)

  • apps: include widget examples

  • embed: Includes the spectrogram example that Peter and Bryan have demoed in their talks (e.g. in Pydata & NYC Nov. 2014).

but why is embed separate from apps? IIRC Brian said that the spectrogram required some ajax / javascript to make it work. Is that why?

Thanks,

Josh

···

On Mon, Dec 15, 2014 at 8:48 AM, Josh Wasserstein [email protected] wrote:

Hi,

I am trying to run some of the examples in the Boke repository with the latest build dev. I see several files folders in the examples folder. What is the best way to go through the examples? The README.md file has the text shown below, but I see many more folders under the examples folder, and it’s unclear which one is which. Also, are the examples in the gallery included in the examples folder as well?

This directory contains example using the high level plotting interface, and is the interface most users should want to start with. There are three subdirectories illustrating output in three different modes:

file - output static HTML file
notebook - output inline in IPython notebooks
server - out put using the Bokeh server

Note that the server examples require the Bokeh server to be running (execute ‘bokeh-server’)

Thanks,

Josh

Hi Josh,

···

On Mon, Dec 15, 2014 at 11:16 AM, Josh Wasserstein [email protected] wrote:

I think I got it. It looks like:

  • plotting includes the high-level plotting interface (except for charts)
  • glyphs: includes the low-level plotting interface
  • charts: charts interface (histogram)
  • compat includes examples illustrating ggplot and seaborn (compatibility with other packages)
  • apps: include widget examples
  • embed: Includes the spectrogram example that Peter and Bryan have demoed in their talks (e.g. in Pydata & NYC Nov. 2014).

Yes, you got it… would you care to update the README in a PR? or make an issue so we can properly update it later. Thanks

but why is embed separate from apps? IIRC Brian said that the spectrogram required some ajax / javascript to make it work. Is that why?

I would say it is in the embed folder because you are actually embedding the plot object into the Flask app specifically using the bokeh.embed API

https://github.com/bokeh/bokeh/blob/master/examples/embed/spectrogram/spectrogram.py#L49

Thanks,

Josh

Cheers.

Damian

Hi Josh,

We can probably do a better job of describing all these examples (and I may just lift your great descriptions into our docs, if that's ok!)

Regarding app vs embed. The "apps" are all run *inside* the bokeh-server. So you start them, by doing something like:

  bokeh-server --script sliders_app.py

The main reason for this is because, otherwise, to make an "app" outside the server, the only real solutions is to have a long-running process that polls the server for updates. This is not ideal, and apps running directly in the server can utilize much better callbacks. Please note that the "app" concept is still fairly new, and things like how to start, easily spell, and deploy apps is very much open to improvement.

The "embed" examples simply show off how to embed a Bokeh plot in a standard web-app (i.e., you want to serve a plot from Flask that has a plot in it). This can be done with, or without the bokeh-server, but even if you use a bokeh-server, there is no code running *in the bokeh-server* that responds to widgets, or updates plots or data. To update plots you'd have to have a separate python process that connects to the bokeh-server and polls or pushes data to it.

I hope this makes things a bit clearer.

Thanks,

Bryan

···

On Dec 15, 2014, at 2:37 PM, Damian Avila <[email protected]> wrote:

Hi Josh,

On Mon, Dec 15, 2014 at 11:16 AM, Josh Wasserstein <[email protected]> wrote:
I think I got it. It looks like:

- plotting includes the high-level plotting interface (except for charts)
- glyphs: includes the low-level plotting interface
- charts: charts interface (histogram)
- compat includes examples illustrating ggplot and seaborn (compatibility with other packages)
- apps: include widget examples
- embed: Includes the spectrogram example that Peter and Bryan have demoed in their talks (e.g. in Pydata & NYC Nov. 2014).

Yes, you got it... would you care to update the README in a PR? or make an issue so we can properly update it later. Thanks

but why is embed separate from apps? IIRC Brian said that the spectrogram required some ajax / javascript to make it work. Is that why?

I would say it is in the embed folder because you are actually embedding the plot object into the Flask app specifically using the bokeh.embed API

https://github.com/bokeh/bokeh/blob/master/examples/embed/spectrogram/spectrogram.py#L49

Thanks,

Josh

Cheers.

Damian

--
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/CAM9Ly3FmOnVkeAEev0_GeYCam39Z702M7nGA7OXyCpO9eo4axQ%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

And this is the proper answer because it goes with the conceptual differences that I overlooked completely in my answer. Thanks Bryan!

···

On Mon, Dec 15, 2014 at 11:55 AM, Bryan Van de Ven [email protected] wrote:

Hi Josh,

We can probably do a better job of describing all these examples (and I may just lift your great descriptions into our docs, if that’s ok!)

Regarding app vs embed. The “apps” are all run inside the bokeh-server. So you start them, by doing something like:

    bokeh-server --script sliders_app.py

The main reason for this is because, otherwise, to make an “app” outside the server, the only real solutions is to have a long-running process that polls the server for updates. This is not ideal, and apps running directly in the server can utilize much better callbacks. Please note that the “app” concept is still fairly new, and things like how to start, easily spell, and deploy apps is very much open to improvement.

The “embed” examples simply show off how to embed a Bokeh plot in a standard web-app (i.e., you want to serve a plot from Flask that has a plot in it). This can be done with, or without the bokeh-server, but even if you use a bokeh-server, there is no code running in the bokeh-server that responds to widgets, or updates plots or data. To update plots you’d have to have a separate python process that connects to the bokeh-server and polls or pushes data to it.

I hope this makes things a bit clearer.

Thanks,

Bryan

On Dec 15, 2014, at 2:37 PM, Damian Avila [email protected] wrote:

Hi Josh,

On Mon, Dec 15, 2014 at 11:16 AM, Josh Wasserstein [email protected] wrote:

I think I got it. It looks like:

  • plotting includes the high-level plotting interface (except for charts)
  • glyphs: includes the low-level plotting interface
  • charts: charts interface (histogram)
  • compat includes examples illustrating ggplot and seaborn (compatibility with other packages)
  • apps: include widget examples
  • embed: Includes the spectrogram example that Peter and Bryan have demoed in their talks (e.g. in Pydata & NYC Nov. 2014).

Yes, you got it… would you care to update the README in a PR? or make an issue so we can properly update it later. Thanks

but why is embed separate from apps? IIRC Brian said that the spectrogram required some ajax / javascript to make it work. Is that why?

I would say it is in the embed folder because you are actually embedding the plot object into the Flask app specifically using the bokeh.embed API

https://github.com/bokeh/bokeh/blob/master/examples/embed/spectrogram/spectrogram.py#L49

Thanks,

Josh

Cheers.

Damian

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/CAM9Ly3FmOnVkeAEev0_GeYCam39Z702M7nGA7OXyCpO9eo4axQ%40mail.gmail.com.

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

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/75B295DB-168F-484B-BFD7-E5A1130C38D6%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thank you all. Everything is clear now :). I will send a PR to update this part of the documentation.

Josh

···

On Mon, Dec 15, 2014 at 10:04 AM, Damian Avila [email protected] wrote:

And this is the proper answer because it goes with the conceptual differences that I overlooked completely in my answer. Thanks Bryan!

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/CAM9Ly3HXP1fFF5G3nN_uK5iDws6xn9Lg%2B%2Bmgf22_dDw-XRD4Ag%40mail.gmail.com.

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

On Mon, Dec 15, 2014 at 11:55 AM, Bryan Van de Ven [email protected] wrote:

Hi Josh,

We can probably do a better job of describing all these examples (and I may just lift your great descriptions into our docs, if that’s ok!)

Regarding app vs embed. The “apps” are all run inside the bokeh-server. So you start them, by doing something like:

    bokeh-server --script sliders_app.py

The main reason for this is because, otherwise, to make an “app” outside the server, the only real solutions is to have a long-running process that polls the server for updates. This is not ideal, and apps running directly in the server can utilize much better callbacks. Please note that the “app” concept is still fairly new, and things like how to start, easily spell, and deploy apps is very much open to improvement.

The “embed” examples simply show off how to embed a Bokeh plot in a standard web-app (i.e., you want to serve a plot from Flask that has a plot in it). This can be done with, or without the bokeh-server, but even if you use a bokeh-server, there is no code running in the bokeh-server that responds to widgets, or updates plots or data. To update plots you’d have to have a separate python process that connects to the bokeh-server and polls or pushes data to it.

I hope this makes things a bit clearer.

Thanks,

Bryan

On Dec 15, 2014, at 2:37 PM, Damian Avila [email protected] wrote:

Hi Josh,

On Mon, Dec 15, 2014 at 11:16 AM, Josh Wasserstein [email protected] wrote:

I think I got it. It looks like:

  • plotting includes the high-level plotting interface (except for charts)
  • glyphs: includes the low-level plotting interface
  • charts: charts interface (histogram)
  • compat includes examples illustrating ggplot and seaborn (compatibility with other packages)
  • apps: include widget examples
  • embed: Includes the spectrogram example that Peter and Bryan have demoed in their talks (e.g. in Pydata & NYC Nov. 2014).

Yes, you got it… would you care to update the README in a PR? or make an issue so we can properly update it later. Thanks

but why is embed separate from apps? IIRC Brian said that the spectrogram required some ajax / javascript to make it work. Is that why?

I would say it is in the embed folder because you are actually embedding the plot object into the Flask app specifically using the bokeh.embed API

https://github.com/bokeh/bokeh/blob/master/examples/embed/spectrogram/spectrogram.py#L49

Thanks,

Josh

Cheers.

Damian

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/CAM9Ly3FmOnVkeAEev0_GeYCam39Z702M7nGA7OXyCpO9eo4axQ%40mail.gmail.com.

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

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/75B295DB-168F-484B-BFD7-E5A1130C38D6%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.