Skip to content

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

Merged
ksunden merged 1 commit intomatplotlib:mainfrom
QuLogic:webagg-resize
Nov 2, 2023
Merged

webagg: Don't resize canvas if WebSocket isn't connected#27251
ksunden merged 1 commit intomatplotlib:mainfrom
QuLogic:webagg-resize

Conversation

@QuLogic
Copy link
Copy Markdown
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