Skip to content

Commit b44ae04

Browse files
authored
Fix decorators (#856)
Closes #851
1 parent 5af4192 commit b44ae04

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

R/tm_outliers.R

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#' - `box_plot` (`ggplot2`)
2222
#' - `density_plot` (`ggplot2`)
2323
#' - `cumulative_plot` (`ggplot2`)
24-
#' - `table` (`listing_df` created with [rlistings::as_listing()])
24+
#' - `table` (`datatable` created with [DT::datatable()])
2525
#'
2626
#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects.
2727
#' The name of this list corresponds to the name of the output to which the decorator is applied.
@@ -726,9 +726,13 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
726726

727727
# Generate decoratable object from data
728728
qenv <- within(qenv, {
729-
table <- rlistings::as_listing(
730-
tibble::rownames_to_column(summary_table, var = " "),
731-
key_cols = character(0L)
729+
table <- DT::datatable(
730+
summary_table,
731+
options = list(
732+
dom = "t",
733+
autoWidth = TRUE,
734+
columnDefs = list(list(width = "200px", targets = "_all"))
735+
)
732736
)
733737
})
734738

@@ -1048,14 +1052,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
10481052
if (iv_r()$is_valid()) {
10491053
categorical_var <- as.vector(merged$anl_input_r()$columns_source$categorical_var)
10501054
if (!is.null(categorical_var)) {
1051-
DT::datatable(
1052-
decorated_final_q()[["summary_table"]],
1053-
options = list(
1054-
dom = "t",
1055-
autoWidth = TRUE,
1056-
columnDefs = list(list(width = "200px", targets = "_all"))
1057-
)
1058-
)
1055+
decorated_final_q()[["table"]]
10591056
}
10601057
}
10611058
}

man/tm_outliers.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)