diff --git a/piker/ui/_display.py b/piker/ui/_display.py index c2333350..df51d444 100644 --- a/piker/ui/_display.py +++ b/piker/ui/_display.py @@ -106,7 +106,7 @@ def chart_maxmin( return last_bars_range, mx, max(mn, 0), mx_vlm_in_view -async def update_linked_charts_graphics( +async def graphics_update_loop( linked: LinkedSplits, stream: tractor.MsgStream, ohlcv: np.ndarray, @@ -258,13 +258,15 @@ async def update_linked_charts_graphics( ) last_mx_vlm = mx_vlm_in_view - for curve_name, shm in vlm_chart._overlays.items(): + for curve_name, flow in vlm_chart._flows.items(): update_fsp_chart( vlm_chart, - shm, + flow.shm, curve_name, array_key=curve_name, ) + # is this even doing anything? + flow.plot.vb._set_yrange() ticks_frame = quote.get('ticks', ()) @@ -411,14 +413,14 @@ async def update_linked_charts_graphics( # TODO: all overlays on all subplots.. # run synchronous update on all derived overlays - for curve_name, shm in chart._overlays.items(): + for curve_name, flow in chart._flows.items(): update_fsp_chart( chart, - shm, + flow.shm, curve_name, array_key=curve_name, ) - # chart._set_yrange() + # chart.view._set_yrange() async def check_for_new_bars( @@ -473,11 +475,11 @@ async def check_for_new_bars( ) # main chart overlays - for name in price_chart._overlays: - + # for name in price_chart._flows: + for curve_name in price_chart._flows: price_chart.update_curve_from_array( - name, - price_chart._arrays[name] + curve_name, + price_chart._arrays[curve_name] ) # each subplot @@ -614,7 +616,7 @@ async def display_symbol_data( # start graphics update loop after receiving first live quote ln.start_soon( - update_linked_charts_graphics, + graphics_update_loop, linkedsplits, feed.stream, ohlcv, diff --git a/piker/ui/_fsp.py b/piker/ui/_fsp.py index bd037d9e..03d483a0 100644 --- a/piker/ui/_fsp.py +++ b/piker/ui/_fsp.py @@ -250,7 +250,7 @@ async def run_fsp_ui( **conf.get('chart_kwargs', {}) ) # specially store ref to shm for lookup in display loop - chart._overlays[name] = shm + chart._flows[name].shm = shm else: # create a new sub-chart widget for this fsp @@ -634,7 +634,9 @@ async def open_vlm_displays( for name in names: mxmn = chart.maxmin(name=name) if mxmn: - mx = max(mxmn[1], mx) + ymax = mxmn[1] + if ymax > mx: + mx = ymax return 0, mx @@ -730,8 +732,8 @@ async def open_vlm_displays( # all to be overlayed curve names fields = [ - 'dolla_vlm', - 'dark_vlm', + 'dolla_vlm', + 'dark_vlm', ] dvlm_rate_fields = [ 'dvlm_rate', @@ -794,7 +796,7 @@ async def open_vlm_displays( # specially store ref to shm for lookup in display loop # since only a placeholder of `None` is entered in # ``.draw_curve()``. - chart._overlays[name] = shm + chart._flows[name].shm = shm chart_curves( fields, @@ -857,7 +859,7 @@ async def open_vlm_displays( # dashed line to represent "individual trades" being # more "granular" B) - # style='dash', + style='dash', ) for pi in (dvlm_pi, tr_pi):