René's URL Explorer Experiment


Title: Add an anywidget backend by manzt · Pull Request #32633 · matplotlib/matplotlib · GitHub

Open Graph Title: Add an anywidget backend by manzt · Pull Request #32633 · matplotlib/matplotlib

X Title: Add an anywidget backend by manzt · Pull Request #32633 · matplotlib/matplotlib

Description: Today, several Python web tools maintain their own integration to display interactive Matplotlib figures. Many of those frameworks/tools already know how to display an anywidget. If Matplotlib provides the figure as an anywidget, they can share a backend. The goal of this PR is to use the same figure and callbacks in Jupyter, marimo, Google Colab, Shiny for Python, Panel, or any other anywidget host platform. The design is similar to ipympl, where the figure lives in Python, and when someone interacts with it, the browser sends an event to Python. If a callback changes the figure and draws the canvas, the browser displays the updated image. Browser Python |---- wheel position and delta ------->| scroll_event → figure callback |<--- updated image -------------------| canvas.draw() → Agg pixels ipympl implements the browser side with its own Jupyter Widget frontend, which only works in jupyter-based enviroments. Here we use jupyter_rfb, an anywidget that already captures input, sends it to Python, and displays frames as they become available. That leaves one Python module in Matplotlib that translates widget coordinates and events, sizes the canvas for the display, and supplies the Agg buffer when the widget requests a frame. class FigureWidget(RemoteFrameBuffer): def handle_event(self, event): ... # e.g. turn a wheel event into a Matplotlib MouseEvent def get_frame(self): ... # return the current Agg frame as an RGBA array The dependency is optional (matplotlib[widget]). I’ve tried the prototype in JupyterLab and marimo.

Open Graph Description: Today, several Python web tools maintain their own integration to display interactive Matplotlib figures. Many of those frameworks/tools already know how to display an anywidget. If Matplotlib prov...

X Description: Today, several Python web tools maintain their own integration to display interactive Matplotlib figures. Many of those frameworks/tools already know how to display an anywidget. If Matplotlib prov...

