Show unit vlm on LHS for now

fsp_ui_mod
Tyler Goodlet 2022-01-09 11:36:30 -05:00
parent 06fe2bd1be
commit e69af9e291
1 changed files with 59 additions and 58 deletions

View File

@ -120,7 +120,6 @@ def update_fsp_chart(
array, array,
array_key=array_key or graphics_name, array_key=array_key or graphics_name,
) )
chart._set_yrange()
# XXX: re: ``array_key``: fsp func names must be unique meaning we # XXX: re: ``array_key``: fsp func names must be unique meaning we
# can't have duplicates of the underlying data even if multiple # can't have duplicates of the underlying data even if multiple
@ -400,13 +399,6 @@ async def maybe_open_vlm_display(
log.warning(f"{linked.symbol.key} does not seem to have volume info") log.warning(f"{linked.symbol.key} does not seem to have volume info")
yield yield
return return
else:
# shm, opened = maybe_mk_fsp_shm(
# linked.symbol.key,
# 'vlm',
# readonly=True,
# )
async with open_fsp_sidepane( async with open_fsp_sidepane(
linked, { linked, {
@ -441,6 +433,10 @@ async def maybe_open_vlm_display(
style='step', style='step',
) )
# show volume units value on LHS (for dinkus)
chart.hideAxis('right')
chart.showAxis('left')
# XXX: ONLY for sub-chart fsps, overlays have their # XXX: ONLY for sub-chart fsps, overlays have their
# data looked up from the chart's internal array set. # data looked up from the chart's internal array set.
# TODO: we must get a data view api going STAT!! # TODO: we must get a data view api going STAT!!
@ -463,7 +459,7 @@ async def maybe_open_vlm_display(
) )
# size view to data once at outset # size view to data once at outset
chart._set_yrange() chart.view._set_yrange()
yield chart yield chart
@ -494,7 +490,10 @@ async def run_fsp_ui(
async with ( async with (
# side UI for parameters/controls # side UI for parameters/controls
open_fsp_sidepane(linkedsplits, {display_name: conf},) as sidepane, open_fsp_sidepane(
linkedsplits,
{display_name: conf},
) as sidepane,
): ):
await started.wait() await started.wait()
profiler(f'fsp:{func_name} attached to fsp ctx-stream') profiler(f'fsp:{func_name} attached to fsp ctx-stream')
@ -511,6 +510,7 @@ async def run_fsp_ui(
data=shm.array, data=shm.array,
overlay=True, overlay=True,
color='default_light', color='default_light',
array_key=func_name,
separate_axes=conf.get('separate_axes', False), separate_axes=conf.get('separate_axes', False),
**conf.get('chart_kwargs', {}) **conf.get('chart_kwargs', {})
) )
@ -575,7 +575,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._set_yrange() chart.view._set_yrange()
# done() # status updates # done() # status updates
profiler(f'fsp:{func_name} starting update loop') profiler(f'fsp:{func_name} starting update loop')
@ -669,7 +669,6 @@ async def start_fsp_displays(
}, },
'dolla_vlm': { 'dolla_vlm': {
'func_name': 'dolla_vlm', 'func_name': 'dolla_vlm',
'zero_on_step': True, 'zero_on_step': True,
'overlay': 'volume', 'overlay': 'volume',
@ -701,8 +700,10 @@ async def start_fsp_displays(
trio.open_nursery(), trio.open_nursery(),
# TODO: fast startup of volume overlayed with $_vlm maybe_open_vlm_display(
maybe_open_vlm_display(linkedsplits, ohlcv), linkedsplits,
ohlcv,
),
)) as (admin, n, vlm_chart): )) as (admin, n, vlm_chart):