piker
piker copied to clipboard
Add y-scroll
Would be nice to have a y-scrolling function on the charts. y-zoom works well :)
@iamzoltan indeed that was part of my comment before merging #136.
If you want to take a look at it we'll probably need to add a minor mode to the view somehow. I've been meaning to do this for a while but just trying to get other machinery / subsystems in place. I'll probably write up a more general issue / feature request for that.
In terms of y-scroll we basically need to enable some flag that says we're in y-scroll mode after a user zooms on the y-axis? The UX of it i'm not entirely sure on yet.
Currently the reason for the locked pan on the y-axis is due to these handlers which basically always size the view to the data unless a static y-range is set on the chart. This is probably not the right place to keep this state or this handler (it was based on code from another project).
We should probably move this handler onto the pyqtgraph.ViewBox sub-type we have internally and wrap it as part of a "view mode" type so that we can start moving towards APIs for different viewing modes in general. As an example once a user pans off the current data the mode should switch to a "history mode" where the view is not constantly being incremented on every time step.
Lots to do here - help appreciated!
So it turns out waiting on this has paid off yet again 😂
I recently added some experimental work in https://github.com/pyqtgraph/pyqtgraph/pull/2162 which will get us y-scroll by default and for free on mult-axis charts 🏄🏼
There are still some reversion/tweaks needed but I'm in the middle of it.