Skip to content

webagg: Don't resize canvas if WebSocket isn't connected #27251

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

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Nov 2, 2023

PR summary

When opening embedding_webagg_sgskip.py in Firefox, the empty canvas slowly increases in height until the figure first comes through. Skipping the canvas resize until the WebSocket connects prevents this unnecessary canvas change.

  • If it is still connecting, then we will get an initial resize from Python once it connects.
  • If it has disconnected, then resizing will clear the canvas and never get anything back to refill it, so better to not resize and keep something visible.

PR checklist

- If it is still connecting, then we will get an initial resize from
  Python once it connects.
- If it has disconnected, then resizing will clear the canvas and never
  get anything back to refill it, so better to not resize and keep
  something visible.
@ksunden ksunden added this to the v3.9.0 milestone Nov 2, 2023
@ksunden ksunden merged commit a3b2576 into matplotlib:main Nov 2, 2023
@QuLogic QuLogic deleted the webagg-resize branch November 2, 2023 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants