Patrick Aspinall
Patrick Aspinall

Reputation: 21

Multiple Bokeh tabs containing widgets do not seem to display properly

I am trying to create a user interface with Bokeh, part of which would display controls on multiple tabs.

Looking at the Bokeh docs and the answer to this question , I can get the example working with tabs showing figures.

Based on these, I tried to update the code to have a button on each tab like so:

from bokeh.models import Button
from bokeh.models.widgets import Panel, Tabs
from bokeh.io import show, output_file
from bokeh.layouts import widgetbox, layout, row, column

output_file("tabs.html")

b1 = Button(label='Test')
b1_wb = widgetbox(b1, sizing_mode='fixed')
b2 = Button(label='Test2')
b2_wb = widgetbox(b2, sizing_mode='fixed')
l1 = layout([[b1_wb]])
l2 = layout([[b2_wb]])
tab1 = Panel(child=l1, title="Button 1")
tab2 = Panel(child=l2, title="Button 2")
tabs = Tabs(tabs=[ tab1, tab2 ])
show(tabs)

This displays two buttons above one another but no tabs - if I change one of the tabs to display a figure instead of a button then I get two tabs, one with a button and the other showing a figure

So the problem only seems to happen when both tabs contain widgets - has anyone else encountered this issue please?

Upvotes: 1

Views: 1139

Answers (1)

Patrick Aspinall
Patrick Aspinall

Reputation: 21

Seems to be a result of a known issue with Bokeh:

https://github.com/bokeh/bokeh/issues/5169

I resolved the problem by creating a figure element on a tab with a blank title which renders it invisible as shown in the comments on the bug record.

Upvotes: 1

Related Questions