Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 725e908

Browse filesBrowse files
committed
webagg: Fix another too-early use of the WebSocket.
Because this is behind the asynchronous `ResizeObserver`, it does _not_ cause a failure to initialize the JavaScript figure, but is similar in error as the previous commit.
1 parent 30a900f commit 725e908
Copy full SHA for 725e908

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
  • lib/matplotlib/backends/web_backend/js
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎lib/matplotlib/backends/web_backend/js/mpl.js

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/web_backend/js/mpl.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ mpl.figure.prototype._init_canvas = function () {
224224
// And update the size in Python. We ignore the initial 0/0 size
225225
// that occurs as the element is placed into the DOM, which should
226226
// otherwise not happen due to the minimum size styling.
227-
if (width != 0 && height != 0) {
227+
if (fig.ws.readyState == 1 && width != 0 && height != 0) {
228228
fig.request_resize(width, height);
229229
}
230230
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.