Skip to content

Improve Drawer layout overrides and responsive defaults - #183

Merged
francois-drielsma merged 1 commit into
mainfrom
feature/drawer-layout-defaults
Oct 22, 2026
Merged

francois-drielsma merged 1 commit into
mainfrom
feature/drawer-layout-defaults

Conversation

@francois-drielsma

Copy link
Copy Markdown
Member

Description

Allow per-figure layout overrides in Drawer.get(), including title, 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

  • Bug fix
  • New feature
  • Documentation update

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.
  • Full visualization suite (python -m pytest test/test_vis): 193 passed, one existing filesystem-permission assertion failure in test_report_hashes_string_checkpoint_metadata. The same failure reproduces on an untouched export of the base commit.
  • Commit hooks passed, including Black, isort, Flake8, whitespace, and conflict-marker checks.

Test configuration: macOS, Python 3.13.2, Plotly 6.4.0; base commit e7ae226a.

Checklist

  • Code follows project style and has been self-reviewed.
  • Relevant docstrings, inline comments, and documentation are updated.
  • Regression tests cover title forms, responsive sizing, explicit dimensions/margins, input-layout preservation, and repeated calls with different overrides.
  • All unit tests pass locally: the pre-existing permission failure described above remains.

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.

@codecov

codecov Bot commented Oct 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e7ae226) to head (38f19f9).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #183   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          440       440           
  Lines        39316     39331   +15     
=========================================
+ Hits         39316     39331   +15     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/spine/vis/drawer/out/drawer.py 100.00% <100.00%> (ø)
src/spine/vis/layout/plotly.py 100.00% <100.00%> (ø)
src/spine/vis/scene/plotly.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@francois-drielsma
francois-drielsma merged commit ebd8ae8 into main Oct 22, 2026
19 checks passed
@francois-drielsma francois-drielsma mentioned this pull request Oct 22, 2026
11 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant