Tabs not working on a bokeh server?

Hi!

When creating a bokeh.models.widgets.Tabs element and pushing it by bokeh.client.push_session onto a running bokeh server it displays the plots in a “list” rather than in tabs. Is this a known problem?

Thank you for any responses, and your patience

-Robert

This pastebin shows a script that replicates the problem

fredag 29. januar 2016 17.02.20 UTC+1 skrev Robert følgende:

···

Hi!

When creating a bokeh.models.widgets.Tabs element and pushing it by bokeh.client.push_session onto a running bokeh server it displays the plots in a “list” rather than in tabs. Is this a known problem?

Thank you for any responses, and your patience

-Robert

I am having the same issue.

···

On Friday, January 29, 2016 at 9:05:36 AM UTC-7, Robert wrote:

This pastebin shows a script that replicates the problem

fredag 29. januar 2016 17.02.20 UTC+1 skrev Robert følgende:

Hi!

When creating a bokeh.models.widgets.Tabs element and pushing it by bokeh.client.push_session onto a running bokeh server it displays the plots in a “list” rather than in tabs. Is this a known problem?

Thank you for any responses, and your patience

-Robert

There is some previous parts of the API about auto-adding to the current document that turned out to be at odds with the new server. We are working to clean all this up for 0.12 in the near future. In the mean time, here is an updated script that works. Note the "Figure" instead of "figure" and also the explicit "curdoc().add_root" If you are curious there are other discussions of this in the tracker and mailing list with details.

···

-----

from bokeh.plotting import Figure, curdoc
from bokeh.models.widgets import Panel, Tabs, TextInput
from bokeh.client import push_session
from bokeh.io import hplot
from bokeh.palettes import Spectral11

import numpy as np

tabs =

x = np.linspace(-2*np.pi, 2*np.pi, 200)

colour_list = Spectral11 #[(51, 153, 51) ,(153, 51, 51), (51, 51, 153), (153, 51,153 ), (153, 51, 51)]

y = np.sin(x)
w = np.cos(x)

z = np.arcsin(x)
u = np.arccos(x)

v = np.arctan(x)
r = np.tan(x)

list_of_axis = [(y,w), (z, u), (v,r)]

def update_title(identity, new):
    figure_obj.title = identity

for two in list_of_axis:

    figure_obj = Figure(plot_width = 1000, plot_height = 800, title = "these are waves")
    figure_obj.line(x, two[0], line_width = 2, line_color = colour_list[3])
    figure_obj.line(x, two[1], line_width = 2, line_color = colour_list[1])

    #text = TextInput(title="title", value='my sine wave')
    #identity = "hello I am plot"
    #text.on_change('value', lambda attr, old, new: update_title(identity, new))

    tabs.append(Panel(child = figure_obj, title = "two by two"))

tabs = Tabs(tabs = tabs)
curdoc().add_root(tabs)
session = push_session(curdoc())
session.show()
session.loop_until_closed()

On Apr 6, 2016, at 2:33 AM, [email protected] wrote:

I am having the same issue.

On Friday, January 29, 2016 at 9:05:36 AM UTC-7, Robert wrote:
This pastebin shows a script that replicates the problem

fredag 29. januar 2016 17.02.20 UTC+1 skrev Robert følgende:
Hi!

When creating a bokeh.models.widgets.Tabs element and pushing it by bokeh.client.push_session onto a running bokeh server it displays the plots in a "list" rather than in tabs. Is this a known problem?

Thank you for any responses, and your patience

-Robert

--
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/62ed0aa9-dd18-4323-b5ee-913deac1078e%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Hi,

    Thanks for the report. Yes it's             known
···

https://github.com/bokeh/bokeh/issues/3138 and I
should be working on it this week as part of the layout work - will be a couple of weeks before
the layout is ready
though.

              FWIW I tweaked your code                       to the following and ran it

and I got both a list
and the tabs representation - very odd.

                                                      from

bokeh.plotting import figure, curdoc

                          from bokeh.models.widgets import Panel,

