Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Simplify embedding webagg example now that WebSocket is widely supported - #32348

Open
takluyver wants to merge 2 commits into
matplotlib:mainfrom
takluyver:patch-2
Open

Simplify embedding webagg example now that WebSocket is widely supported#32348
takluyver wants to merge 2 commits into
matplotlib:mainfrom
takluyver:patch-2

Conversation

@takluyver

Copy link
Copy Markdown
Contributor

PR summary

All major browsers have supported websockets for over a decade; at this point I think examples should use it directly without a compatibility wrapper.

Perhaps a bit more controversial, websockets can use relative URLs since about 2024, which avoids the need to template the hostname into the HTML. I think it makes sense to simplify this, since keeping browsers up to date is both good advice and the default, not many people are likely to be using a two-year-old browser.

AI Disclosure

I have not used any AI.

PR quality check

  • Use an expressive title, e.g. "Fix title font property precedence"
  • [N/A] New and changed code is tested -- I have run the example manually with these changes
  • [N/A] Plotting related features are demonstrated in an example
  • [N/A] New features and API changes have release notes
  • [N/A] Documentation complies with general and docstring guidelines

@github-actions github-actions Bot added the Documentation: examples files in galleries/examples label Sep 12, 2026
@iccir

iccir commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Relevant discussion: #32165

@takluyver

Copy link
Copy Markdown
Contributor Author

That sounds like people are converging on a policy to support browser versions going back 5 years, which would seemingly exclude the websocket relative URL part, but allow using WebSocket() directly.

I think there's a case that an example can assume newer browser versions than code shipped in matplotlib itself, and leave compatibility up to the developer using the example. But I'm not going to argue with this - if you'd like me to revert the relative URL part, just let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation: examples files in galleries/examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants