Add `ChartPlotWidget.main_viz: Viz` convenience `@property`

multichartz
Tyler Goodlet 2022-12-16 20:53:55 -05:00
parent 00a0caa963
commit d95d6d37f1
2 changed files with 9 additions and 2 deletions

View File

@ -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(

View File

@ -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)