GeezerVison is showing github.com — move viewport rect logic from subplot and docks to Figure by kushalkolar · Pull Request #724 · fastplotlib/fastplotlib
Conversation
kushalkolar
commented
Feb 10, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
First step towards #315 and #670
Things will change once pygfx refactors their viewport stuff, but I think it will be easier to adopt those changes after this PR since it makes Figure manage the bbox of all subplots. I think this is a good separation of responsibilities. After this PR arbitrary bboxes for subplots can be implemented.
- move the subplot viewport rect and subplot docks viewport rect calculating logic to
Figure.
- clean up the logic for computing the rects, much easier to read now, @clewis7 will be happy 😆
-
Figure._render() and PlotArea._render() are now private, been meaning to do this for a long while.
- flatten
cameras, controllers arrays in Figure to prep things for a flexible rectangles mode.
- make sure all tests pass with this, adjust the tests if necessary. Users have a lot of options here and the parsing code is kinda gnarly.
- prepare
Figure for flex rects mode by allowing Figure._subplots to be a 1D object array, figure methods have been adjusted accordingly.
-
Figure.spacing is a new property which allows setting the spacing between subplots, default is 2 pixels
- add new screenshot test for gridplot with all subplot docks of a certain size, and an
ImageWidget with all docks set to a certain size.
- adjust imgui toolbar code accordingly
Introduces one minor breaking API change, Subplot.position no longer exists but it's unlikely anyone was using that.
Todo in future PR:
- implement flexible resizable rectangle subplots
- make a separte plot area specifically for subplot titles, remove top subplot "dock" so users have less control over it. It should be solely for subplot title text.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
kushalkolar
commented
Feb 10, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
biggest issue right now is when resizing, I think the canvas resizes a while before the new rect sizes are ready which causes wgpu draw errors this is Qt specific: pygfx/rendercanvas#56
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
kushalkolar
commented
Feb 13, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
@clewis7 ready for review! Any ubuntu tests won't pass on github actions due to pygfx/pygfx#979 but the mac tests should all pass (except for pygfx-release, the ones using pygfx@main should pass)
also tests are all passing locally
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
all relevant tests passing now except the docs build but you fixed that in another PR so this is good for another look!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
clewis7
clewis7 approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|