Open goodboy opened 2 years ago
Soo turns out I already solved most of this without doing a writeup ๐ธ
The slew of commits are here: https://github.com/pikers/piker/commits/534f96e8d7824d1e56c08705e713e136ed1ef69a/piker/ui/_interaction.py and more or less starting @ https://github.com/pikers/piker/commit/1782bb7d22fbbde548bb78822f7e78b47de14136.
Likely this change set will get factored into a more compact PR so i'll follow up if and when.
Yeah, mostly resolved in the work from #453 and #455 ๐ฅณ
Pretty sure #455 fill finish off the rest of this since we will be entirely bypassing the whole Signal
junk after that lands ๐๐ผ
Qt
has messy stuff like "signals and slots" which actually provide not much benefit when used from python (since calling python from C++ doesn't often ๐) which we originally used to fall in line with the default architecture ofpyqtgraph
'sViewBox
.Trying to understand how all these signals and slots fit together is a nightmare even for me who's hacked pretty hard on the core of it all and I still get confused every time i come back to the code responsible even with the recent major refactoring to our
Flow
s abstraction layer..This was overall a major annoyance and source of misunderstanding in recent work for solving y-range sorting performance enhancements in #342.
So what do we do to start addressing this?
high level breakdown.. of the mess
to begin groking these are notable bits in the code base to know about:
ChartView._set_yrange()
is triggered by interactions with any view: basicallyQt
's graphics scene parlance for some multi-"canvas" window into a backing data set domain.PlotItem
via ourPlotItemOverlay
and thus despite having a view "in focus" often we need to figure out the y-range of all overlayed (eg. in the case of FSPs with a common y-range domain) time series, what we callFlow
's to ack the real-time bits, and thus we have to consider updating such overlays in our main interaction callback:.maybe_downsample_graphics()
.set_yrange()
in turn calls intoChartView._maxmin()
, a custom callback which we by default make delegate to a similar method on the containingChartPlotWidget.maxmin()
, andFlow.maxmin()
for the named, contained target flow which in turn does all the hard work of computing and caching max/mins..How this works going forward: TODO: fill this out!
Signal
handlers to update every individual view box, instead we have a single handler which iterates all overlays and linked charts (with caveats)