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

Depend on R 3.6 + other package cleanup #1731

Merged
merged 26 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c24b318
Use R>= 3.5, so no need for the utf8 aware variable on load.
olivroy Jun 25, 2024
caa59c8
Remove is_false for isFALSE since exported in base since R 3.5 (also,…
olivroy Jun 25, 2024
18c10b5
Unrelated, don't set `gt.strict_column_fmt` on load.
olivroy Jun 25, 2024
48343af
R 3.6 + roxygen2 7.3.0 use `@exportS3Method` instead of `register_s3_…
olivroy Jun 25, 2024
eddd378
Update NEWS and DESCRIPTION
olivroy Jun 25, 2024
ce8982e
Move `tidy_grepl()` to `tests/testtht/helper.R` since it is only used…
olivroy Jun 25, 2024
bec1acf
Remove some dplyr code for base
olivroy Jun 25, 2024
e0b0fc4
use `sub()`/`gsub()` instead of `tidy_sub()` / `tidy_gsub()` in gt code
olivroy Jun 25, 2024
dd5a471
Replace `tidy_gsub()` by `trimws(which = "right")` when applicable
olivroy Jun 25, 2024
7b905e4
Replace tidy_sub by stringr in data-raw
olivroy Jun 25, 2024
e93c5db
Create non_na_text and non_na_x with paste0 instead of sub end and st…
olivroy Jun 25, 2024
78e6a29
Refactor condition + add comment on condition for later.
olivroy Jun 25, 2024
8a34e84
Remove `tidy_sub()` and `tidy_gsub()` (verified that test passed on W…
olivroy Jun 25, 2024
02c97e3
Rename function for clarity + move comment.
olivroy Jun 25, 2024
edbd9f4
Use `normalizePath()` instead of homegrown modifier
olivroy Jun 25, 2024
8da30ca
Replace `arrange(desc()) + slice_head()` by `slice_max()`
olivroy Jun 25, 2024
8e8574a
Specify `iris_short` once.
olivroy Jun 25, 2024
90337a0
Fix condition. (table_width changes under certain conditions)
olivroy Jun 25, 2024
2ee758d
Remove workaround after fixing issue in edbd9f4
olivroy Jun 25, 2024
64d0bb2
Don't build ignore snapshots for tests that are included on CRAN
olivroy Jun 25, 2024
8b7f9d8
Review methods Since htmltools is in Imports, can use as.tags + rm ws…
olivroy Jun 25, 2024
bfc6345
Remove `Collate` by moving `dt_options_get_default_value()` after `ta…
olivroy Jun 25, 2024
089ddb3
Move imports to `R/gt-package.R`
olivroy Jun 25, 2024
79163d8
spacing fixup + remove print.rtf_text.Rd
olivroy Jun 25, 2024
8f3339a
Document them together instead.
olivroy Jun 25, 2024
75e3e9f
Merge branch 'master' into r3.5
olivroy Jun 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 84 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,82 +16,165 @@ vignettes
man/figures/
tests/gt-examples
tests/performance-monitoring
tests/testthat/_snaps
tests/testthat/test-as_raw_html.R

tests/testthat/test-as_word.R
tests/testthat/_snaps/as_word.md

tests/testthat/test-color_handling.R

tests/testthat/test-cols_align_decimal.R
tests/testthat/_snaps/cols_align_decimal.md

tests/testthat/test-cols_label.R
tests/testthat/test-cols_label_with.R

tests/testthat/test-cols_merge.R
tests/testthat/_snaps/cols_merge.md

tests/testthat/test-cols_width_rtf.R
tests/testthat/_snaps/cols_width_rtf.md

tests/testthat/test-cols_width.R
tests/testthat/_snaps/cols_width.md

tests/testthat/test-data_color.R
tests/testthat/_snaps/data_color.md

tests/testthat/test-empty_tbl.R
tests/testthat/test-escaping.R
tests/testthat/test-extract_body.R
tests/testthat/test-extract_cells.R

tests/testthat/test-fmt_auto.R
tests/testthat/_snaps/fmt_auto.md

tests/testthat/test-fmt_bins.R
tests/testthat/test-fmt_bytes.R

tests/testthat/test-fmt_currency.R
tests/testthat/_snaps/fmt_currency.md

tests/testthat/test-fmt_date_time.R

tests/testthat/test-fmt_duration.R
tests/testthat/_snaps/fmt_duration.md

tests/testthat/test-fmt_email.R
tests/testthat/test-fmt_engineering.R
tests/testthat/test-fmt_flag.R

tests/testthat/test-fmt_fraction.R
tests/testthat/_snaps/fmt_fraction.md

tests/testthat/test-fmt_image.R
tests/testthat/test-fmt_index.R

tests/testthat/test-fmt_integer.R
tests/testthat/_snaps/fmt_integer.md

tests/testthat/test-fmt_markdown.R
tests/testthat/_snaps/fmt_markdown.md

tests/testthat/test-fmt_number.R
tests/testthat/_snaps/fmt_number.md

tests/testthat/test-fmt_partsper.R
tests/testthat/test-fmt_passthrough.R
tests/testthat/test-fmt_percent.R
tests/testthat/test-fmt_roman.R
tests/testthat/test-fmt_scientific.R
tests/testthat/test-fmt_spelled_num.R
tests/testthat/test-fmt_url.R

tests/testthat/test-footer.R
tests/testthat/_snaps/footer.md

tests/testthat/test-group_column_label.R
tests/testthat/_snaps/group_column_label.md

tests/testthat/test-gt_group.R
tests/testthat/test-gt_object.R
tests/testthat/test-gt_split.R

tests/testthat/test-gtsave.R
tests/testthat/_snaps/gtsave.md

tests/testthat/test-h_md_html.R
tests/testthat/test-helper_functions.R
tests/testthat/test-i_html.R

tests/testthat/test-image.R
tests/testthat/_snaps/image.md

tests/testthat/test-info_tables.R
tests/testthat/test-input_data_validation.R

tests/testthat/test-l_table_parts.R
tests/testthat/_snaps/l_table_parts.md

tests/testthat/test-location_cells.R
tests/testthat/test-opt_functions.R

tests/testthat/test-removal_functions.R
tests/testthat/_snaps/removal_functions.md

tests/testthat/test-rows_add.R
tests/testthat/_snaps/rows_add.md

tests/testthat/test-rtf_column_widths.R

tests/testthat/test-rtf_page_options.R
tests/testthat/_snaps/rtf_page_options.md

tests/testthat/test-stub.R
tests/testthat/test-substitution.R

tests/testthat/test-summary_rows_latex.R
tests/testthat/_snaps/summary_rows_latex.md

tests/testthat/test-summary_rows_rtf.R
tests/testthat/_snaps/summary_rows_rtf.md

tests/testthat/test-summary_rows.R
tests/testthat/_snaps/summary_rows.md

tests/testthat/test-tab_footnote.R
tests/testthat/_snaps/tab_footnote.md

tests/testthat/test-tab_info.R

tests/testthat/test-tab_options.R
tests/testthat/_snaps/tab_options.md

tests/testthat/test-tab_remove.R
tests/testthat/_snaps/tab_remove.md

tests/testthat/test-tab_spanner_delim.R
tests/testthat/_snaps/tab_spanner_delim.md

tests/testthat/test-tab_spanner.R
tests/testthat/_snaps/tab_spanner.md

tests/testthat/test-tab_stub_indent.R
tests/testthat/_snaps/tab_stub_indent.md

tests/testthat/test-tab_style.R
tests/testthat/_snaps/tab_style.md

tests/testthat/test-tab_style_body.R
tests/testthat/_snaps/tab_style_body.md

tests/testthat/test-table_parts.R
tests/testthat/_snaps/table_parts.md

tests/testthat/test-text_transform.R
tests/testthat/test-util_functions.R
tests/testthat/test-utils_formatters.R
tests/testthat/test-utils_plots.R
tests/testthat/test-utils_render_html.R
tests/testthat/test-utils_units.R
tests/testthat/test-utils.R

tests/testthat/test-vec_fmt.R
tests/testthat/_snaps/vec_fmt.md
79 changes: 1 addition & 78 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ License: MIT + file LICENSE
URL: https://gt.rstudio.com, https://github.com/rstudio/gt
BugReports: https://github.com/rstudio/gt/issues
Depends:
R (>= 3.2.0)
R (>= 3.6.0)
Imports:
base64enc (>= 0.1-3),
bigD (>= 0.2),
Expand Down Expand Up @@ -80,80 +80,3 @@ Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
Collate:
'as_data_frame.R'
'build_data.R'
'compile_scss.R'
'data_color.R'
'datasets.R'
'dt__.R'
'dt_body.R'
'dt_boxhead.R'
'dt_cols_merge.R'
'dt_data.R'
'dt_footnotes.R'
'dt_formats.R'
'dt_groups_rows.R'
'dt_has_built.R'
'dt_heading.R'
'dt_locale.R'
'dt_options.R'
'dt_row_groups.R'
'dt_source_notes.R'
'dt_spanners.R'
'dt_stub_df.R'
'dt_stubhead.R'
'dt_styles.R'
'dt_substitutions.R'
'dt_summary.R'
'dt_transforms.R'
'export.R'
'format_data.R'
'format_vec.R'
'gt-package.R'
'gt.R'
'gt_group.R'
'gt_preview.R'
'gt_split.R'
'helpers.R'
'image.R'
'import-standalone-obj-type.R'
'import-standalone-types-check.R'
'info_tables.R'
'knitr-utils.R'
'location_methods.R'
'modify_columns.R'
'modify_rows.R'
'tab_create_modify.R'
'opts.R'
'print.R'
'reexports.R'
'render_as_html.R'
'render_as_i_html.R'
'resolver.R'
'rows_add.R'
'shiny.R'
'substitution.R'
'summary_rows.R'
'tab_info.R'
'tab_remove.R'
'tab_style_body.R'
'text_transform.R'
'topics.R'
'utils.R'
'utils_color_contrast.R'
'utils_environments.R'
'utils_examples.R'
'utils_formatters.R'
'utils_general_str_formatting.R'
'utils_pipe.R'
'utils_plots.R'
'utils_render_common.R'
'utils_render_grid.R'
'utils_render_html.R'
'utils_render_latex.R'
'utils_render_rtf.R'
'utils_render_xml.R'
'utils_units.R'
'z_utils_render_footnotes.R'
'zzz.R'
5 changes: 4 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
S3method(add_text_style,character)
S3method(add_text_style,shiny.tag)
S3method(as.data.frame,gt_tbl)
S3method(as.tags,gt_tbl)
S3method(cell_style_to_html,cell_border)
S3method(cell_style_to_html,cell_fill)
S3method(cell_style_to_html,cell_text)
S3method(cell_style_to_html,default)
S3method(knitr::knit_print,gt_group)
S3method(knitr::knit_print,gt_tbl)
S3method(plot,gt_gtable)
S3method(print,gt_group)
S3method(print,gt_tbl)
Expand Down Expand Up @@ -241,9 +244,9 @@ export(vec_fmt_time)
export(web_image)
import(rlang)
importFrom(dplyr,vars)
importFrom(htmltools,as.tags)
importFrom(htmltools,css)
importFrom(magrittr,"%>%")
importFrom(rlang,`%||%`)
importFrom(tidyselect,contains)
importFrom(tidyselect,ends_with)
importFrom(tidyselect,everything)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# gt (development version)

* gt now depends on R 3.6 (@olivroy, #1731).

* `opt_interactive()` gains `height` to help specify your widget's height (@olivroy, #1544).

* `opt_interactive()` now shows row names if `rownames_to_stub = TRUE` (@olivroy, #1702).
Expand Down
2 changes: 0 additions & 2 deletions R/build_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@


# Build common table components from a `gt_tbl` object
#' @import rlang
#' @noRd
build_data <- function(data, context) {

# Perform input object validation
Expand Down
1 change: 0 additions & 1 deletion R/data_color.R
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,6 @@
#' @section Function Introduced:
#' `v0.2.0.5` (March 31, 2020)
#'
#' @import rlang
#' @export
data_color <- function(
data,
Expand Down
7 changes: 3 additions & 4 deletions R/export.R
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ gt_save_html <- function(

} else {

html <- htmltools::as.tags(data)
html <- as.tags(data)
}

return(htmltools::save_html(html, filename, ...))
Expand Down Expand Up @@ -289,7 +289,7 @@ gt_save_webshot <- function(
tempfile_ <- tempfile(fileext = ".html")

# Reverse slashes on Windows filesystems
tempfile_ <- tidy_gsub(tempfile_, "\\\\", "/")
tempfile_ <- normalizePath(tempfile_, "/", mustWork = FALSE)

# Save gt table as HTML using the `gt_save_html()` function
gt_save_html(
Expand Down Expand Up @@ -578,7 +578,7 @@ as_raw_html <- function(
# Perform input object validation
stop_if_not_gt_tbl(data = data)

html_table <- as.character(as.tags.gt_tbl(data))
html_table <- as.character(as.tags(data))

if (inline_css) {

Expand Down Expand Up @@ -1723,7 +1723,6 @@ extract_body <- function(
#'
#' @section Function Introduced:
#' `v0.2.0.5` (March 31, 2020)
#'
#' @export
extract_summary <- function(data) {

Expand Down
Loading
Loading