From 96b871c4d746004ae9893c7ff406808b21ef30ad Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 7 Dec 2022 17:08:07 -0500 Subject: [PATCH] Draw last datums on boot Ensures that a "last datum" graphics object exists so that zooming can read it using `.x_last()`. Also, disable the linked region stuff for now since it's totally borked after flipping to the time indexing. --- piker/ui/_display.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/piker/ui/_display.py b/piker/ui/_display.py index 86b33e1e..676b27a5 100644 --- a/piker/ui/_display.py +++ b/piker/ui/_display.py @@ -1204,6 +1204,13 @@ async def display_symbol_data( # sidepane=False, sidepane=godwidget.search, ) + + # ensure the last datum graphic is generated + # for zoom-interaction purposes. + hist_chart.get_viz(fqsn).draw_last( + array_key=fqsn, + only_last_uppx=True, + ) pis.setdefault(fqsn, [None, None])[1] = hist_chart.plotItem # don't show when not focussed @@ -1297,6 +1304,13 @@ async def display_symbol_data( last_bar_color=bg_last_bar_color, ) + # ensure the last datum graphic is generated + # for zoom-interaction purposes. + viz.draw_last( + array_key=fqsn, + only_last_uppx=True, + ) + hist_pi.vb.maxmin = partial( hist_chart.maxmin, name=fqsn, @@ -1408,11 +1422,12 @@ async def display_symbol_data( ) godwidget.resize_all() - await link_views_with_region( - rt_chart, - hist_chart, - flume, - ) + # hist_chart.hide() + # await link_views_with_region( + # rt_chart, + # hist_chart, + # flume, + # ) # start graphics update loop after receiving first live quote ln.start_soon(