Opengraph URL: https://github.com/matplotlib/matplotlib/pull/32633

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:1b643eef-ff0c-0c96-f201-2f1a65e8a1c3
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id909A:3FD98D:FFB215:155F8D7:6B0656AA
html-safe-noncee4d0685a709635c3499763c11c34defc582a927ba17d00634ec3b30f61257aaa
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDlBOjNGRDk4RDpGRkIyMTU6MTU1RjhENzo2QjA2NTZBQSIsInZpc2l0b3JfaWQiOiIyNDUzMTUxOTQ1MzU2MzY3NTMxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacd9fe14dc0134c390febc5fbf5cb773a8715f97ed19143a343717eacb32fc63e1
hovercard-subject-tagpull_request:5429966063
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/32633/files
twitter:imagehttps://avatars.githubusercontent.com/u/24403730?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/24403730?s=400&v=4
og:image:altToday, several Python web tools maintain their own integration to display interactive Matplotlib figures. Many of those frameworks/tools already know how to display an anywidget. If Matplotlib prov...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None6324e6ac990fb6befbec840cc0e102a1071c339bfe8f9826bb12de2e3ba1d297
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git
octolytics-dimension-user_id215947
octolytics-dimension-user_loginmatplotlib
octolytics-dimension-repository_id1385122
octolytics-dimension-repository_nwomatplotlib/matplotlib
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1385122
octolytics-dimension-repository_network_root_nwomatplotlib/matplotlib
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7f0aa75f4141d440c6110dc31af7ea7797abb6c4
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/pull/32633/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fpull%2F32633%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fpull%2F32633%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/pull/32633/files
Reloadhttps://github.com/matplotlib/matplotlib/pull/32633/files
Reloadhttps://github.com/matplotlib/matplotlib/pull/32633/files
matplotlibhttps://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Codehttps://github.com/matplotlib/matplotlib
Issues1k (1k)https://github.com/matplotlib/matplotlib/issues
Pull requests430 (430)https://github.com/matplotlib/matplotlib/pulls
Actionshttps://github.com/matplotlib/matplotlib/actions
Projectshttps://github.com/matplotlib/matplotlib/projects
Wikihttps://github.com/matplotlib/matplotlib/wiki
Security and qualityhttps://github.com/matplotlib/matplotlib/security
Insightshttps://github.com/matplotlib/matplotlib/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fmatplotlib%2Fmatplotlib%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib%2Fissues%2Fnew%2Fchoose
manzthttps://github.com/manzt
matplotlib:mainhttps://github.com/matplotlib/matplotlib/tree/main
manzt:anywidget-backendhttps://github.com/manzt/matplotlib/tree/anywidget-backend
Conversation 4 https://github.com/matplotlib/matplotlib/pull/32633
Commits 16 https://github.com/matplotlib/matplotlib/pull/32633/commits
Checks 38 https://github.com/matplotlib/matplotlib/pull/32633/checks
Files changed https://github.com/matplotlib/matplotlib/pull/32633/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/32633/files
Add an anywidget backend https://github.com/matplotlib/matplotlib/pull/32633/files#top
Show all changes 16 commits https://github.com/matplotlib/matplotlib/pull/32633/files
d21793c Add `jupyter-rfb` to the `widget` extra manzt Nov 21, 2026 https://github.com/matplotlib/matplotlib/pull/32633/commits/d21793ce076e0d17cb723d2df30be19d51dc0557
8031dcb Include `backend_anywidget` in the Matplotlib build manzt Nov 21, 2026 https://github.com/matplotlib/matplotlib/pull/32633/commits/8031dcbbb3cd157f617688ad5254014ca7f829b6
6e3beb2 Display Agg figures with `jupyter_rfb` manzt Nov 21, 2026 https://github.com/matplotlib/matplotlib/pull/32633/commits/6e3beb2652058e057061d5b3182b498d43fbbf80
472c667 Forward pointer presses to Matplotlib manzt Nov 21, 2026 https://github.com/matplotlib/matplotlib/pull/32633/commits/472c6677eb8927c9d4059e4e69932f54991ae926
29c4d9b Forward pointer releases to Matplotlib manzt Nov 21, 2026 https://github.com/matplotlib/matplotlib/pull/32633/commits/29c4d9b26255f79bbbae8dc767d0509c4d378356
6fe2e8e Forward pointer motion to Matplotlib manzt Nov 21, 2026 https://github.com/matplotlib/matplotlib/pull/32633/commits/6fe2e8ee2dbfc654366bc79108ec3f89b429b9e9
76ae8f5 Forward double-clicks to Matplotlib manzt Nov 21, 2026 https://github.com/matplotlib/matplotlib/pull/32633/commits/76ae8f54e334e5d651153ef450a0a6cc57311952
d6b106a Forward wheel events to Matplotlib manzt Nov 21, 2026 https://github.com/matplotlib/matplotlib/pull/32633/commits/d6b106a26a853b1a0b12e8447815489fde2658c4
02c42f9 Notify Matplotlib when the pointer enters the figure manzt Nov 21, 2026 https://github.com/matplotlib/matplotlib/pull/32633/commits/02c42f940086d66f933cee77721fc4b4aec7a73b
63f6eb7 Notify Matplotlib when the pointer leaves the figure manzt Nov 21, 2026 https://github.com/matplotlib/matplotlib/pull/32633/commits/63f6eb7611c139fc2bb0824b5393a10030bbca6b
5460781 Forward key presses to Matplotlib manzt Nov 21, 2026 https://github.com/matplotlib/matplotlib/pull/32633/commits/5460781a8e21c38962886241c94ead98069036b8
9c30497 Forward key releases to Matplotlib manzt Nov 21, 2026 https://github.com/matplotlib/matplotlib/pull/32633/commits/9c30497fc7a47d491b8644aebf666b49c141a101
944f171 Resize the figure when the widget resizes manzt Nov 21, 2026 https://github.com/matplotlib/matplotlib/pull/32633/commits/944f1710d297d1343c7bdba6abc1deb47dbf58b2
70dfbc4 Notify Matplotlib when the figure closes manzt Nov 21, 2026 https://github.com/matplotlib/matplotlib/pull/32633/commits/70dfbc45cd6a92edf0894776f58ab10c3ef6b277
8500c6f Update the widget when the canvas draws manzt Nov 21, 2026 https://github.com/matplotlib/matplotlib/pull/32633/commits/8500c6f0d445208c897a9e185926166aebee4802
0ef8365 Test that scrolling updates the widget frame manzt Nov 21, 2026 https://github.com/matplotlib/matplotlib/pull/32633/commits/0ef8365a4028145f83c9fc53e2e53ca09320b6d6
Clear filters https://github.com/matplotlib/matplotlib/pull/32633/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/32633/files
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/32633/files
backend_anywidget.py https://github.com/matplotlib/matplotlib/pull/32633/files#diff-b82afe9dba5ccd2e3c8e36243012de4037e416786190b98582dd1563f5473700
meson.build https://github.com/matplotlib/matplotlib/pull/32633/files#diff-88caa42ce425d3b516b26086a99bb1493b74e1d20d78a66fc078e7593f127a4e
meson.build https://github.com/matplotlib/matplotlib/pull/32633/files#diff-cef06ba01f600f54880431ec7df20224edaed91a8eb8aa9f2113a30b33664c6e
test_backend_anywidget.py https://github.com/matplotlib/matplotlib/pull/32633/files#diff-16ef1d8bae951eae493939285bd07508b91205e558ce6bf4a77c0854b1ffad61
pyproject.toml https://github.com/matplotlib/matplotlib/pull/32633/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711
lib/matplotlib/backends/backend_anywidget.pyhttps://github.com/matplotlib/matplotlib/pull/32633/files#diff-b82afe9dba5ccd2e3c8e36243012de4037e416786190b98582dd1563f5473700
View file https://github.com/matplotlib/matplotlib/blob/0ef8365a4028145f83c9fc53e2e53ca09320b6d6/lib/matplotlib/backends/backend_anywidget.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/32633/{{ revealButtonHref }}
lib/matplotlib/backends/meson.buildhttps://github.com/matplotlib/matplotlib/pull/32633/files#diff-88caa42ce425d3b516b26086a99bb1493b74e1d20d78a66fc078e7593f127a4e
View file https://github.com/matplotlib/matplotlib/blob/0ef8365a4028145f83c9fc53e2e53ca09320b6d6/lib/matplotlib/backends/meson.build
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/32633/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/32633/files#diff-88caa42ce425d3b516b26086a99bb1493b74e1d20d78a66fc078e7593f127a4e
lib/matplotlib/tests/meson.buildhttps://github.com/matplotlib/matplotlib/pull/32633/files#diff-cef06ba01f600f54880431ec7df20224edaed91a8eb8aa9f2113a30b33664c6e
View file https://github.com/matplotlib/matplotlib/blob/0ef8365a4028145f83c9fc53e2e53ca09320b6d6/lib/matplotlib/tests/meson.build
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/32633/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/32633/files#diff-cef06ba01f600f54880431ec7df20224edaed91a8eb8aa9f2113a30b33664c6e
https://github.com/matplotlib/matplotlib/pull/32633/files#diff-cef06ba01f600f54880431ec7df20224edaed91a8eb8aa9f2113a30b33664c6e
lib/matplotlib/tests/test_backend_anywidget.pyhttps://github.com/matplotlib/matplotlib/pull/32633/files#diff-16ef1d8bae951eae493939285bd07508b91205e558ce6bf4a77c0854b1ffad61
View file https://github.com/matplotlib/matplotlib/blob/0ef8365a4028145f83c9fc53e2e53ca09320b6d6/lib/matplotlib/tests/test_backend_anywidget.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/32633/{{ revealButtonHref }}
pyproject.tomlhttps://github.com/matplotlib/matplotlib/pull/32633/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711
View file https://github.com/matplotlib/matplotlib/blob/0ef8365a4028145f83c9fc53e2e53ca09320b6d6/pyproject.toml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/matplotlib/matplotlib/pull/32633/{{ revealButtonHref }}
https://github.com/matplotlib/matplotlib/pull/32633/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711
https://github.com/matplotlib/matplotlib/pull/32633/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711
Please reload this pagehttps://github.com/matplotlib/matplotlib/pull/32633/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.