Remove `._set_yrange()` handler from x-range-change signal

incremental_update_paths
Tyler Goodlet 2022-04-21 15:47:24 -04:00
parent df78e9ba96
commit 2af4050e5e
1 changed files with 31 additions and 25 deletions

View File

@ -492,7 +492,10 @@ class ChartView(ViewBox):
log.debug("Max zoom bruh...") log.debug("Max zoom bruh...")
return return
# if ev.delta() < 0 and vl >= len(chart._flows[chart.name].shm.array) + 666: # if (
# ev.delta() < 0
# and vl >= len(chart._flows[chart.name].shm.array) + 666
# ):
# log.debug("Min zoom bruh...") # log.debug("Min zoom bruh...")
# return # return
@ -748,6 +751,7 @@ class ChartView(ViewBox):
''' '''
profiler = pg.debug.Profiler( profiler = pg.debug.Profiler(
msg=f'`ChartView._set_yrange()`: `{self.name}`',
disabled=not pg_profile_enabled(), disabled=not pg_profile_enabled(),
gt=ms_slower_then, gt=ms_slower_then,
delayed=True, delayed=True,
@ -815,6 +819,7 @@ class ChartView(ViewBox):
if yrange is None: if yrange is None:
log.warning(f'No yrange provided for {self.name}!?') log.warning(f'No yrange provided for {self.name}!?')
print(f"WTF NO YRANGE {self.name}")
return return
ylow, yhigh = yrange ylow, yhigh = yrange
@ -851,11 +856,6 @@ class ChartView(ViewBox):
if src_vb is None: if src_vb is None:
src_vb = self src_vb = self
# such that when a linked chart changes its range
# this local view is also automatically changed and
# resized to data.
src_vb.sigXRangeChanged.connect(self._set_yrange)
# splitter(s) resizing # splitter(s) resizing
src_vb.sigResized.connect(self._set_yrange) src_vb.sigResized.connect(self._set_yrange)
@ -876,11 +876,6 @@ class ChartView(ViewBox):
self, self,
) -> None: ) -> None:
# self._chart._static_yrange = 'axis'
self.sigXRangeChanged.disconnect(
self._set_yrange,
)
self.sigResized.disconnect( self.sigResized.disconnect(
self._set_yrange, self._set_yrange,
) )
@ -911,18 +906,20 @@ class ChartView(ViewBox):
def maybe_downsample_graphics(self): def maybe_downsample_graphics(self):
profiler = pg.debug.Profiler(
disabled=not pg_profile_enabled(),
gt=3,
)
uppx = self.x_uppx() uppx = self.x_uppx()
if not ( if not (
# we probably want to drop this once we are "drawing in # we probably want to drop this once we are "drawing in
# view" for downsampled flows.. # view" for downsampled flows..
uppx and uppx > 16 uppx and uppx > 6
and self._ic is not None and self._ic is not None
): ):
profiler = pg.debug.Profiler(
msg=f'ChartView.maybe_downsample_graphics() for {self.name}',
disabled=not pg_profile_enabled(),
# delayed=True,
gt=3,
# gt=ms_slower_then,
)
# TODO: a faster single-loop-iterator way of doing this XD # TODO: a faster single-loop-iterator way of doing this XD
chart = self._chart chart = self._chart
@ -931,7 +928,12 @@ class ChartView(ViewBox):
for chart_name, chart in plots.items(): for chart_name, chart in plots.items():
for name, flow in chart._flows.items(): for name, flow in chart._flows.items():
if not flow.render: if (
not flow.render
# XXX: super important to be aware of this.
# or not flow.graphics.isVisible()
):
continue continue
graphics = flow.graphics graphics = flow.graphics
@ -947,13 +949,17 @@ class ChartView(ViewBox):
use_vr=use_vr, use_vr=use_vr,
# gets passed down into graphics obj # gets passed down into graphics obj
profiler=profiler, # profiler=profiler,
) )
profiler(f'range change updated {chart_name}:{name}') profiler(f'range change updated {chart_name}:{name}')
else:
# don't bother updating since we're zoomed out bigly and profiler.finish()
# in a pan-interaction, in which case we shouldn't be # else:
# doing view-range based rendering (at least not yet). # # don't bother updating since we're zoomed out bigly and
# print(f'{uppx} exiting early!') # # in a pan-interaction, in which case we shouldn't be
profiler(f'dowsampling skipped - not in uppx range {uppx} <= 16') # # doing view-range based rendering (at least not yet).
# # print(f'{uppx} exiting early!')
# profiler(f'dowsampling skipped - not in uppx range {uppx} <= 16')
# profiler.finish()