Using the code still not working for me on 0a18.
tried moving to Stream and still nothing. no error either
import panel as pn
import param
from tornado.ioloop import IOLoop
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource
import numpy as np
pn.extension()
class Application(param.Parameterized):
do_calc = param.Action(lambda self: self._do_calc())
def __init__(self, **params):
super(Application, self).__init__(**params)
self.source = ColumnDataSource({"x": [1,2,3], "y": [2,3,4]})
self.figure = figure()
self.figure.line(x="x", y="y", source=self.source)
self.col = pn.Column(
pn.pane.Markdown("## Title"),
self.param.do_calc,
self.figure,
)
pn.state.add_periodic_callback(self._do_calc, 200) # <- this line does not work properly
def _do_calc(self):
data = list(np.random.randint(0, 2 ** 31, 10))
self.source.stream({"y": data, "x": data}, 300)
def panel(self):
return self.col
app = Application()
app.panel()