From 9418f53244f2b0f50401d5a953f44a5f853d7153 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 23 Jan 2023 20:03:00 -0500 Subject: [PATCH] Speed up ranging in display loop use the new `do_overlay_scaling: bool` since we know each feed will have its own updates (cuz multiplexed by feed..) and we can avoid ranging/scaling overlays that will make their own calls. Also, pass in the last datum "brighter" color for ohlc curves as it was originally (and now that we can pass that styling bit through). --- piker/ui/_display.py | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/piker/ui/_display.py b/piker/ui/_display.py index c934f089..55f18f80 100644 --- a/piker/ui/_display.py +++ b/piker/ui/_display.py @@ -261,7 +261,10 @@ async def increment_history_view( profiler('`hist Viz.update_graphics()` call') if liv: - hist_viz.plot.vb._set_yrange(viz=hist_viz) + # hist_viz.plot.vb._set_yrange(viz=hist_viz) + hist_viz.plot.vb.interact_graphics_cycle( + do_overlay_scaling=False, + ) profiler('hist chart yrange view') # check if tread-in-place view x-shift is needed @@ -715,20 +718,18 @@ def graphics_update_cycle( or not main_vb._ic.is_set() ): yr = (mn, mx) - # print( - # f'MAIN VIZ yrange update\n' - # f'{fqsn}: {yr}' - # ) - - main_vb._set_yrange( - # TODO: we should probably scale - # the view margin based on the size - # of the true range? This way you can - # slap in orders outside the current - # L1 (only) book range. - # range_margin=0.1, - yrange=yr + main_vb.interact_graphics_cycle( + do_overlay_scaling=False, ) + # TODO: we should probably scale + # the view margin based on the size + # of the true range? This way you can + # slap in orders outside the current + # L1 (only) book range. + # main_vb._set_yrange( + # yrange=yr + # # range_margin=0.1, + # ) profiler('main vb y-autorange') # SLOW CHART resize case @@ -1224,6 +1225,9 @@ async def display_symbol_data( # to avoid internal pane creation. # sidepane=False, sidepane=godwidget.search, + draw_kwargs={ + 'last_step_color': 'original', + }, ) # ensure the last datum graphic is generated @@ -1242,6 +1246,9 @@ async def display_symbol_data( # in the case of history chart we explicitly set `False` # to avoid internal pane creation. sidepane=pp_pane, + draw_kwargs={ + 'last_step_color': 'original', + }, ) rt_viz = rt_chart.get_viz(fqsn) pis.setdefault(fqsn, [None, None])[0] = rt_chart.plotItem