diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-12-17 12:58:43 -0500 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-12-17 12:58:43 -0500 |
commit | 68faa0e99bf4f4f6a78bde9b2d20bc0a9c7f34fd (patch) | |
tree | 8a561d175254b99605dc7c24a1d280fbc6322ac3 /qolab | |
parent | a903154c105a2cdb0b03799975427f86263e0450 (diff) | |
download | qolab-68faa0e99bf4f4f6a78bde9b2d20bc0a9c7f34fd.tar.gz qolab-68faa0e99bf4f4f6a78bde9b2d20bc0a9c7f34fd.zip |
better plot updates
Diffstat (limited to 'qolab')
-rw-r--r-- | qolab/gui/web.py | 13 |
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): |