Skip to content
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
20 changes: 8 additions & 12 deletions R/tm_g_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#' This module generates the following objects, which can be modified in place using decorators::
#' - `histogram_plot` (`ggplot2`)
#' - `qq_plot` (`ggplot2`)
#' - `summary_table` (`listing_df` created with [rlistings::as_listing()])
#' - `test_table` (`listing_df` created with [rlistings::as_listing()])
#' - `summary_table` (`datatables` created with [DT::datatable()])
#' - `test_table` (`datatables` created with [DT::datatable()])
#'
#' A Decorator is applied to the specific output using a named list of `teal_transform_module` objects.
#' The name of this list corresponds to the name of the output to which the decorator is applied.
Expand Down Expand Up @@ -1271,9 +1271,9 @@ srv_distribution <- function(id,
# Summary table listing has to be created separately to allow for qenv join
output_summary_q <- reactive({
if (iv_r()$is_valid()) {
within(common_q(), summary_table <- rlistings::as_listing(summary_table_data))
within(common_q(), summary_table <- DT::datatable(summary_table_data))
} else {
within(common_q(), summary_table <- rlistings::as_listing(summary_table_data[0L, ]))
within(common_q(), summary_table <- DT::datatable(summary_table_data[0L, ]))
}
})

Expand All @@ -1284,11 +1284,11 @@ srv_distribution <- function(id,
c(
common_q(),
within(test_q_out, {
test_table <- rlistings::as_listing(test_table_data)
test_table <- DT::datatable(test_table_data)
})
)
} else {
within(common_q(), test_table <- rlistings::as_listing(data.frame(missing = character(0L))))
within(common_q(), test_table <- DT::datatable(data.frame(missing = character(0L))))
}
})

Expand Down Expand Up @@ -1341,7 +1341,7 @@ srv_distribution <- function(id,
qq_r <- reactive(req(decorated_output_qq_q())[["qq_plot"]])

output$summary_table <- DT::renderDataTable(
expr = decorated_output_summary_q()[["summary_table_data"]],
expr = decorated_output_summary_q()[["summary_table"]],
options = list(
autoWidth = TRUE,
columnDefs = list(list(width = "200px", targets = "_all"))
Expand All @@ -1353,11 +1353,7 @@ srv_distribution <- function(id,
req(iv_r()$is_valid())
teal::validate_inputs(iv_r_dist())
req(test_q()) # Ensure original errors are displayed
DT::datatable(
data = decorated_output_test_q()[["test_table_data"]],
options = list(scrollX = TRUE),
rownames = FALSE
)
decorated_output_test_q()[["test_table"]]
})

pws1 <- teal.widgets::plot_with_settings_srv(
Expand Down
4 changes: 2 additions & 2 deletions man/tm_g_distribution.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading