Hi everyone !
I’m trying to stop the localHost with a “Stop” button on my interface, however I can’t find the function to stop the “Curdoc”, could you help me please?
from bokeh.plotting import figure
from bokeh.io import curdoc
from bokeh.models import Button, CustomJS, Div
from bokeh.layouts import column
from bokeh import eventsdiv = Div(width=400)
button = Button(label=“STOP”, width=300)p = figure(plot_width=400, plot_height=400)
p.square([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], size=[10, 15, 20, 25, 30], color=“firebrick”, alpha=0.6)
button.js_on_event(events.ButtonClick, CustomJS(args=dict(div=div), code=“”"
div.text = “Stop server”;
“”"))
doc=curdoc()
doc.add_root(column(p,button))
Best Regards,
Pierre-yves