When only one curve is in view, skip group ranging

storage_cli
Tyler Goodlet 2023-01-22 15:48:56 -05:00
parent 59c2c8fa0d
commit 84b5a5f3d6
1 changed files with 22 additions and 6 deletions

View File

@ -915,7 +915,7 @@ class ChartView(ViewBox):
ms_threshold=4, ms_threshold=4,
# XXX: important to avoid not seeing underlying # XXX: important to avoid not seeing underlying
# ``.update_graphics_from_flow()`` nested profiling likely # ``Viz.update_graphics()`` nested profiling likely
# due to the way delaying works and garbage collection of # due to the way delaying works and garbage collection of
# the profiler in the delegated method calls. # the profiler in the delegated method calls.
delayed=True, delayed=True,
@ -957,7 +957,9 @@ class ChartView(ViewBox):
# pass in no array which will read and render from the last # pass in no array which will read and render from the last
# passed array (normally provided by the display loop.) # passed array (normally provided by the display loop.)
i_read_range, _ = viz.update_graphics() in_view, i_read_range, _ = viz.update_graphics()
if not in_view:
continue
profiler(f'{viz.name}@{chart_name} `Viz.update_graphics()`') profiler(f'{viz.name}@{chart_name} `Viz.update_graphics()`')
out = viz.maxmin(i_read_range=i_read_range) out = viz.maxmin(i_read_range=i_read_range)
@ -981,7 +983,11 @@ class ChartView(ViewBox):
else: else:
mxmns_by_common_pi[pi] = yrange mxmns_by_common_pi[pi] = yrange
if viz.is_ohlc: # TODO: a better predicate here, likely something
# to do with overlays and their settings..
if (
viz.is_ohlc
):
# print(f'adding {viz.name} to overlay') # print(f'adding {viz.name} to overlay')
mxmn_groups[viz.name] = out mxmn_groups[viz.name] = out
@ -997,9 +1003,19 @@ class ChartView(ViewBox):
if ( if (
len(mxmn_groups) < 2 len(mxmn_groups) < 2
): ):
viz.plot.vb._set_yrange( print(f'ONLY ranging major: {viz.name}')
yrange=yrange, for viz_name, out in mxmn_groups.items():
) (
ixrng,
read_slc,
yrange,
) = out
# determine start datum in view
viz = chart._vizs[viz_name]
viz.plot.vb._set_yrange(
yrange=yrange,
)
return return
# proportional group auto-scaling per overlay set. # proportional group auto-scaling per overlay set.