Skip to content

fix: avoid 5s timeout when revealing plotly widgets#240

Merged
cpsievert merged 1 commit into
mainfrom
fix/plotly-render-perf-239
May 6, 2026
Merged

fix: avoid 5s timeout when revealing plotly widgets#240
cpsievert merged 1 commit into
mainfrom
fix/plotly-render-perf-239

Conversation

@cpsievert
Copy link
Copy Markdown
Collaborator

Summary

  • Fixes Significant performance degradation for plotly in 0.8.0 #239 — significant performance degradation for plotly in 0.8.0
  • The waitForPlotlyAfterPlot listener was attaching after Plotly had already emitted plotly_afterplot, causing every plotly widget to hit the 5-second fallback timeout before becoming visible
  • Now checks plotEl._fullLayout to detect that Plotly already completed its render, resolving immediately instead of waiting

Test plan

  • Playwright plotly tests pass (test_example_plotly_afterplot_stable, test_plotly_rerender_cleanup)
  • Verified with the reporter's example app — both charts render in ~30ms instead of 5+ seconds
  • Manual smoke test: plotly widget in a filling layout still avoids the initial "jump" that fix: Plotly jump on rerender in filling layouts #236 fixed

waitForPlotlyAfterPlot listened for the plotly_afterplot event, but by
the time the listener attached, Plotly had typically already fired it.
This caused every plotly widget to hit the 5-second fallback timeout
before becoming visible.

Check plotEl._fullLayout to detect that Plotly already completed its
render and resolve immediately, skipping the wait.
@cpsievert cpsievert merged commit d8f43f7 into main May 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Significant performance degradation for plotly in 0.8.0

1 participant