bokeh: Plot becomes unresponsive when button widget is appended to layout
Hi,
I have a problem when appending Button widgets to a VBox in a nested layout.
Python: 2.7.12 64-bit Bokeh Version: 0.12.4 Browser: Chrome & Edge OS: Windows 10
The below code reproduces the problem. When the add button is pressed the new Button widget is displayed, however the plot figure stops updating or responding. A small graphics glitch also occurs on the title of the plot. No console or browser errors are reported.
import numpy as np
from bokeh.io import curdoc
from bokeh.layouts import row
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure
# Set up data
x = np.linspace(0, 4*np.pi, 200)
y = np.sin(x)
source = ColumnDataSource(data=dict(x=x, y=y))
# Set up plot
plot = figure()
plot.line('x', 'y', source=source)
# Problem Code:
from bokeh.models.widgets import Button
from bokeh.models.layouts import VBox
button = Button(label="Add")
vbox = VBox(children=[button])
def create_button():
button = Button(label=str(len(vbox.children)))
vbox.children.append(button)
button.on_click(create_button)
curdoc().add_root(row(vbox, plot))
curdoc().title = "Sliders"
Thanks in advance for any help on this.
Regards, Simon
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (9 by maintainers)
Adding to
0.12.6as part of overall layout effort