Skip to content

Commit 354373f

Browse files
committed
fix: decorate datatables instead of listing_df
1 parent 8cd7d71 commit 354373f

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.
@@ -720,9 +720,13 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
720720

721721
# Generate decoratable object from data
722722
qenv <- within(qenv, {
723-
table <- rlistings::as_listing(
724-
tibble::rownames_to_column(summary_table, var = " "),
725-
key_cols = character(0L)
723+
table <- DT::datatable(
724+
summary_table,
725+
options = list(
726+
dom = "t",
727+
autoWidth = TRUE,
728+
columnDefs = list(list(width = "200px", targets = "_all"))
729+
)
726730
)
727731
})
728732

@@ -1039,14 +1043,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
10391043
if (iv_r()$is_valid()) {
10401044
categorical_var <- as.vector(merged$anl_input_r()$columns_source$categorical_var)
10411045
if (!is.null(categorical_var)) {
1042-
DT::datatable(
1043-
decorated_final_q()[["summary_table"]],
1044-
options = list(
1045-
dom = "t",
1046-
autoWidth = TRUE,
1047-
columnDefs = list(list(width = "200px", targets = "_all"))
1048-
)
1049-
)
1046+
decorated_final_q()[["table"]]
10501047
}
10511048
}
10521049
}

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)