Skip to content

Commit

Permalink
Merge branch 'master' into incorrect-stub
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy authored Jul 18, 2024
2 parents 2537e75 + 3c71378 commit 0f70cd7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@

* Fixed a bug in using `pct()` column widths with `as_gtable()` (@teunbrand, #1771)

* Fixed a bug where `gt(row_group_as_column = TRUE)` would create the wrong layout with `as_gtable()` when all groups are unique (@olivroy, #1803).

* grid output has been improved. Namely, showing currency symbols now works (@olivroy, #1788).

* `data_color()` no longer errors when a tidyselect selection is empty (like `fmt_*()` functions) (@olivroy, #1665).

* `gt(row_group_as_column = TRUE)` now works if multiple groups are supplied (@olivroy, #1552).
Expand Down
3 changes: 3 additions & 0 deletions R/utils_render_grid.R
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,9 @@ body_cells_g <- function(data) {
if (has_length(delete)) {
# don't if delete doesn't have length.
# will likely occur in the case of
if (rlang::has_length(delete)) {
# don't attempt delete doesn't have length
# will likely occur in the case of all groups of length 1 #1803
layout <- vctrs::vec_slice(layout, -delete)
cell_rows <- vctrs::vec_slice(cell_rows, -delete)
}
Expand Down
9 changes: 5 additions & 4 deletions pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ home:

template:
bootstrap: 5
light-switch: true
assets: pkgdown/assets

authors:
Expand Down Expand Up @@ -361,10 +362,10 @@ reference:

- title: Built in datasets
desc: >
The **gt** package is equipped with twelve datasets that come in all
shapes and sizes. Use them to experiment with the package! Many examples
in the internal help documents use these datasets to quickly demonstrate
the awesome features of **gt**.
The **gt** package is equipped with 18 datasets that come in all shapes
and sizes. Use them to experiment with the package! Many examples in the
documentation use these datasets to demonstrate the awesome features of
**gt**.
contents:
- countrypops
- sza
Expand Down
1 change: 0 additions & 1 deletion pkgdown/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ h4, .h4 {
}

dt {
color: rgb(38, 38, 38);
text-decoration: underline;
text-decoration-style: solid;
text-underline-offset: 4px;
Expand Down
5 changes: 3 additions & 2 deletions tests/testthat/test-as_gtable.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,10 @@ test_that("gtable outputs works well for currencies", {
)
})

test_that("gtable output works when row_group_as_column = TRUE and groups are unique", {
test_that("gtable output works when row groups are unique (#1802).", {
# using groupname_col = "row" to ensure uniqueness
tbl <- exibble %>%
gt(groupname_col = "row", row_group_as_column = TRUE)
gt(groupname_col = "row")
expect_no_error(test <- as_gtable(tbl))
expect_equal(
test$layout$name[8],
Expand Down

0 comments on commit 0f70cd7

Please sign in to comment.