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.
multichartz
Tyler Goodlet 2023-01-22 15:45:56 -05:00
parent 28aaaf9866
commit 325fe3cf14
2 changed files with 2 additions and 2 deletions

View File

@ -1061,7 +1061,7 @@ class Viz(msgspec.Struct): # , frozen=True):
else: else:
log.warning(f'Unknown view state {vl} -> {vr}') log.warning(f'Unknown view state {vl} -> {vr}')
return # return
# raise RuntimeError(f'Unknown view state {vl} -> {vr}') # raise RuntimeError(f'Unknown view state {vl} -> {vr}')
else: else:

View File

@ -707,7 +707,7 @@ async def open_vlm_displays(
last_val_sticky.update_from_data(-1, value) 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 # size view to data once at outset
vlm_chart.view._set_yrange( vlm_chart.view._set_yrange(