Ensure that patched Plotly Figure does not break pane - #8397
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Plotly pane’s figure-linking logic so that it cooperates with Plotly figures that already define internal _send_* callback stubs, addressing holoviews/holoviews#6788.
Changes:
- Refactors
_update_figureto work directly withself.objectasfigand to early-return forNone,dictobjects, unchanged figures, or whenlink_figureisFalse. - Switches the monkey-patching of Plotly
Figure/FigureWidgetmessage stubs (_send_addTraces_msg,_send_deleteTraces_msg, etc.) to only assign them if the attributes are not already present, avoiding overwriting existing implementations. - Removes the explicit dependency on
plotly.graph_objsin_update_figure, relying instead on structural checks (viahasattr) rather than concrete Plotly types.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8397 +/- ##
==========================================
- Coverage 86.08% 85.45% -0.64%
==========================================
Files 349 349
Lines 54835 54821 -14
==========================================
- Hits 47205 46845 -360
- Misses 7630 7976 +346 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes holoviz/holoviews#6788