Fix widget initialization issue in v6#5102
Merged
marthacryan merged 4 commits intoplotly:mainfrom Mar 25, 2025
Merged
Conversation
Fix widgets not initializing properly when integrating with third-party libraries (such as `ipywidgets`)
marthacryan
approved these changes
Mar 25, 2025
Collaborator
marthacryan
left a comment
There was a problem hiding this comment.
Thank you for tracking this down! Tested with the reproducible example in the issue and it is now working for me with your changes. This looks like a great change and thank you for adding tests.
|
@jescalada , thank you for the prompt and great fix of the issue! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a problem with widgets not initializing properly when integrating with third-party libraries (such as
ipywidgets) in v6.0.0: #4998It seems that some of the changes in #4956 modified variable names used to load the widget's layout and data.
Let me know if adding test cases for this is required (I believe it'd be hard to test since it relies on other libraries).Edit: Added basic tests just in case!
Thank you!
Before fix
After fix
Please uncomment this block and take a look at this checklist if your PR is making substantial changes to documentation/impacts files in the
docdirectory. Check all that apply to your PR, and leave the rest unchecked to discuss with your reviewer! Not all boxes must be checked for every PR :)If your PR modifies code of the
plotlypackage, we have a different checklistbelow :-).
Documentation PR
doc/README.mdfiledoc-prodbranch OR it targets themainbranchpxexample if at all possibleplotly.graph_objects as go/plotly.express as px/plotly.io as piodffig = <something>call is high up in each new/modified example (eitherpx.<something>ormake_subplotsorgo.Figure)fig.add_*andfig.update_*rather thango.Figure(data=..., layout=...)in every new/modified examplefig.add_shapeandfig.update_xaxesare used instead of bigfig.update_layoutcalls in every new/modified examplefig.show()is at the end of each new/modified exampleplotly.plot()andplotly.iplot()are not used in any new/modified exampleCode PR
plotly.graph_objects, my modifications concern thecodegenfiles and not generated files.modified existing tests.
new tutorial notebook (please see the doc checklist as well).