Tabs, TextInput

                          from bokeh.client import push_session

                          from bokeh.io import hplot

                          from bokeh.palettes import Spectral11

                          import numpy as np

                          x = np.linspace(-2*np.pi, 2*np.pi, 200)

                          colour_list = Spectral11 #[(51, 153, 51)

,(153, 51, 51), (51, 51, 153), (153,
51,153 ), (153, 51, 51)]

                          y = np.sin(x)

                          w = np.cos(x)

                          z = np.arcsin(x)

                          u = np.arccos(x)

                          v = np.arctan(x)

                          r = np.tan(x)

                          list_of_axis = [(y,w), (z, u), (v,r)]

                          tabs = []

                          for two in list_of_axis:

                              figure_obj = figure(plot_width = 1000,

plot_height = 800, title = “these are
waves”)

                              figure_obj.line(x, two[0], line_width

= 2, line_color = colour_list[3])

                              figure_obj.line(x, two[1], line_width

= 2, line_color = colour_list[1])

                              title = "two by two"

                              tabs.append(Panel(child=figure_obj,

title=title))

                          curdoc().add_root(Tabs(tabs=tabs))

On 1/29/16 10:05 AM, Robert wrote:

This pastebin shows a
script that replicates the problem

    fredag 29. januar 2016 17.02.20 UTC+1 skrev Robert følgende:

Hi!

          When creating a bokeh.models.widgets.Tabs element and

pushing it by bokeh.client.push_session onto a running
bokeh server it displays the plots in a “list” rather than
in tabs. Is this a known problem?

Thank you for any responses, and your patience

-Robert

  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/27b4ab47-46c6-44f8-b116-5f0ba8384816%40continuum.io?utm_medium=email&utm_source=footer)      .

For more options, visit .


Sarah Bird
Developer, Bokeh

    [
      ![Continuum Analytics](http://docs.continuum.io/_static/img/ContinuumWordmark.png)
    ](http://continuum.io)

https://groups.google.com/a/continuum.io/d/msgid/bokeh/27b4ab47-46c6-44f8-b116-5f0ba8384816%40continuum.io
https://groups.google.com/a/continuum.io/d/optout

Sorry, as bryan noted
this can work.

      A              nd

yes the confusion over figure/Figure should also be being cle aned
up

                                      from bokeh.plotting

import Figure, curdoc

                  from bokeh.models.widgets import Panel, Tabs,

TextInput

                  from bokeh.client import push_session

                  from bokeh.io import hplot

                  from bokeh.palettes import Spectral11

                  import numpy as np

                  x = np.linspace(-2*np.pi, 2*np.pi, 200)

                  colour_list = Spectral11 #[(51, 153, 51) ,(153,

51, 51), (51, 51, 153), (153, 51,153 ), (153, 51,
51)]

                  y = np.sin(x)

                  w = np.cos(x)

                  z = np.arcsin(x)

                  u = np.arccos(x)

                  v = np.arctan(x)

                  r = np.tan(x)

                  list_of_axis = [(y,w), (z, u), (v,r)]

                  tabs = []

                  for two in list_of_axis:

                      figure_obj = Figure(plot_width = 1000,

plot_height = 800, title = “these are waves”)

                      figure_obj.line(x, two[0], line_width = 2,

line_color = colour_list[3])

                      figure_obj.line(x, two[1], line_width = 2,

line_color = colour_list[1])

                      title = "two by two"

                      tabs.append(Panel(child=figure_obj,

title=title))

                  curdoc().add_root(Tabs(tabs=tabs))
···

On 4/18/16 11:27 AM, Bryan Van de Ven
wrote:


There is some previous parts of the API about auto-adding to the current document that turned out to be at odds with the new server. We are working to clean all this up for 0.12 in the near future. In the mean time, here is an updated script that works. Note the "Figure" instead of "figure" and also the explicit "curdoc().add_root" If you are curious there are other discussions of this in the tracker and mailing list with details.
-----
from bokeh.plotting import Figure, curdoc
from bokeh.models.widgets import Panel, Tabs, TextInput
from bokeh.client import push_session
from bokeh.io import hplot
from bokeh.palettes import Spectral11
import numpy as np
tabs = []
x = np.linspace(-2*np.pi, 2*np.pi, 200)
colour_list = Spectral11 #[(51, 153, 51) ,(153, 51, 51), (51, 51, 153), (153, 51,153 ), (153, 51, 51)]
y = np.sin(x)
w = np.cos(x)
z = np.arcsin(x)
u = np.arccos(x)
v = np.arctan(x)
r = np.tan(x)
list_of_axis = [(y,w), (z, u), (v,r)]
def update_title(identity, new):
figure_obj.title = identity
for two in list_of_axis:
figure_obj = Figure(plot_width = 1000, plot_height = 800, title = "these are waves")
figure_obj.line(x, two[0], line_width = 2, line_color = colour_list[3])
figure_obj.line(x, two[1], line_width = 2, line_color = colour_list[1])
#text = TextInput(title="title", value='my sine wave')
#identity = "hello I am plot"
#text.on_change('value', lambda attr, old, new: update_title(identity, new))
tabs.append(Panel(child = figure_obj, title = "two by two"))
tabs = Tabs(tabs = tabs)
curdoc().add_root(tabs)
session = push_session(curdoc())
session.show()
session.loop_until_closed()

On Apr 6, 2016, at 2:33 AM, wrote:
I am having the same issue. On Friday, January 29, 2016 at 9:05:36 AM UTC-7, Robert wrote:
This pastebin shows a script that replicates the problem fredag 29. januar 2016 17.02.20 UTC+1 skrev Robert følgende:
Hi! When creating a bokeh.models.widgets.Tabs element and pushing it by bokeh.client.push_session onto a running bokeh server it displays the plots in a "list" rather than in tabs. Is this a known problem? Thank you for any responses, and your patience
-Robert -- 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 .
To post to this group, send email to .
To view this discussion on the web visit .
For more options, visit .


Sarah Bird
Developer, Bokeh

    [
      ![Continuum Analytics](http://docs.continuum.io/_static/img/ContinuumWordmark.png)
    ](http://continuum.io)

[email protected][email protected]@continuum.iohttps://groups.google.com/a/continuum.io/d/msgid/bokeh/62ed0aa9-dd18-4323-b5ee-913deac1078e%40continuum.iohttps://groups.google.com/a/continuum.io/d/optout

I too get both a “list” of plots and then the plots in a set of tabs. Could it be that curdoc contains the figure instances and adding a root object merely extends the number of objects?
Also when when adding by curdoc().add_root(tabs) the plots become centered and all widgets aligned in a hplot become squished to fit the page.

Cheers,

Robert

···

2016-04-20 1:05 GMT+02:00 Sarah Bird - Continuum [email protected]:

    Sorry, as bryan noted

this can work.

      A              nd

yes the confusion over figure/Figure should also be being cle aned
up

                                      from bokeh.plotting

import Figure, curdoc

                  from bokeh.models.widgets import Panel, Tabs,

TextInput

                  from bokeh.client import push_session

                  from [bokeh.io](http://bokeh.io) import hplot

                  from bokeh.palettes import Spectral11



                  import numpy as np





                  x = np.linspace(-2*np.pi, 2*np.pi, 200)



                  colour_list = Spectral11 #[(51, 153, 51) ,(153,

51, 51), (51, 51, 153), (153, 51,153 ), (153, 51,
51)]

                  y = np.sin(x)

                  w = np.cos(x)



                  z = np.arcsin(x)

                  u = np.arccos(x)



                  v = np.arctan(x)

                  r = np.tan(x)



                  list_of_axis = [(y,w), (z, u), (v,r)]



                  tabs = []

                  for two in list_of_axis:

                      figure_obj = Figure(plot_width = 1000,

plot_height = 800, title = “these are waves”)

                      figure_obj.line(x, two[0], line_width = 2,

line_color = colour_list[3])

                      figure_obj.line(x, two[1], line_width = 2,

line_color = colour_list[1])

                      title = "two by two"

                      tabs.append(Panel(child=figure_obj,

title=title))

                  curdoc().add_root(Tabs(tabs=tabs))





  On 4/18/16 11:27 AM, Bryan Van de Ven

wrote:


There is some previous parts of the API about auto-adding to the current document that turned out to be at odds with the new server. We are working to clean all this up for 0.12 in the near future. In the mean time, here is an updated script that works. Note the "Figure" instead of "figure" and also the explicit "curdoc().add_root" If you are curious there are other discussions of this in the tracker and mailing list with details.
-----
from bokeh.plotting import Figure, curdoc
from bokeh.models.widgets import Panel, Tabs, TextInput
from bokeh.client import push_session
from [bokeh.io](http://bokeh.io) import hplot
from bokeh.palettes import Spectral11
import numpy as np
tabs = []
x = np.linspace(-2*np.pi, 2*np.pi, 200)
colour_list = Spectral11 #[(51, 153, 51) ,(153, 51, 51), (51, 51, 153), (153, 51,153 ), (153, 51, 51)]
y = np.sin(x)
w = np.cos(x)
z = np.arcsin(x)
u = np.arccos(x)
v = np.arctan(x)
r = np.tan(x)
list_of_axis = [(y,w), (z, u), (v,r)]
def update_title(identity, new):
figure_obj.title = identity
for two in list_of_axis:
figure_obj = Figure(plot_width = 1000, plot_height = 800, title = "these are waves")
figure_obj.line(x, two[0], line_width = 2, line_color = colour_list[3])
figure_obj.line(x, two[1], line_width = 2, line_color = colour_list[1])
#text = TextInput(title="title", value='my sine wave')
#identity = "hello I am plot"
#text.on_change('value', lambda attr, old, new: update_title(identity, new))
tabs.append(Panel(child = figure_obj, title = "two by two"))
tabs = Tabs(tabs = tabs)
curdoc().add_root(tabs)
session = push_session(curdoc())
session.show()
session.loop_until_closed()
On Apr 6, 2016, at 2:33 AM, [email protected] wrote:
I am having the same issue. On Friday, January 29, 2016 at 9:05:36 AM UTC-7, Robert wrote:
This pastebin shows a script that replicates the problem fredag 29. januar 2016 17.02.20 UTC+1 skrev Robert følgende:
Hi! When creating a bokeh.models.widgets.Tabs element and pushing it by bokeh.client.push_session onto a running bokeh server it displays the plots in a "list" rather than in tabs. Is this a known problem? Thank you for any responses, and your patience
-Robert -- 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/62ed0aa9-dd18-4323-b5ee-913deac1078e%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/62ed0aa9-dd18-4323-b5ee-913deac1078e%40continuum.io).
For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).


