GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — move viewport rect logic from subplot and docks to Figure by kushalkolar · Pull Request #724 · fastplotlib/fastplotlib

Conversation

@kushalkolar

@kushalkolar kushalkolar commented Feb 10, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

All reactions
kushalkolar added 2 commits February 10, 2025 03:20
@kushalkolar
move viewport rect logic from subplot and docks to Figure
b96417d
@kushalkolar
progress
6c53af6
@kushalkolar

kushalkolar commented Feb 10, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kushalkolar added 8 commits February 11, 2025 02:56
@kushalkolar
refactored rect code works well
d620d56
@kushalkolar
add tests for viewport rects
372ca7c
@kushalkolar
figure refactor works, tested backend and passes
8aaa06a
@kushalkolar
cleanup iw
cf0c470
@kushalkolar
update tests
54b0a7d
@kushalkolar
update right click menu
269ae86
@kushalkolar
update imgui figure
2432156
@kushalkolar
add gridplot viewport rect verification screenshots
7b8f5c4
@kushalkolar
kushalkolar marked this pull request as ready for review February 13, 2025 06:19
@kushalkolar
kushalkolar requested a review from clewis7 as a code owner February 13, 2025 06:19
@kushalkolar

kushalkolar commented Feb 13, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

@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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kushalkolar added 4 commits February 13, 2025 01:22
@kushalkolar
black complains
b5157be
@kushalkolar
remove cell
e5a1fac
@kushalkolar
update docs
e71ddcf
@kushalkolar
include OS in screenshot diff artifacts filename
e3ffa65
clewis7
clewis7 requested changes Feb 16, 2025
View reviewed changes
Comment thread fastplotlib/layouts/_figure.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread fastplotlib/layouts/_figure.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread fastplotlib/layouts/_figure.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread fastplotlib/layouts/_figure.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread fastplotlib/layouts/_figure.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread fastplotlib/layouts/_figure.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

kushalkolar added 4 commits February 20, 2025 00:32
@kushalkolar
comments
346543b
@kushalkolar
modify nb test, should work again now
465ea74
@kushalkolar
try to make first render look right on github actions
fe794a4
@kushalkolar
update last groundtruth screenshot
d6f72d1
@kushalkolar

kushalkolar commented Feb 20, 2025

Copy link
Copy Markdown
Member Author

all relevant tests passing now except the docs build but you fixed that in another PR so this is good for another look!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

clewis7
clewis7 approved these changes Feb 21, 2025
View reviewed changes

@clewis7 clewis7 left a comment

Copy link
Copy Markdown
Member

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.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@clewis7
clewis7 merged commit cf5b11b into main Feb 21, 2025
@clewis7
clewis7 deleted the subplot-docking branch February 21, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@clewis7 clewis7 clewis7 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

2 participants

@kushalkolar @clewis7
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.