Remove vlm chart again, drop lotsa fsp cruft

log_linearized_curve_overlays
Tyler Goodlet 2023-02-21 08:49:55 -05:00
parent 5f470d6122
commit 54ecb0990f
1 changed files with 10 additions and 14 deletions

View File

@ -612,7 +612,7 @@ async def open_vlm_displays(
task_status: TaskStatus[ChartPlotWidget] = trio.TASK_STATUS_IGNORED, task_status: TaskStatus[ChartPlotWidget] = trio.TASK_STATUS_IGNORED,
) -> ChartPlotWidget: ) -> None:
''' '''
Volume subchart displays. Volume subchart displays.
@ -667,7 +667,6 @@ 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
vlm_chart = linked.add_plot( vlm_chart = linked.add_plot(
name='volume', name='volume',
@ -693,6 +692,13 @@ async def open_vlm_displays(
# vlm_chart.hideAxis('right') # vlm_chart.hideAxis('right')
vlm_chart.hideAxis('left') vlm_chart.hideAxis('left')
# TODO: is it worth being able to remove axes (from i guess
# a perf perspective) enough that we can actually do this and
# other axis related calls (for eg. label upddates in the
# display loop) don't raise when a the axis can't be loaded and
# thus would normally cause many label related calls to crash?
# axis = vlm_chart.removeAxis('left')
# send back new chart to caller # send back new chart to caller
task_status.started(vlm_chart) task_status.started(vlm_chart)
@ -705,23 +711,16 @@ async def open_vlm_displays(
# read from last calculated value # read from last calculated value
value = shm.array['volume'][-1] value = shm.array['volume'][-1]
last_val_sticky.update_from_data(-1, value) last_val_sticky.update_from_data(-1, value)
_, _, vlm_curve = vlm_viz.update_graphics() _, _, vlm_curve = vlm_viz.update_graphics()
# size view to data once at outset
# vlm_chart.view._set_yrange(
# viz=vlm_viz
# )
# add axis title # add axis title
axis = vlm_chart.getAxis('right') axis = vlm_chart.getAxis('right')
axis.set_title(' vlm') axis.set_title(' vlm')
if dvlm: if dvlm:
tasks_ready = []
# spawn and overlay $ vlm on the same subchart # spawn and overlay $ vlm on the same subchart
dvlm_flume, started = await admin.start_engine_task( dvlm_flume, started = await admin.start_engine_task(
dolla_vlm, dolla_vlm,
@ -839,18 +838,15 @@ async def open_vlm_displays(
# hide the original vlm curve since the $vlm one is now # hide the original vlm curve since the $vlm one is now
# displayed and the curves are effectively the same minus # displayed and the curves are effectively the same minus
# liquidity events (well at least on low OHLC periods - 1s). # liquidity events (well at least on low OHLC periods - 1s).
vlm_curve.hide() # vlm_curve.hide()
vlm_chart.removeItem(vlm_curve) vlm_chart.removeItem(vlm_curve)
# vlm_chart.plotItem.layout.setMinimumWidth(0)
# vlm_chart.removeAxis('left')
vlm_viz = vlm_chart._vizs['volume'] vlm_viz = vlm_chart._vizs['volume']
vlm_chart.view.disable_auto_yrange()
# NOTE: DON'T DO THIS. # NOTE: DON'T DO THIS.
# WHY: we want range sorting on volume for the RHS label! # WHY: we want range sorting on volume for the RHS label!
# -> if you don't want that then use this but likely you # -> if you don't want that then use this but likely you
# only will if we decide to drop unit vlm.. # only will if we decide to drop unit vlm..
# vlm_viz.render = False # vlm_viz.render = False
vlm_chart.view.disable_auto_yrange()
# Trade rate overlay # Trade rate overlay
# XXX: requires an additional overlay for # XXX: requires an additional overlay for