From 1ece704d6eef7a8d79855d0ddb9f7ef22937ad6d Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 16 Dec 2022 20:53:55 -0500 Subject: [PATCH] Add `ChartPlotWidget.main_viz: Viz` convenience `@property` --- piker/ui/_app.py | 3 +-- piker/ui/_chart.py | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/piker/ui/_app.py b/piker/ui/_app.py index 2743103e..3be073e7 100644 --- a/piker/ui/_app.py +++ b/piker/ui/_app.py @@ -178,8 +178,7 @@ def _main( tractor_kwargs, ) -> None: ''' - Sync entry point to start a chart: a ``tractor`` + Qt runtime - entry point + Sync entry point to start a chart: a ``tractor`` + Qt runtime. ''' run_qtractor( diff --git a/piker/ui/_chart.py b/piker/ui/_chart.py index aea1d927..a643c498 100644 --- a/piker/ui/_chart.py +++ b/piker/ui/_chart.py @@ -1365,4 +1365,12 @@ class ChartPlotWidget(pg.PlotWidget): self, key: str, ) -> Viz: + ''' + Try to get an underlying ``Viz`` by key. + + ''' return self._vizs.get(key) + + @property + def main_viz(self) -> Viz: + return self.get_viz(self.name)