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

optional height and width arguments to the append_plot method #100

Merged
merged 7 commits into from
Jul 5, 2022

Conversation

Polkas
Copy link
Contributor

@Polkas Polkas commented Jul 4, 2022

closes #99

add optional height and width arguments to the append_plot method of the ReportCard

@Polkas Polkas added the core label Jul 4, 2022
@Polkas Polkas changed the title Update ReportCard.R optional height and width arguments to the append_plot method Jul 4, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2022

Unit Tests Summary

    1 files    17 suites   8s ⏱️
186 tests 186 ✔️ 0 💤 0
268 runs  268 ✔️ 0 💤 0

Results for commit bb75124.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2022

Code Coverage Summary

Filename              Stmts    Miss  Cover    Missing
------------------  -------  ------  -------  ---------------------------------------------
R/AddCardModule.R       100       3  97.00%   75-77
R/Archiver.R             25       0  100.00%
R/ContentBlock.R         16       0  100.00%
R/DownloadModule.R      137      24  82.48%   76-78, 99, 156-160, 163-167, 174-178, 181-185
R/FileBlock.R            13       0  100.00%
R/NewpageBlock.R          2       0  100.00%
R/PictureBlock.R         30       1  96.67%   15
R/Previewer.R           215      11  94.88%   158, 160-163, 168-174
R/Renderer.R             54       4  92.59%   142, 144-145, 166
R/ReportCard.R           76       2  97.37%   211, 232
R/Reporter.R             96       1  98.96%   255
R/ResetModule.R          45       0  100.00%
R/SimpleReporter.R       18       0  100.00%
R/TableBlock.R            8       0  100.00%
R/TealReportCard.R       20       0  100.00%
R/TextBlock.R            13       0  100.00%
R/yaml_utils.R           74       2  97.30%   65, 263
TOTAL                   942      48  94.90%

Results for commit: a3bfb3f

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Comment on lines +42 to +48
testthat::test_that("append_plot accepts a ggplot with a dim", {
testthat::expect_error(
ReportCard$new()$append_plot(ggplot2::ggplot(iris), c(1000L, 100L)),
regexp = NA
)
})

Copy link
Contributor

Choose a reason for hiding this comment

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

please add a test case with no dim added (what is the expected output) and with wrong dim input.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are already there nevertheless in the lower level PictureBlock class.
I added additional tests to check strictly the size in pixels of the files.

Copy link
Contributor

@mhallal1 mhallal1 left a comment

Choose a reason for hiding this comment

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

tested with insightsengineering/teal.widgets#63 (review) and working as expected.

@Polkas Polkas enabled auto-merge (squash) July 5, 2022 09:35
@Polkas Polkas merged commit a71f069 into main Jul 5, 2022
@Polkas Polkas deleted the 99_hw@main branch July 5, 2022 09:36
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.

append_plot with additional (optional) width and height arguments
2 participants