From eea850450a338fec24436401d5c41fcb764666fc Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 1 Mar 2023 17:35:07 -0500 Subject: [PATCH] Handle yrange not set on view vase for vlm fsp plot --- piker/ui/_display.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/piker/ui/_display.py b/piker/ui/_display.py index 685fcca7..dbde38f7 100644 --- a/piker/ui/_display.py +++ b/piker/ui/_display.py @@ -853,7 +853,12 @@ def graphics_update_cycle( vlm_vizs = vlm_chart._vizs main_vlm_viz = vlm_vizs['volume'] main_vlm_vb = main_vlm_viz.plot.vb - (_, vlm_ymx) = vlm_yrange = main_vlm_vb._yrange + + # TODO: we should probably read this + # from the `Viz.vs: ViewState`! + vlm_yr = main_vlm_vb._yrange + if vlm_yr: + (_, vlm_ymx) = vlm_yrange = vlm_yr # always update y-label ds.vlm_sticky.update_from_data( @@ -892,6 +897,7 @@ def graphics_update_cycle( if ( mx_vlm_in_view + and vlm_yr and mx_vlm_in_view != vlm_ymx ): # in this case we want to scale all overlays in the