aboutsummaryrefslogtreecommitdiff
path: root/qolab/gui/web.py
diff options
context:
space:
mode:
Diffstat (limited to 'qolab/gui/web.py')
-rw-r--r--qolab/gui/web.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/qolab/gui/web.py b/qolab/gui/web.py
index 612f72a..88f17f2 100644
--- a/qolab/gui/web.py
+++ b/qolab/gui/web.py
@@ -88,10 +88,18 @@ class QOLTimeLog(jp.Div):
log.clear_data()
self.plot()
- def _replot(self, msg):
+ async def _replot(self, msg):
self.plot()
+ await self.update()
- async def plot(self):
+ async def update_loop(self, wait_time=4):
+ wait_time=5
+ while True:
+ print('updating chart')
+ await self.update()
+ await asyncio.sleep(wait_time)
+
+ def plot(self):
log = self.log
f = plt.figure()
if log is None:
@@ -100,7 +108,6 @@ class QOLTimeLog(jp.Div):
log.plot()
self.chart.set_figure(f)
plt.close(f)
- jp.run_task(self.update())
class QOLSaveControls(jp.Div):