Drop remaining non-usage of `ChartPlotWidget.maxmin()`
parent
0ac2e4e027
commit
d2e64accf6
|
@ -1305,43 +1305,6 @@ class ChartPlotWidget(pg.PlotWidget):
|
||||||
self.sig_mouse_leave.emit(self)
|
self.sig_mouse_leave.emit(self)
|
||||||
self.scene().leaveEvent(ev)
|
self.scene().leaveEvent(ev)
|
||||||
|
|
||||||
def maxmin(
|
|
||||||
self,
|
|
||||||
name: str | None = None,
|
|
||||||
bars_range: tuple[
|
|
||||||
int, int, int, int, int, int
|
|
||||||
] | None = None,
|
|
||||||
|
|
||||||
) -> tuple[float, float]:
|
|
||||||
'''
|
|
||||||
Return the max and min y-data values "in view".
|
|
||||||
|
|
||||||
If ``bars_range`` is provided use that range.
|
|
||||||
|
|
||||||
'''
|
|
||||||
# TODO: here we should instead look up the ``Viz.shm.array``
|
|
||||||
# and read directly from shm to avoid copying to memory first
|
|
||||||
# and then reading it again here.
|
|
||||||
viz_key = name or self.name
|
|
||||||
viz = self._vizs.get(viz_key)
|
|
||||||
if viz is None:
|
|
||||||
log.error(f"viz {viz_key} doesn't exist in chart {self.name} !?")
|
|
||||||
return 0, 0
|
|
||||||
|
|
||||||
res = viz.maxmin()
|
|
||||||
|
|
||||||
if (
|
|
||||||
res is None
|
|
||||||
):
|
|
||||||
mxmn = 0, 0
|
|
||||||
if not self._on_screen:
|
|
||||||
self.default_view(do_ds=False)
|
|
||||||
self._on_screen = True
|
|
||||||
else:
|
|
||||||
x_range, read_slc, mxmn = res
|
|
||||||
|
|
||||||
return mxmn
|
|
||||||
|
|
||||||
def get_viz(
|
def get_viz(
|
||||||
self,
|
self,
|
||||||
key: str,
|
key: str,
|
||||||
|
|
|
@ -21,7 +21,6 @@ this module ties together quote and computational (fsp) streams with
|
||||||
graphics update methods via our custom ``pyqtgraph`` charting api.
|
graphics update methods via our custom ``pyqtgraph`` charting api.
|
||||||
|
|
||||||
'''
|
'''
|
||||||
from functools import partial
|
|
||||||
import itertools
|
import itertools
|
||||||
from math import floor
|
from math import floor
|
||||||
import time
|
import time
|
||||||
|
@ -389,7 +388,6 @@ async def graphics_update_loop(
|
||||||
'fqsn': fqsn,
|
'fqsn': fqsn,
|
||||||
'godwidget': godwidget,
|
'godwidget': godwidget,
|
||||||
'quotes': {},
|
'quotes': {},
|
||||||
# 'maxmin': maxmin,
|
|
||||||
|
|
||||||
'flume': flume,
|
'flume': flume,
|
||||||
|
|
||||||
|
@ -1397,10 +1395,6 @@ async def display_symbol_data(
|
||||||
# for zoom-interaction purposes.
|
# for zoom-interaction purposes.
|
||||||
hist_viz.draw_last(array_key=fqsn)
|
hist_viz.draw_last(array_key=fqsn)
|
||||||
|
|
||||||
hist_pi.vb.maxmin = partial(
|
|
||||||
hist_chart.maxmin,
|
|
||||||
name=fqsn,
|
|
||||||
)
|
|
||||||
# TODO: we need a better API to do this..
|
# TODO: we need a better API to do this..
|
||||||
# specially store ref to shm for lookup in display loop
|
# specially store ref to shm for lookup in display loop
|
||||||
# since only a placeholder of `None` is entered in
|
# since only a placeholder of `None` is entered in
|
||||||
|
@ -1426,10 +1420,6 @@ async def display_symbol_data(
|
||||||
color=bg_chart_color,
|
color=bg_chart_color,
|
||||||
last_step_color=bg_last_bar_color,
|
last_step_color=bg_last_bar_color,
|
||||||
)
|
)
|
||||||
rt_pi.vb.maxmin = partial(
|
|
||||||
rt_chart.maxmin,
|
|
||||||
name=fqsn,
|
|
||||||
)
|
|
||||||
|
|
||||||
# TODO: we need a better API to do this..
|
# TODO: we need a better API to do this..
|
||||||
# specially store ref to shm for lookup in display loop
|
# specially store ref to shm for lookup in display loop
|
||||||
|
|
Loading…
Reference in New Issue