Skip to content

Replace react-plotly.js with vendored Plot component#8238

Merged
mscolnick merged 2 commits intomarimo-team:mainfrom
nojaf:remove-react-plotly
Feb 9, 2026
Merged

Replace react-plotly.js with vendored Plot component#8238
mscolnick merged 2 commits intomarimo-team:mainfrom
nojaf:remove-react-plotly

Conversation

@nojaf
Copy link
Contributor

@nojaf nojaf commented Feb 9, 2026

📝 Summary

I hope to resolve the Heatmap click problem by updating Plotly.js
As a first step, I want to get rid of react-plotly as it is small and has not been updated for years.

🔍 Description of Changes

Drop the react-plotly.js dependency and its patch file in favor of a
lightweight functional component that wraps Plotly.js directly.

  • Add Plot.tsx: ~100 lines using useRef/useEffect instead of a class component
  • Include TreemapClick event natively (no longer needs a patch)
  • Remove react-plotly.js, @types/react-plotly.js, and the pnpm patch
  • Add @types/plotly.js as a direct dev dependency
  • Add explicit import type * as Plotly where the namespace was previously
    provided globally by @types/react-plotly.js

📋 Checklist

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Tests have been added for the changes made.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Pull request title is a good summary of the changes - it will be used in the release notes.
@vercel
Copy link

vercel bot commented Feb 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Feb 9, 2026 2:07pm

Request Review

polyfill

The source entry point of plotly.js requires Node.js polyfills (buffer/)
that are unavailable in the browser bundler. Import from
plotly.js/dist/plotly
instead, matching what react-plotly.js used internally.
@mscolnick mscolnick merged commit 19ace69 into marimo-team:main Feb 9, 2026
28 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants