Repository navigation
Improve Drawer layout overrides and responsive defaults - #183
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #183 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 440 440
Lines 39316 39331 +15
=========================================
+ Hits 39316 39331 +15
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
11 tasks done
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.
Description
Allow per-figure layout overrides in
Drawer.get(), includingtitle, without changing constructor defaults, caller dictionaries, or earlier figures. Single and split views now default to responsive width (width=None,autosize=True) with an 800-pixel height. Explicit dimensions and margin edges take precedence.Reserve top space for nonempty figure and split-panel titles. Copy supplied layouts in
dual_figure3d()and preserve their dimensions and margins unless explicitly overridden. Keep renderer-neutral split views consistent, honor per-figure geometry themes, and document figure titles, panel titles, and axis titles.Motivation and Context
Previously,
Drawer.get()only used constructor layout options, and the split helper overwrote supplied sizes and margins while mutating its input layout. These defaults made figures harder to embed in notebooks and websites. The MyST toolbar CSS fix remains outside SPINE.Type of Change
How Has This Been Tested?
python -m pytest test/test_vis/test_layout/test_layout.py test/test_vis/test_drawer/test_out.py test/test_vis/test_scene/test_scene.py: 74 passed.python -m pytest test/test_vis): 193 passed, one existing filesystem-permission assertion failure intest_report_hashes_string_checkpoint_metadata. The same failure reproduces on an untouched export of the base commit.Test configuration: macOS, Python 3.13.2, Plotly 6.4.0; base commit
e7ae226a.Checklist
Additional Notes
Browser resize verification was unavailable because no browser was connected. Layout assertions cover responsive configuration. Default sizing changes are intentional; callers requiring fixed widths can continue to supply them explicitly.