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

Redocument with CRAN Roxygen2 #1633

Merged
merged 3 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ BugReports: https://github.com/rstudio/gt/issues
Encoding: UTF-8
LazyData: true
ByteCompile: true
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Depends:
R (>= 3.2.0)
Imports:
Expand Down
46 changes: 46 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,10 +1,56 @@
# Generated by roxygen2: do not edit by hand

S3method(add_text_style,character)
S3method(add_text_style,shiny.tag)
S3method(as.data.frame,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(plot,gt_gtable)
S3method(print,gt_group)
S3method(print,gt_tbl)
S3method(print,rtf_text)
S3method(resolve_location,cells_body)
S3method(resolve_location,cells_column_labels)
S3method(resolve_location,cells_column_spanners)
S3method(resolve_location,cells_row_groups)
S3method(resolve_location,cells_stub)
S3method(resolve_location,resolved)
S3method(set_footnote,cells_body)
S3method(set_footnote,cells_column_labels)
S3method(set_footnote,cells_column_spanners)
S3method(set_footnote,cells_footnotes)
S3method(set_footnote,cells_grand_summary)
S3method(set_footnote,cells_row_groups)
S3method(set_footnote,cells_source_notes)
S3method(set_footnote,cells_stub)
S3method(set_footnote,cells_stub_summary)
S3method(set_footnote,cells_stubhead)
S3method(set_footnote,cells_summary)
S3method(set_footnote,cells_title)
S3method(set_style,cells_body)
S3method(set_style,cells_column_labels)
S3method(set_style,cells_column_spanners)
S3method(set_style,cells_footnotes)
S3method(set_style,cells_grand_summary)
S3method(set_style,cells_row_groups)
S3method(set_style,cells_source_notes)
S3method(set_style,cells_stub)
S3method(set_style,cells_stub_grand_summary)
S3method(set_style,cells_stub_summary)
S3method(set_style,cells_stubhead)
S3method(set_style,cells_summary)
S3method(set_style,cells_title)
S3method(text_transform_at_location,cells_body)
S3method(text_transform_at_location,cells_column_labels)
S3method(text_transform_at_location,cells_column_spanners)
S3method(text_transform_at_location,cells_row_groups)
S3method(text_transform_at_location,cells_stub)
S3method(to_output_location,cells_body)
S3method(to_output_location,cells_stub)
S3method(to_output_location,default)
S3method(to_output_location,output_relative)
export("%>%")
export(adjust_luminance)
export(as_latex)
Expand Down
1 change: 0 additions & 1 deletion R/gt-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@


#' @keywords internal
#' @aliases gt-package
"_PACKAGE"
3 changes: 3 additions & 0 deletions R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -3318,6 +3318,7 @@ cell_text <- function(
cell_style_structure(name = "cell_text", obj = style_vals)
}

#' @export
cell_style_to_html.cell_text <- function(style) {

css <- unclass(style)
Expand Down Expand Up @@ -3437,6 +3438,7 @@ cell_fill <- function(
cell_style_structure("cell_fill", style_vals)
}

#' @export
cell_style_to_html.cell_fill <- function(style) {

css <- list()
Expand Down Expand Up @@ -3642,6 +3644,7 @@ cell_borders <- function(
as_style(style = style_list)
}

#' @export
cell_style_to_html.cell_border <- function(style) {

css <- unclass(style)
Expand Down
10 changes: 10 additions & 0 deletions R/location_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,13 @@ resolve_location <- function(loc, data) {
UseMethod("resolve_location")
}

#' @export
resolve_location.resolved <- function(loc, data) {
# The object is already resolved
loc
}

#' @export
resolve_location.cells_body <- function(loc, data) {

loc$colnames <-
Expand All @@ -286,6 +288,7 @@ resolve_location.cells_body <- function(loc, data) {
loc
}

#' @export
resolve_location.cells_column_labels <- function(loc, data) {

if (!is.null(loc$columns)) {
Expand All @@ -306,6 +309,7 @@ resolve_location.cells_column_labels <- function(loc, data) {
loc
}

#' @export
resolve_location.cells_column_spanners <- function(loc, data) {

resolved <- resolve_cells_column_spanners(data = data, object = loc)
Expand All @@ -317,6 +321,7 @@ resolve_location.cells_column_spanners <- function(loc, data) {
loc
}

#' @export
resolve_location.cells_stub <- function(loc, data) {

resolved <- resolve_cells_stub(data = data, object = loc)
Expand All @@ -328,6 +333,7 @@ resolve_location.cells_stub <- function(loc, data) {
loc
}

#' @export
resolve_location.cells_row_groups <- function(loc, data) {

resolved <- resolve_cells_row_groups(data = data, object = loc)
Expand All @@ -345,6 +351,7 @@ to_output_location <- function(loc, data) {
UseMethod("to_output_location")
}

#' @export
to_output_location.default <- function(loc, data) {

loc <- resolve_location(loc = loc, data = data)
Expand All @@ -353,11 +360,13 @@ to_output_location.default <- function(loc, data) {
loc
}

#' @export
to_output_location.output_relative <- function(loc, data) {
# The object is already output-relative
loc
}

#' @export
to_output_location.cells_body <- function(loc, data) {

stub_df <- dt_stub_df_get(data = data)
Expand All @@ -376,6 +385,7 @@ to_output_location.cells_body <- function(loc, data) {
loc
}

#' @export
to_output_location.cells_stub <- function(loc, data) {

stub_df <- dt_stub_df_get(data = data)
Expand Down
25 changes: 25 additions & 0 deletions R/tab_create_modify.R
Original file line number Diff line number Diff line change
Expand Up @@ -2433,6 +2433,7 @@ set_footnote <- function(loc, data, footnote, placement) {
UseMethod("set_footnote")
}

#' @export
set_footnote.cells_title <- function(
loc,
data,
Expand Down Expand Up @@ -2475,6 +2476,7 @@ set_footnote.cells_title <- function(
data
}

#' @export
set_footnote.cells_stubhead <- function(
loc,
data,
Expand All @@ -2497,6 +2499,7 @@ set_footnote.cells_stubhead <- function(
data
}

#' @export
set_footnote.cells_column_labels <- function(
loc,
data,
Expand Down Expand Up @@ -2525,6 +2528,7 @@ set_footnote.cells_column_labels <- function(
data
}

#' @export
set_footnote.cells_column_spanners <- function(
loc,
data,
Expand All @@ -2551,6 +2555,7 @@ set_footnote.cells_column_spanners <- function(
data
}

#' @export
set_footnote.cells_row_groups <- function(
loc,
data,
Expand Down Expand Up @@ -2585,6 +2590,7 @@ set_footnote.cells_row_groups <- function(
data
}

#' @export
set_footnote.cells_body <- function(
loc,
data,
Expand Down Expand Up @@ -2613,6 +2619,7 @@ set_footnote.cells_body <- function(
data
}

#' @export
set_footnote.cells_stub <- function(
loc,
data,
Expand All @@ -2639,6 +2646,7 @@ set_footnote.cells_stub <- function(
data
}

#' @export
set_footnote.cells_summary <- function(
loc,
data,
Expand All @@ -2655,6 +2663,7 @@ set_footnote.cells_summary <- function(
)
}

#' @export
set_footnote.cells_grand_summary <- function(
loc,
data,
Expand All @@ -2671,6 +2680,7 @@ set_footnote.cells_grand_summary <- function(
)
}

#' @export
set_footnote.cells_stub_summary <- function(
loc,
data,
Expand Down Expand Up @@ -2703,6 +2713,7 @@ set_footnote.cells_stub_grand_summary <- function(
)
}

#' @export
set_footnote.cells_source_notes <- function(
loc,
data,
Expand All @@ -2712,6 +2723,7 @@ set_footnote.cells_source_notes <- function(
cli::cli_abort("Footnotes cannot be applied to source notes.")
}

#' @export
set_footnote.cells_footnotes <- function(
loc,
data,
Expand Down Expand Up @@ -3502,6 +3514,7 @@ set_style <- function(loc, data, style) {
UseMethod("set_style")
}

#' @export
set_style.cells_title <- function(loc, data, style) {

title_components <- rlang::eval_tidy(loc$groups)
Expand Down Expand Up @@ -3537,6 +3550,7 @@ set_style.cells_title <- function(loc, data, style) {
data
}

#' @export
set_style.cells_stubhead <- function(loc, data, style) {

data <-
Expand All @@ -3553,6 +3567,7 @@ set_style.cells_stubhead <- function(loc, data, style) {
data
}

#' @export
set_style.cells_column_labels <- function(loc, data, style) {

resolved <- resolve_cells_column_labels(data = data, object = loc)
Expand All @@ -3575,6 +3590,7 @@ set_style.cells_column_labels <- function(loc, data, style) {
data
}

#' @export
set_style.cells_column_spanners <- function(loc, data, style) {

resolved <- resolve_cells_column_spanners(data = data, object = loc)
Expand All @@ -3595,6 +3611,7 @@ set_style.cells_column_spanners <- function(loc, data, style) {
data
}

#' @export
set_style.cells_row_groups <- function(loc, data, style) {

row_groups <- dt_row_groups_get(data = data)
Expand Down Expand Up @@ -3623,6 +3640,7 @@ set_style.cells_row_groups <- function(loc, data, style) {
data
}

#' @export
set_style.cells_body <- function(loc, data, style) {

resolved <- resolve_cells_body(data = data, object = loc)
Expand All @@ -3645,6 +3663,7 @@ set_style.cells_body <- function(loc, data, style) {
data
}

#' @export
set_style.cells_stub <- function(loc, data, style) {

resolved <- resolve_cells_stub(data = data, object = loc)
Expand All @@ -3665,6 +3684,7 @@ set_style.cells_stub <- function(loc, data, style) {
data
}

#' @export
set_style.cells_summary <- function(loc, data, style) {

add_summary_location_row(
Expand All @@ -3675,6 +3695,7 @@ set_style.cells_summary <- function(loc, data, style) {
)
}

#' @export
set_style.cells_grand_summary <- function(loc, data, style) {

add_grand_summary_location_row(
Expand All @@ -3685,6 +3706,7 @@ set_style.cells_grand_summary <- function(loc, data, style) {
)
}

#' @export
set_style.cells_stub_summary <- function(loc, data, style) {

add_summary_location_row(
Expand All @@ -3695,6 +3717,7 @@ set_style.cells_stub_summary <- function(loc, data, style) {
)
}

#' @export
set_style.cells_stub_grand_summary <- function(loc, data, style) {

add_grand_summary_location_row(
Expand All @@ -3705,6 +3728,7 @@ set_style.cells_stub_grand_summary <- function(loc, data, style) {
)
}

#' @export
set_style.cells_footnotes <- function(loc, data, style) {

data <-
Expand All @@ -3719,6 +3743,7 @@ set_style.cells_footnotes <- function(loc, data, style) {
)
}

#' @export
set_style.cells_source_notes <- function(loc, data, style) {

data <-
Expand Down
Loading