Repository navigation
[fix] Fix table dimension-calculating process and tests - #621
Merged
Merged
Conversation
Contributor
Code Metrics Report
Code coverage of files in pull request scope (55.6%, patch 75.0%)
Reported by octocov |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The width calculation counts hidden columns, which can misclassify portrait-sized tables as extra-wide and cause unnecessary splitting in the generated document.
1 open issue
What changed in this PR
This PR corrects table dimension calculations in asar’s document-generation workflow, addressing the landings-table issues reported during the workshop.
Changes:
- Calculate table width and length from the
gtobject’s underlying data. - Use row counts when determining how many table sections to generate.
- Update dimension-test fixtures to retain complete
gtobjects.
| File | Description |
|---|---|
| tests/testthat/test-ID_tbl_width_class.R | Use complete gt objects in width-test fixtures. |
| tests/testthat/test-ID_tbl_length_class.R | Use complete gt objects in length-test fixtures. |
| R/ID_tbl_width_class.R | Calculate width from underlying data columns. |
| R/ID_tbl_length_class.R | Calculate length from underlying data rows. |
| R/create_tables_doc.R | Use underlying row counts for table splitting. |
Review effort: Balanced
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.

What is the feature?
How have you implemented the solution?
Does the PR impact any other area of the project, maybe another repo?