Skip to content

vjust arg for gridify Object#18

Draft
Polkas wants to merge 9 commits into
mainfrom
topjust
Draft

vjust arg for gridify Object#18
Polkas wants to merge 9 commits into
mainfrom
topjust

Conversation

@Polkas
Copy link
Copy Markdown
Collaborator

@Polkas Polkas commented May 10, 2026

Adds a vjust slot to gridifyObject() so users can vertically anchor the rendered object inside its layout row (e.g. vjust = 1 pins a gt/flextable to the top of a taller row instead of stretching it).

New vjust argument on gridifyObject() (default 0.5; fully backwards-compatible).
print() now sizes the object's viewport to grobHeight() for fixed-size grobs when vjust != 0.5, floored at 1 inch via grid::unit.pmax(). Flexible grobs (ggplotGrob-style gtables with null heights, recorded gTrees with childrenvp) keep the historical "fill the row" behaviour.
Detection & expression building factored into is_flexible_grob() and object_viewport_height_expr() in gridify-utils.R, with unit tests.
S4 validity rejects NA, NaN, ±Inf, non-scalar and out-of-range values.
Roxygen on vjust / object_vjust (in simple_layout(), complex_layout(), pharma_layout_*) makes the flexible-grob caveat explicit; show_spec() annotates the Vjust line accordingly.
No changes for users who don't set vjust.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.68%. Comparing base (45855f1) to head (b32ca4b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #18      +/-   ##
==========================================
+ Coverage   99.56%   99.68%   +0.12%     
==========================================
  Files           9        9              
  Lines         919      953      +34     
==========================================
+ Hits          915      950      +35     
+ Misses          4        3       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants