Skip to content

Commit c6c4c17

Browse files
committed
tm_outliers: report uses rtables instead of datatables
1 parent 10e77ad commit c6c4c17

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

R/tm_outliers.R

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#' - `box_plot` (`ggplot`)
2222
#' - `density_plot` (`ggplot`)
2323
#' - `cumulative_plot` (`ggplot`)
24-
#' - `table` (`datatables` created with [DT::datatable()])
24+
#' - `table` (`ElementaryTable` created with [rtables::df_to_tt()])
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.
@@ -753,16 +753,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
753753
}
754754

755755
# Generate decoratable object from data
756-
qenv <- within(qenv, {
757-
table <- DT::datatable(
758-
summary_table,
759-
options = list(
760-
dom = "t",
761-
autoWidth = TRUE,
762-
columnDefs = list(list(width = "200px", targets = "_all"))
763-
)
764-
)
765-
})
756+
qenv <- within(qenv, table <- rtables::df_to_tt(summary_table))
766757

767758
if (length(categorical_var) > 0 && nrow(qenv[["ANL_OUTLIER"]]) > 0) {
768759
shinyjs::show("order_by_outlier")
@@ -1080,10 +1071,15 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
10801071
if (iv_r()$is_valid()) {
10811072
categorical_var <- as.vector(merged$anl_input_r()$columns_source$categorical_var)
10821073
if (!is.null(categorical_var)) {
1083-
decorated_final_q()[["table"]]
1074+
decorated_final_q()[["summary_table"]]
10841075
}
10851076
}
1086-
}
1077+
},
1078+
options = list(
1079+
dom = "t",
1080+
autoWidth = TRUE,
1081+
columnDefs = list(list(width = "200px", targets = "_all"))
1082+
)
10871083
)
10881084

10891085
# slider text

0 commit comments

Comments
 (0)