aboutsummaryrefslogtreecommitdiff
path: root/qolab/gui
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-12-17 12:58:43 -0500
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-12-17 12:58:43 -0500
commit68faa0e99bf4f4f6a78bde9b2d20bc0a9c7f34fd (patch)
tree8a561d175254b99605dc7c24a1d280fbc6322ac3 /qolab/gui
parenta903154c105a2cdb0b03799975427f86263e0450 (diff)
downloadqolab-68faa0e99bf4f4f6a78bde9b2d20bc0a9c7f34fd.tar.gz
qolab-68faa0e99bf4f4f6a78bde9b2d20bc0a9c7f34fd.zip
better plot updates
Diffstat (limited to 'qolab/gui')
-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):