Drop `ChartView._maxmin()` usage in `.ui._fsp`

Removes the multi-maxmin usage as well as ensures appropriate `Viz` refs
are passed into the view methods now requiring it. Also drops the "back
linking" of the vlm chart view to the source OHLC chart since we're
going to add this as a default to the charting API.
multichartz_backup
Tyler Goodlet 2023-01-18 12:07:47 -05:00
parent 9da93478df
commit ed3de9eb5f
1 changed files with 17 additions and 17 deletions

View File

@ -282,9 +282,10 @@ async def run_fsp_ui(
# profiler(f'fsp:{name} chart created') # profiler(f'fsp:{name} chart created')
# first UI update, usually from shm pushed history # first UI update, usually from shm pushed history
viz = chart.get_viz(array_key)
update_fsp_chart( update_fsp_chart(
chart, chart,
chart.get_viz(array_key), viz,
name, name,
array_key=array_key, array_key=array_key,
) )
@ -311,7 +312,7 @@ async def run_fsp_ui(
# level_line(chart, 70, orient_v='bottom') # level_line(chart, 70, orient_v='bottom')
# level_line(chart, 80, orient_v='top') # level_line(chart, 80, orient_v='top')
chart.view._set_yrange() chart.view._set_yrange(viz=viz)
# done() # status updates # done() # status updates
# profiler(f'fsp:{func_name} starting update loop') # profiler(f'fsp:{func_name} starting update loop')
@ -665,7 +666,7 @@ async def open_vlm_displays(
# built-in vlm which we plot ASAP since it's # built-in vlm which we plot ASAP since it's
# usually data provided directly with OHLC history. # usually data provided directly with OHLC history.
shm = ohlcv shm = ohlcv
ohlc_chart = linked.chart # ohlc_chart = linked.chart
vlm_chart = linked.add_plot( vlm_chart = linked.add_plot(
name='volume', name='volume',
@ -683,13 +684,10 @@ async def open_vlm_displays(
# the curve item internals are pretty convoluted. # the curve item internals are pretty convoluted.
style='step', style='step',
) )
vlm_chart.view.enable_auto_yrange() vlm_viz = vlm_chart._vizs['volume']
# vlm_chart.view.enable_auto_yrange(
# back-link the volume chart to trigger y-autoranging # viz=vlm_viz,
# in the ohlc (parent) chart. # )
ohlc_chart.view.enable_auto_yrange(
src_vb=vlm_chart.view,
)
# force 0 to always be in view # force 0 to always be in view
def multi_maxmin( def multi_maxmin(
@ -741,7 +739,9 @@ async def open_vlm_displays(
) )
# size view to data once at outset # size view to data once at outset
vlm_chart.view._set_yrange() vlm_chart.view._set_yrange(
viz=vlm_viz
)
# add axis title # add axis title
axis = vlm_chart.getAxis('right') axis = vlm_chart.getAxis('right')
@ -827,7 +827,7 @@ async def open_vlm_displays(
) )
# add custom auto range handler # add custom auto range handler
dvlm_pi.vb._maxmin = group_mxmn # dvlm_pi.vb._maxmin = group_mxmn
# add dvlm (step) curves to common view # add dvlm (step) curves to common view
def chart_curves( def chart_curves(
@ -926,11 +926,11 @@ async def open_vlm_displays(
) )
# add custom auto range handler # add custom auto range handler
tr_pi.vb.maxmin = partial( # tr_pi.vb.maxmin = partial(
multi_maxmin, # multi_maxmin,
# keep both regular and dark vlm in view # # keep both regular and dark vlm in view
names=trade_rate_fields, # names=trade_rate_fields,
) # )
tr_pi.hideAxis('bottom') tr_pi.hideAxis('bottom')
chart_curves( chart_curves(