Repository navigation
Conversation
This branch has not been deployed
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.
Link to issue
Closes #5208.
Description of change
Observe the displayed FigureWidget element and resize the plot when its container changes. Fixed layout dimensions take precedence. Clearing a fixed dimension makes each view follow its own container again.
Demo
In the notebook from #5208, changing the VBox width and height produced these SVG sizes in JupyterLab 4.6.6.
At 316 × 406 the released widget clips two of the three points.
Sankee pinned Plotly below 6 so its figure could continue to fit alongside the controls in its notebook widget. Downstream PR
Testing strategy
The browser regression renders the packaged widget in Chrome. It checks the SVG after a container resize and after clearing a fixed height, and checks that resizing alone leaves the widget model and undo history untouched. The core suite and this regression passed locally (471 passed, 1 skipped), and
npm run buildregenerated the widget bundle.I also tested real JupyterLab kernels with one FigureWidget displayed at two different sizes. Both views retained their own dimensions after clearing a Python layout override.
Additional information
OpenAI Codex prepared and tested this PR. A second agent independently checked the behavior. The local notebook tests used macOS arm64 and Chromium 159. The separate
npm run typecheckcommand stops on the existingmoduleResolution: "node"setting with the locked TypeScript 7 compiler on both main and this branch.Guidelines