From 325fe3cf1421a04fda8556ea9fb6a0218e9cbb88 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 22 Jan 2023 15:45:56 -0500 Subject: [PATCH] Return `in_view: bool` from `Viz.update_graphics()` Allows callers to know if they should care about a particular viz rendering call by immediately knowing if the graphics are in view. This turns out super useful particularly when doing dynamic y-ranging overlay calcs. --- piker/ui/_dataviz.py | 2 +- piker/ui/_fsp.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/piker/ui/_dataviz.py b/piker/ui/_dataviz.py index 89e46337..0bd960ca 100644 --- a/piker/ui/_dataviz.py +++ b/piker/ui/_dataviz.py @@ -1061,7 +1061,7 @@ class Viz(msgspec.Struct): # , frozen=True): else: log.warning(f'Unknown view state {vl} -> {vr}') - return + # return # raise RuntimeError(f'Unknown view state {vl} -> {vr}') else: diff --git a/piker/ui/_fsp.py b/piker/ui/_fsp.py index 8fa7fd82..c546ec96 100644 --- a/piker/ui/_fsp.py +++ b/piker/ui/_fsp.py @@ -707,7 +707,7 @@ async def open_vlm_displays( last_val_sticky.update_from_data(-1, value) - _, vlm_curve = vlm_viz.update_graphics() + _, _, vlm_curve = vlm_viz.update_graphics() # size view to data once at outset vlm_chart.view._set_yrange(