From f8727251f9456530f2859f3aa845d9c9180e5b35 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 28 Feb 2023 09:43:16 -0500 Subject: [PATCH] Better doc string, use `Viz.vs: ViewState` --- piker/ui/_render.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/piker/ui/_render.py b/piker/ui/_render.py index dc162834..69bd37c4 100644 --- a/piker/ui/_render.py +++ b/piker/ui/_render.py @@ -51,7 +51,20 @@ log = get_logger(__name__) class Renderer(msgspec.Struct): + ''' + Low(er) level interface for converting a source, real-time updated, + data buffer (usually held in a ``ShmArray``) to a graphics data + format usable by `Qt`. + A renderer reads in context-specific source data using a ``Viz``, + formats that data to a 2D-xy pre-graphics format using + a ``IncrementalFormatter``, then renders that data to a set of + output graphics objects normally a ``.ui._curve.FlowGraphics`` + sub-type to which the ``Renderer.path`` is applied and further "last + datum" graphics are updated from the source buffer's latest + sample(s). + + ''' viz: Viz fmtr: IncrementalFormatter @@ -195,7 +208,7 @@ class Renderer(msgspec.Struct): fast_path: QPainterPath = self.fast_path reset: bool = False - self.viz.yrange = None + self.viz.ds_yrange = None # redraw the entire source data if we have either of: # - no prior path graphic rendered or, @@ -218,7 +231,7 @@ class Renderer(msgspec.Struct): ) if ds_out is not None: x_1d, y_1d, ymn, ymx = ds_out - self.viz.yrange = ymn, ymx + self.viz.ds_yrange = ymn, ymx # print(f'{self.viz.name} post ds: ymn, ymx: {ymn},{ymx}') reset = True