Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: MultiAxisViewBox resizing breaks in certain cases #1070

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

jbellister-slac
Copy link
Collaborator

Context

As a follow up to #1069 there are cases in which depending on how the user initializes their plot the main view box on it can get stuck in a loop in which it will continue increasing in size. As a fun example try running pydm/examples/scatterplot/scatterplot.ui using pyqtgraph 0.13.4 without this fix

This is due to pyqtgraph/pyqtgraph#2762

The bounding rect of a ViewBox now adjusts itself before returning, so connecting the sigResized signal of a ViewBox to a function which changes its own size results in an endless loop of it resizing itself.

There are more robust ways to solve this on our end, but this is the most fragile area of our code base which I hope to eventually replace with a built-in pyqtgraph solution to multi-axis plots if one of the PRs there gets merged. So for now the simplest seems best.

Testing

Verified that all example plots work correctly with both pyqtgraph 0.13.3 and 0.13.4.

…to avoid an endless loop of multiple ViewBoxes increasing in size
Copy link
Collaborator

@YektaY YektaY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

@YektaY YektaY merged commit 56f94b4 into slaclab:master Apr 10, 2024
16 of 19 checks passed
@jbellister-slac jbellister-slac deleted the fix_plots branch April 10, 2024 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants