Skip to content

Backport PR #19131 on branch v3.3.x (Fix WebAgg initialization) #19143

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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lib/matplotlib/backends/web_backend/js/mpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,6 @@ mpl.figure.prototype._init_canvas = function () {
1;

this.ratio = (window.devicePixelRatio || 1) / backingStore;
if (this.ratio !== 1) {
fig.send_message('set_dpi_ratio', { dpi_ratio: this.ratio });
}

var rubberband_canvas = (this.rubberband_canvas = document.createElement(
'canvas'
Expand Down Expand Up @@ -227,7 +224,7 @@ mpl.figure.prototype._init_canvas = function () {
// And update the size in Python. We ignore the initial 0/0 size
// that occurs as the element is placed into the DOM, which should
// otherwise not happen due to the minimum size styling.
if (width != 0 && height != 0) {
if (fig.ws.readyState == 1 && width != 0 && height != 0) {
fig.request_resize(width, height);
}
}
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy