Tab Panes inside layouts?

Hello,

I am trying to use tab panes inside a layout.

I used the example on

http://bokeh.pydata.org/en/latest/docs/user_guide/interaction/widgets.html#tab-panes

as base and added a second tabs widget and a layout.

I can put one tabs widget inside a layout, and the page opening looks ok.

When I add the second tabs widget the opening page is empty.

Is this a bug, or am I trying something that is not supported?

My test code:

if name == ‘main’:

Starting bokeh server from here

import subprocess

import time

args = [‘python’, ‘-m’, ‘bokeh’, ‘serve’]

p = subprocess.Popen(args)

time.sleep(1) # time to wait might be longer on other PC

from bokeh.client import push_session

from bokeh.layouts import layout

from bokeh.models.widgets import Panel, Tabs

from bokeh.plotting import figure, curdoc

p1 = figure(plot_width=300, plot_height=300)

p1.circle([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], size=20, color=“navy”, alpha=0.5)

p2 = figure(plot_width=300, plot_height=300)

tab1 = Panel(child=p1, title=“circle”)

p2.line([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], line_width=3, color=“navy”, alpha=0.5)

tab2 = Panel(child=p2, title=“line”)

tabs1 = Tabs(tabs=[ tab1, tab2 ])

tabs2 = Tabs(tabs=[ tab2, tab1 ])

#this is working:

mylayout = layout([[tabs1]])

this is not working:

mylayout = layout([[tabs1], [tabs2]])

session = push_session(curdoc())

session.show(mylayout)

session.loop_until_closed()

``

Thanks

Daniel

Likely one of a class of bugs associated with the Tabs widget: https://github.com/bokeh/bokeh/issues/5143

···

On Tuesday, February 28, 2017 at 1:00:23 PM UTC-5, Daniel Krause wrote:

Hello,

I am trying to use tab panes inside a layout.

I used the example on

http://bokeh.pydata.org/en/latest/docs/user_guide/interaction/widgets.html#tab-panes

as base and added a second tabs widget and a layout.

I can put one tabs widget inside a layout, and the page opening looks ok.

When I add the second tabs widget the opening page is empty.

Is this a bug, or am I trying something that is not supported?

My test code:

if name == ‘main’:

Starting bokeh server from here

import subprocess

import time

args = [‘python’, ‘-m’, ‘bokeh’, ‘serve’]

p = subprocess.Popen(args)

time.sleep(1) # time to wait might be longer on other PC

from bokeh.client import push_session

from bokeh.layouts import layout

from bokeh.models.widgets import Panel, Tabs

from bokeh.plotting import figure, curdoc

p1 = figure(plot_width=300, plot_height=300)

p1.circle([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], size=20, color=“navy”, alpha=0.5)

p2 = figure(plot_width=300, plot_height=300)

tab1 = Panel(child=p1, title=“circle”)

p2.line([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], line_width=3, color=“navy”, alpha=0.5)

tab2 = Panel(child=p2, title=“line”)

tabs1 = Tabs(tabs=[ tab1, tab2 ])

tabs2 = Tabs(tabs=[ tab2, tab1 ])

#this is working:

mylayout = layout([[tabs1]])

this is not working:

mylayout = layout([[tabs1], [tabs2]])

session = push_session(curdoc())

session.show(mylayout)

session.loop_until_closed()

``

Thanks

Daniel