- 
 
 - 
  Notifications
 
You must be signed in to change notification settings  - Fork 2.7k
 
Fix widget initialization issue in v6 #5102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
 
  Merged
 
 
 marthacryan
 merged 4 commits into
 plotly:main 
from
jescalada:ipywidgets-integration-fix 
 
 
 
  
 Mar 25, 2025 
 
 
 
  Merged
 
 Fix widget initialization issue in v6 #5102
 marthacryan
 merged 4 commits into
 plotly:main 
from
jescalada:ipywidgets-integration-fix 
 
 
 
  
 Mar 25, 2025 
 
 Conversation
 
 
 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
 
 
 
 
 Fix widgets not initializing properly when integrating with third-party libraries (such as `ipywidgets`)
 marthacryan
 
  
 
 
 marthacryan
 
 
 approved these changes
 
 
 Mar 25, 2025 
 
 
 
 
 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
 
 
 
 MichalRIcar
 
 
 
 commented
 May 13, 2025 
 
 
 
@jescalada , thank you for the prompt and great fix of the issue!
 
 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.
 
 
 
 
Uh oh!
There was an error while loading. Please reload this page.
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
Image
After fix
Image
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).