Sarah Bird
Developer, Bokeh

    [
      ![Continuum Analytics](http://docs.continuum.io/_static/img/ContinuumWordmark.png)
    ](http://continuum.io)

You received this message because you are subscribed to a topic in the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/24x9H4TLpIk/unsubscribe.

To unsubscribe from this group and all its topics, 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/5716B9B3.4090705%40continuum.io.

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

Hello all,
i was just experience the same issues of gettinga list of plots in addition to the tabbed view at the bottom.
The work around i found was to call
curdoc().clear() prior to
curdoc().add_root(tabs)

This doesn’t fix the odd sizing of the graphs but at least they are being displayed semi properly.

Hope this helps,

Luis

···

On Wednesday, April 20, 2016 at 1:03:52 PM UTC+2, Robert wrote:

I too get both a “list” of plots and then the plots in a set of tabs. Could it be that curdoc contains the figure instances and adding a root object merely extends the number of objects?
Also when when adding by curdoc().add_root(tabs) the plots become centered and all widgets aligned in a hplot become squished to fit the page.

Cheers,

Robert

2016-04-20 1:05 GMT+02:00 Sarah Bird - Continuum [email protected]:

    Sorry, as bryan noted

this can work.

      A              nd

yes the confusion over figure/Figure should also be being cle aned
up

                                      from bokeh.plotting

import Figure, curdoc

                  from bokeh.models.widgets import Panel, Tabs,

TextInput

                  from bokeh.client import push_session

                  from [bokeh.io](http://bokeh.io) import hplot

                  from bokeh.palettes import Spectral11



                  import numpy as np





                  x = np.linspace(-2*np.pi, 2*np.pi, 200)



                  colour_list = Spectral11 #[(51, 153, 51) ,(153,

51, 51), (51, 51, 153), (153, 51,153 ), (153, 51,
51)]

                  y = np.sin(x)

                  w = np.cos(x)



                  z = np.arcsin(x)

                  u = np.arccos(x)



                  v = np.arctan(x)

                  r = np.tan(x)



                  list_of_axis = [(y,w), (z, u), (v,r)]



                  tabs = []

                  for two in list_of_axis:

                      figure_obj = Figure(plot_width = 1000,

plot_height = 800, title = “these are waves”)

                      figure_obj.line(x, two[0], line_width = 2,

line_color = colour_list[3])

                      figure_obj.line(x, two[1], line_width = 2,

line_color = colour_list[1])

                      title = "two by two"

                      tabs.append(Panel(child=                      figure_obj,

title=title))

                  curdoc().add_root(Tabs(tabs=tabs))





  On 4/18/16 11:27 AM, Bryan Van de Ven > > wrote:

There is some previous parts of the API about auto-adding to the current document that turned out to be at odds with the new server. We are working to clean all this up for 0.12 in the near future. In the mean time, here is an updated script that works. Note the "Figure" instead of "figure" and also the explicit "curdoc().add_root" If you are curious there are other discussions of this in the tracker and mailing list with details.
-----
from bokeh.plotting import Figure, curdoc
from bokeh.models.widgets import Panel, Tabs, TextInput
from bokeh.client import push_session
from [bokeh.io](http://bokeh.io) import hplot
from bokeh.palettes import Spectral11
import numpy as np
tabs = []
x = np.linspace(-2*np.pi, 2*np.pi, 200)
colour_list = Spectral11 #[(51, 153, 51) ,(153, 51, 51), (51, 51, 153), (153, 51,153 ), (153, 51, 51)]
y = np.sin(x)
w = np.cos(x)
z = np.arcsin(x)
u = np.arccos(x)
v = np.arctan(x)
r = np.tan(x)
list_of_axis = [(y,w), (z, u), (v,r)]
def update_title(identity, new):
figure_obj.title = identity
for two in list_of_axis:
figure_obj = Figure(plot_width = 1000, plot_height = 800, title = "these are waves")
figure_obj.line(x, two[0], line_width = 2, line_color = colour_list[3])
figure_obj.line(x, two[1], line_width = 2, line_color = colour_list[1])
#text = TextInput(title="title", value='my sine wave')
#identity = "hello I am plot"
#text.on_change('value', lambda attr, old, new: update_title(identity, new))
tabs.append(Panel(child = figure_obj, title = "two by two"))
tabs = Tabs(tabs = tabs)
curdoc().add_root(tabs)
session = push_session(curdoc())
session.show()
session.loop_until_closed()
On Apr 6, 2016, at 2:33 AM, [email protected] wrote:
I am having the same issue. On Friday, January 29, 2016 at 9:05:36 AM UTC-7, Robert wrote:
This pastebin shows a script that replicates the problem fredag 29. januar 2016 17.02.20 UTC+1 skrev Robert følgende:
Hi! When creating a bokeh.models.widgets.Tabs element and pushing it by bokeh.client.push_session onto a running bokeh server it displays the plots in a "list" rather than in tabs. Is this a known problem? Thank you for any responses, and your patience
-Robert -- 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/62ed0aa9-dd18-4323-b5ee-913deac1078e%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/62ed0aa9-dd18-4323-b5ee-913deac1078e%40continuum.io).
For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).



Sarah Bird
Developer, Bokeh

    [
      <img alt="Continuum Analytics" src="https://lh6.googleusercontent.com/proxy/VYgVjggTk1hCXSN9wFkffE3I6kxTvJ51tT4KvDXOuKbs1WyFG66k7kt2-vkDimbyxfWtP-d1paJmstMYhPPnDYSUF4rLPoYM2GM2QFM=w5000-h5000" height="30px" width="150px">
    ](http://continuum.io)

You received this message because you are subscribed to a topic in the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/24x9H4TLpIk/unsubscribe.

To unsubscribe from this group and all its topics, 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/5716B9B3.4090705%40continuum.io.

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