Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

185 fixing table formatting in PPT outputs #211

Merged
merged 45 commits into from
Sep 19, 2023

Conversation

kartikeyakirar
Copy link
Contributor

@kartikeyakirar kartikeyakirar commented Sep 7, 2023

this PR fixes #185

Inspired by autoslidR, I have integrated flextable functionality to convert "data.frame," "rtables," "TableTree," and "ElementaryTable" into flextable, which offers a more accurate representation. In this context, I have enhanced the TableBlock to facilitate the conversion of tables into flextable.

Output screenshot
Screenshot 2023-09-08 at 7 20 48 PM

@kartikeyakirar kartikeyakirar changed the title 185 fixing formating@main 185 fixing table formatting in PPT outputs Sep 7, 2023
@kartikeyakirar kartikeyakirar marked this pull request as draft September 7, 2023 13:42
@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

badge

Code Coverage Summary

Filename              Stmts    Miss  Cover    Missing
------------------  -------  ------  -------  ----------------------------------------------------------------------------------
R/AddCardModule.R       140       1  99.29%   195
R/Archiver.R             25       0  100.00%
R/ContentBlock.R         18       2  88.89%   38-44
R/DownloadModule.R      207      49  76.33%   89-95, 138, 163-168, 177-181, 184-188, 196-200, 203-207, 214-218, 221-225, 262-266
R/FileBlock.R            13       0  100.00%
R/NewpageBlock.R          2       0  100.00%
R/PictureBlock.R         30       2  93.33%   15, 79
R/Previewer.R           295      56  81.02%   183, 197, 199-202, 205, 208-216, 325-369
R/RcodeBlock.R           15       0  100.00%
R/Renderer.R             90      19  78.89%   96, 104, 113, 115-133
R/ReportCard.R           77       4  94.81%   180, 219, 224, 245
R/Reporter.R             94       1  98.94%   254
R/ResetModule.R          55       0  100.00%
R/SimpleReporter.R       29       0  100.00%
R/TableBlock.R            9       0  100.00%
R/TextBlock.R            13       0  100.00%
R/utils.R               139      69  50.36%   7, 38-97, 99, 102-109, 158-160
R/yaml_utils.R           74       2  97.30%   41, 239
TOTAL                  1325     205  84.53%

Diff against main

Filename          Stmts    Miss  Cover
--------------  -------  ------  --------
R/Renderer.R         +6      +6  -5.63%
R/TableBlock.R       +1       0  +100.00%
R/utils.R           +61      +3  +34.98%
TOTAL               +68      +9  +0.12%

Results for commit: 214841d

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

R/utils.R Outdated Show resolved Hide resolved
@kartikeyakirar kartikeyakirar marked this pull request as ready for review September 8, 2023 10:30
@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

Unit Tests Summary

    1 files    18 suites   13s ⏱️
202 tests 202 ✔️ 0 💤 0
341 runs  341 ✔️ 0 💤 0

Results for commit 0e9765b.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@gogonzo gogonzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked exploratory example from teal.gallery and table is not included in the reporter previewer. Instead, table is printed to graphical device, so extra window in my IDE gets open

image

@kartikeyakirar
Copy link
Contributor Author

kartikeyakirar commented Sep 11, 2023

Instead, table is printed to graphical device, so extra window in my IDE gets open

In PR I was saving a 'flextable' instead of 'rtables,' in rds which was not being converted into an HTML element in preview module. This problem has been fixed using the 'flextable::htmltools_value' function.

image

@kartikeyakirar kartikeyakirar requested a review from a team September 12, 2023 14:14
@averissimo averissimo self-assigned this Sep 14, 2023
Copy link
Contributor

@averissimo averissimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @kartikeyakirar 💯

Feature-wise it performs very well! I found no issues when testing against cards that contained a table or table + plot (see screenshot below)

It works with {teal.gallery} longitudinal app and a bunch of others.

I have some comments on the code that I think would help with the readability of the code for "future us" 😅

image

R/Renderer.R Outdated Show resolved Hide resolved
R/utils.R Show resolved Hide resolved
R/utils.R Outdated Show resolved Hide resolved
R/utils.R Outdated Show resolved Hide resolved
R/utils.R Outdated Show resolved Hide resolved
R/utils.R Outdated Show resolved Hide resolved
R/utils.R Show resolved Hide resolved
R/utils.R Show resolved Hide resolved
R/utils.R Show resolved Hide resolved
R/utils.R Show resolved Hide resolved
kartikeyakirar and others added 9 commits September 15, 2023 11:31
Co-authored-by: André Veríssimo <[email protected]>
Signed-off-by: kartikeya kirar <[email protected]>
Co-authored-by: André Veríssimo <[email protected]>
Signed-off-by: kartikeya kirar <[email protected]>
Co-authored-by: André Veríssimo <[email protected]>
Signed-off-by: kartikeya kirar <[email protected]>
Co-authored-by: André Veríssimo <[email protected]>
Signed-off-by: kartikeya kirar <[email protected]>
Co-authored-by: André Veríssimo <[email protected]>
Signed-off-by: kartikeya kirar <[email protected]>
Co-authored-by: André Veríssimo <[email protected]>
Signed-off-by: kartikeya kirar <[email protected]>
Copy link
Contributor

@averissimo averissimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, great work @kartikeyakirar 🎉

2 small (last) suggestions to keep up with test naming convention. Feel free to merge after 😁

tests/testthat/test-utils.R Outdated Show resolved Hide resolved
tests/testthat/test-utils.R Outdated Show resolved Hide resolved
kartikeyakirar and others added 3 commits September 15, 2023 17:15
Co-authored-by: André Veríssimo <[email protected]>
Signed-off-by: kartikeya kirar <[email protected]>
Co-authored-by: André Veríssimo <[email protected]>
Signed-off-by: kartikeya kirar <[email protected]>
@kartikeyakirar kartikeyakirar enabled auto-merge (squash) September 15, 2023 11:48
@kartikeyakirar kartikeyakirar enabled auto-merge (squash) September 19, 2023 07:40
@kartikeyakirar kartikeyakirar dismissed gogonzo’s stale review September 19, 2023 07:54

I have addressed the requested modifications to resolve the issue of the table not appearing in the preview. However, the request still remains in the checklist. @gogonzo , I will submit another pull request if further changes are necessary.

@kartikeyakirar kartikeyakirar merged commit c199825 into main Sep 19, 2023
@kartikeyakirar kartikeyakirar deleted the 185_fixing_formating@main branch September 19, 2023 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Nicer table formatting in PPT outputs
3 participants