Bokeh quick start example opening what seems to be a terminal browser

I am trying to run the bokeh-server example from the new quick start guide on a remote machine.

I conda installed the dev build from yesterday, and these are the steps I followed:

  1. On a terminal connected to the remote machine, I start bokeh-server --ip “0.0.0.0”. This shows the server running on 5006. So far so good, I go to the browser:

http:host.net:5006/

and I see “Bokeh Documents for defaultuser”)

  1. I then go to another terminal connected to the same remote machine and do:

python quick_start.py

the file quick_start.py includes the simple line plot example from the quick start guide:

from bokeh.plotting import figure, output_server, show
#prepare some data
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
# output to the server
**output_server("simple_line")**

# Plot a `line` renderer setting the color, line thickness, title, and legend value.
p = figure(title="simple line server example")
p.line(x, y, legend="Temp.", x_axis_label='x', y_axis_label='y')

show(p)
Then, something strange happens. While I can see the new "**simple_line**" plot on the list of "Bokeh Documents" on my browser (chrome), the second terminal that I used to run python quick_start.py, brings me to what seems to be a **terminal-based web browser** (screenshot below).

**My questions here are:**

1) How can I disable this behavior of bokeh opening the terminal browser?

2) Once I "send" several a few examples to the server, line the one above, how can I manage them later from the remote terminal? (e.g. stop, or restart my bokeh-server plots from the command line.

3) When I run an example against the server, like the simple_line above, Is there anyway to **generate** a **direct** URL that points directly to the plot, as opposed to having to go**http:[host.net:5006/](http://host.net:5006/)** and then the **"Bokeh documents"** list to access the plot "**simple_plot**"?

Thanks again for you help,

Josh

Hi Josh,

···

On Sat, Dec 13, 2014 at 8:52 PM, Josh Wasserstein [email protected] wrote:

I am trying to run the bokeh-server example from the new quick start guide on a remote machine.

I conda installed the dev build from yesterday, and these are the steps I followed:

  1. On a terminal connected to the remote machine, I start bokeh-server --ip “0.0.0.0”. This shows the server running on 5006. So far so good, I go to the browser:

http:host.net:5006/

and I see “Bokeh Documents for defaultuser”)

  1. I then go to another terminal connected to the same remote machine and do:

python quick_start.py

the file quick_start.py includes the simple line plot example from the quick start guide:

from bokeh.plotting import figure, output_server, show
#prepare some data
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
# output to the server
**output_server("simple_line")**

# Plot a `line` renderer setting the color, line thickness, title, and legend value.
p = figure(title="simple line server example")
p.line(x, y, legend="Temp.", x_axis_label='x', y_axis_label='y')

show(p)
Then, something strange happens. While I can see the new "**simple_line**" plot on the list of "Bokeh Documents" on my browser (chrome), the second terminal that I used to run python quick_start.py, brings me to what seems to be a **terminal-based web browser** (screenshot below).

No attachments… :slight_smile:


My questions here are:

  1. How can I disable this behavior of bokeh opening the terminal browser?

You can use push() instead of show(p)


  1. Once I “send” several a few examples to the server, line the one above, how can I manage them later from the remote terminal? (e.g. stop, or restart my bokeh-server plots from the command line.

Sorry, I’m not sure I understand. Can you provide more details?


  1. When I run an example against the server, like the simple_line above, Is there anyway to generate a direct URL that points directly to the plot, as opposed to having to gohttp:host.net:5006/ and then the “Bokeh documents” list to access the plot “simple_plot”?

You can find the url you need with:

cursession().object_link(curdoc().context)

that you can call before show(p) [or push()].

Fabio

Thank you Fabio. The notes you sent are very helpful. Below is the screenshot I mentioned earlier. I think show() is invoking a terminal-based browser since I am on a remote machine, so probably using push instead of show will avoid that.

Regarding your suggestions and getting the URL with **cursession().object_link(curdoc().context), **is there any way to specify a name for the URL?

Josh

···

On Sat, Dec 13, 2014 at 4:23 PM, Fabio Pliger [email protected] wrote:

Hi Josh,

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/CAPVmnqDXxS%3D6nmb6dseN54q-Q8MZM430vH-FNBVUb1FPbvhX3w%40mail.gmail.com.

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

On Sat, Dec 13, 2014 at 8:52 PM, Josh Wasserstein [email protected] wrote:

I am trying to run the bokeh-server example from the new quick start guide on a remote machine.

I conda installed the dev build from yesterday, and these are the steps I followed:

  1. On a terminal connected to the remote machine, I start bokeh-server --ip “0.0.0.0”. This shows the server running on 5006. So far so good, I go to the browser:

http:host.net:5006/

and I see “Bokeh Documents for defaultuser”)

  1. I then go to another terminal connected to the same remote machine and do:

python quick_start.py

the file quick_start.py includes the simple line plot example from the quick start guide:

from bokeh.plotting import figure, output_server, show
#prepare some data
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
# output to the server
**output_server("simple_line")**

# Plot a `line` renderer setting the color, line thickness, title, and legend value.
p = figure(title="simple line server example")
p.line(x, y, legend="Temp.", x_axis_label='x', y_axis_label='y')

show(p)
Then, something strange happens. While I can see the new "**simple_line**" plot on the list of "Bokeh Documents" on my browser (chrome), the second terminal that I used to run python quick_start.py, brings me to what seems to be a **terminal-based web browser** (screenshot below).

No attachments… :slight_smile:


My questions here are:

  1. How can I disable this behavior of bokeh opening the terminal browser?

You can use push() instead of show(p)


  1. Once I “send” several a few examples to the server, line the one above, how can I manage them later from the remote terminal? (e.g. stop, or restart my bokeh-server plots from the command line.

Sorry, I’m not sure I understand. Can you provide more details?


  1. When I run an example against the server, like the simple_line above, Is there anyway to generate a direct URL that points directly to the plot, as opposed to having to gohttp:host.net:5006/ and then the “Bokeh documents” list to access the plot “simple_plot”?

You can find the url you need with:

cursession().object_link(curdoc().context)

that you can call before show(p) [or push()].

Fabio

mmm… the terminal thing is interesting… but we don’t provide anything related with that, so probably it is something from your set up in the remote machine.

Cheers.

Damian

···

On Monday, December 15, 2014 2:47:57 PM UTC-3, Josh Wasserstein wrote:

Thank you Fabio. The notes you sent are very helpful. Below is the screenshot I mentioned earlier. I think show() is invoking a terminal-based browser since I am on a remote machine, so probably using push instead of show will avoid that.

Regarding your suggestions and getting the URL with **cursession().object_link(curdoc().context), **is there any way to specify a name for the URL?

Josh

On Sat, Dec 13, 2014 at 4:23 PM, Fabio Pliger [email protected] wrote:

Hi Josh,

On Sat, Dec 13, 2014 at 8:52 PM, Josh Wasserstein [email protected] wrote:

I am trying to run the bokeh-server example from the new quick start guide on a remote machine.

I conda installed the dev build from yesterday, and these are the steps I followed:

  1. On a terminal connected to the remote machine, I start bokeh-server --ip “0.0.0.0”. This shows the server running on 5006. So far so good, I go to the browser:

http:host.net:5006/

and I see “Bokeh Documents for defaultuser”)

  1. I then go to another terminal connected to the same remote machine and do:

python quick_start.py

the file quick_start.py includes the simple line plot example from the quick start guide:

from bokeh.plotting import figure, output_server, show
#prepare some data
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
# output to the server
**output_server("simple_line")**

# Plot a `line` renderer setting the color, line thickness, title, and legend value.
p = figure(title="simple line server example")
p.line(x, y, legend="Temp.", x_axis_label='x', y_axis_label='y')

show(p)
Then, something strange happens. While I can see the new "**simple_line**" plot on the list of "Bokeh Documents" on my browser (chrome), the second terminal that I used to run python quick_start.py, brings me to what seems to be a **terminal-based web browser** (screenshot below).

No attachments… :slight_smile:


My questions here are:

  1. How can I disable this behavior of bokeh opening the terminal browser?

You can use push() instead of show(p)


  1. Once I “send” several a few examples to the server, line the one above, how can I manage them later from the remote terminal? (e.g. stop, or restart my bokeh-server plots from the command line.

Sorry, I’m not sure I understand. Can you provide more details?


  1. When I run an example against the server, like the simple_line above, Is there anyway to generate a direct URL that points directly to the plot, as opposed to having to gohttp:host.net:5006/ and then the “Bokeh documents” list to access the plot “simple_plot”?

You can find the url you need with:

cursession().object_link(curdoc().context)

that you can call before show(p) [or push()].

Fabio

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/CAPVmnqDXxS%3D6nmb6dseN54q-Q8MZM430vH-FNBVUb1FPbvhX3w%40mail.gmail.com.

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

IIRC not at the moment. Session automatically hooks document and plot internal ids to build the final URL. I’ve opened a GH issue for that here: Expose a way to configure plot/document URL on the server · Issue #1560 · bokeh/bokeh · GitHub

Cheers

Fabio

···

On Monday, December 15, 2014 6:47:57 PM UTC+1, Josh Wasserstein wrote:

Thank you Fabio. The notes you sent are very helpful. Below is the screenshot I mentioned earlier. I think show() is invoking a terminal-based browser since I am on a remote machine, so probably using push instead of show will avoid that.

Regarding your suggestions and getting the URL with **cursession().object_link(curdoc().context), **is there any way to specify a name for the URL?

Thanks Fabio. I’m confused though.

When I run the stock_app example, I can simply go to http://localhost:5006/bokeh/stocks/ which is an easy-to-remember and intuitive URL.

For other examples, such as the taylor_server.py, the URL is more complex: e.g. http://localhost:5006/bokeh/doc/4cabcfed-4e65-4f3d-86b0-2d4201e2be2a/04e29651-b27b-43b7-a064-3c1a7703e6df).

Why is that that? Is there any way to control that?

Josh

···

On Wed, Dec 17, 2014 at 9:18 AM, Fabio Pliger [email protected] wrote:

On Monday, December 15, 2014 6:47:57 PM UTC+1, Josh Wasserstein wrote:

Thank you Fabio. The notes you sent are very helpful. Below is the screenshot I mentioned earlier. I think show() is invoking a terminal-based browser since I am on a remote machine, so probably using push instead of show will avoid that.

Regarding your suggestions and getting the URL with **cursession().object_link(curdoc().context), **is there any way to specify a name for the URL?

IIRC not at the moment. Session automatically hooks document and plot internal ids to build the final URL. I’ve opened a GH issue for that here: https://github.com/bokeh/bokeh/issues/1560

Cheers

Fabio

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/52294309-dc2c-408e-a9bd-a6b71163b312%40continuum.io.

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

Ah, sure. You can use bokeh applet to do this but… it’s a different situation. On the stock_app you are using bokeh-server to embed an applet and serve it from the url you specify. That’s why you crate a new StockApp class and create a function that creates a new instance of it and decorates it with @bokeh_app.route(“/bokeh/stocks/”) and @object_page(“stocks”). You can follow the app examples (sliders, stock and crossfilter) and use bokeh @object_page and @bokeh_app.route decorators to create your custom url. Another option, if you already have your web page or dashboard, you could embed the bokeh plots in your page like shown in the embed examples.

On the other example (taylor_server.py) it is the session object that is taking care of creating everything on bokeh-server for you. From this interface is not possible to customize urls or create alias.

Fabio

···

On Wednesday, December 17, 2014 3:34:13 PM UTC+1, Josh Wasserstein wrote:

Thanks Fabio. I’m confused though.

When I run the stock_app example, I can simply go to http://localhost:5006/bokeh/stocks/ which is an easy-to-remember and intuitive URL.

For other examples, such as the taylor_server.py, the URL is more complex: e.g. http://localhost:5006/bokeh/doc/4cabcfed-4e65-4f3d-86b0-2d4201e2be2a/04e29651-b27b-43b7-a064-3c1a7703e6df).

Why is that that? Is there any way to control that?

Josh

Thank you Fabio, that was very helfpul, although I am still confused. With the idea of transforming this discussion into more searchable documentation, I have created this question in SO.

Josh

···

On Wed, Dec 17, 2014 at 10:16 AM, Fabio Pliger [email protected] wrote:

On Wednesday, December 17, 2014 3:34:13 PM UTC+1, Josh Wasserstein wrote:

Thanks Fabio. I’m confused though.

When I run the stock_app example, I can simply go to http://localhost:5006/bokeh/stocks/ which is an easy-to-remember and intuitive URL.

For other examples, such as the taylor_server.py, the URL is more complex: e.g. http://localhost:5006/bokeh/doc/4cabcfed-4e65-4f3d-86b0-2d4201e2be2a/04e29651-b27b-43b7-a064-3c1a7703e6df).

Why is that that? Is there any way to control that?

Josh

Ah, sure. You can use bokeh applet to do this but… it’s a different situation. On the stock_app you are using bokeh-server to embed an applet and serve it from the url you specify. That’s why you crate a new StockApp class and create a function that creates a new instance of it and decorates it with @bokeh_app.route(“/bokeh/stocks/”) and @object_page(“stocks”). You can follow the app examples (sliders, stock and crossfilter) and use bokeh @object_page and @bokeh_app.route decorators to create your custom url. Another option, if you already have your web page or dashboard, you could embed the bokeh plots in your page like shown in the embed examples.

On the other example (taylor_server.py) it is the session object that is taking care of creating everything on bokeh-server for you. From this interface is not possible to customize urls or create alias.

Fabio

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/a75056b4-9291-4a0f-9814-84179ae9971d%40continuum.io.

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