Skip to content

Commit

Permalink
add logger::log_shiny_input_changes(input, namespace = "teal.modules.…
Browse files Browse the repository at this point in the history
…general") for all modules
  • Loading branch information
m7pr committed May 9, 2024
1 parent 5612f05 commit fd89b57
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/tm_a_regression.R
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ srv_a_regression <- function(id,
checkmate::assert_class(data, "reactive")
checkmate::assert_class(isolate(data()), "teal_data")
moduleServer(id, function(input, output, session) {

logger::log_shiny_input_changes(input, namespace = "teal.modules.general")

ns <- session$ns

rule_rvr1 <- function(value) {
Expand Down
3 changes: 3 additions & 0 deletions R/tm_data_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ srv_page_data_table <- function(id,
checkmate::assert_class(data, "reactive")
checkmate::assert_class(isolate(data()), "teal_data")
moduleServer(id, function(input, output, session) {

logger::log_shiny_input_changes(input, namespace = "teal.modules.general")

if_filtered <- reactive(as.logical(input$if_filtered))
if_distinct <- reactive(as.logical(input$if_distinct))

Expand Down
3 changes: 3 additions & 0 deletions R/tm_file_viewer.R
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ ui_viewer <- function(id, ...) {
# Server function for the file viewer module
srv_viewer <- function(id, input_path) {
moduleServer(id, function(input, output, session) {

logger::log_shiny_input_changes(input, namespace = "teal.modules.general")

temp_dir <- tempfile()
if (!dir.exists(temp_dir)) {
dir.create(temp_dir, recursive = TRUE)
Expand Down
3 changes: 3 additions & 0 deletions R/tm_front_page.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ srv_front_page <- function(id, data, tables, show_metadata) {
checkmate::assert_class(data, "reactive")
checkmate::assert_class(isolate(data()), "teal_data")
moduleServer(id, function(input, output, session) {

logger::log_shiny_input_changes(input, namespace = "teal.modules.general")

ns <- session$ns

setBookmarkExclude("metadata_button")
Expand Down
3 changes: 3 additions & 0 deletions R/tm_g_association.R
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ srv_tm_g_association <- function(id,
checkmate::assert_class(isolate(data()), "teal_data")

moduleServer(id, function(input, output, session) {

logger::log_shiny_input_changes(input, namespace = "teal.modules.general")

selector_list <- teal.transform::data_extract_multiple_srv(
data_extract = list(ref = ref, vars = vars),
datasets = data,
Expand Down
3 changes: 3 additions & 0 deletions R/tm_g_bivariate.R
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ srv_g_bivariate <- function(id,
checkmate::assert_class(data, "reactive")
checkmate::assert_class(isolate(data()), "teal_data")
moduleServer(id, function(input, output, session) {

logger::log_shiny_input_changes(input, namespace = "teal.modules.general")

ns <- session$ns

data_extract <- list(
Expand Down
3 changes: 3 additions & 0 deletions R/tm_g_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,9 @@ srv_distribution <- function(id,
checkmate::assert_class(data, "reactive")
checkmate::assert_class(isolate(data()), "teal_data")
moduleServer(id, function(input, output, session) {

logger::log_shiny_input_changes(input, namespace = "teal.modules.general")

setBookmarkExclude("params_reset")

ns <- session$ns
Expand Down
3 changes: 3 additions & 0 deletions R/tm_g_response.R
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ srv_g_response <- function(id,
checkmate::assert_class(data, "reactive")
checkmate::assert_class(isolate(data()), "teal_data")
moduleServer(id, function(input, output, session) {

logger::log_shiny_input_changes(input, namespace = "teal.modules.general")

data_extract <- list(response = response, x = x, row_facet = row_facet, col_facet = col_facet)

rule_diff <- function(other) {
Expand Down
3 changes: 3 additions & 0 deletions R/tm_g_scatterplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,9 @@ srv_g_scatterplot <- function(id,
checkmate::assert_class(data, "reactive")
checkmate::assert_class(isolate(data()), "teal_data")
moduleServer(id, function(input, output, session) {

logger::log_shiny_input_changes(input, namespace = "teal.modules.general")

data_extract <- list(
x = x,
y = y,
Expand Down
3 changes: 3 additions & 0 deletions R/tm_g_scatterplotmatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ srv_g_scatterplotmatrix <- function(id, data, reporter, filter_panel_api, variab
checkmate::assert_class(data, "reactive")
checkmate::assert_class(isolate(data()), "teal_data")
moduleServer(id, function(input, output, session) {

logger::log_shiny_input_changes(input, namespace = "teal.modules.general")

selector_list <- teal.transform::data_extract_multiple_srv(
data_extract = list(variables = variables),
datasets = data,
Expand Down
3 changes: 3 additions & 0 deletions R/tm_missing_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ srv_page_missing_data <- function(id, data, reporter, filter_panel_api, parent_d
with_reporter <- !missing(reporter) && inherits(reporter, "Reporter")
with_filter <- !missing(filter_panel_api) && inherits(filter_panel_api, "FilterPanelAPI")
moduleServer(id, function(input, output, session) {

logger::log_shiny_input_changes(input, namespace = "teal.modules.general")

datanames <- isolate(teal.data::datanames(data()))
datanames <- Filter(function(name) {
is.data.frame(isolate(data())[[name]])
Expand Down
3 changes: 3 additions & 0 deletions R/tm_outliers.R
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
checkmate::assert_class(data, "reactive")
checkmate::assert_class(isolate(data()), "teal_data")
moduleServer(id, function(input, output, session) {

logger::log_shiny_input_changes(input, namespace = "teal.modules.general")

ns <- session$ns

vars <- list(outlier_var = outlier_var, categorical_var = categorical_var)
Expand Down
3 changes: 3 additions & 0 deletions R/tm_t_crosstable.R
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ srv_t_crosstable <- function(id, data, reporter, filter_panel_api, label, x, y,
checkmate::assert_class(data, "reactive")
checkmate::assert_class(isolate(data()), "teal_data")
moduleServer(id, function(input, output, session) {

logger::log_shiny_input_changes(input, namespace = "teal.modules.general")

selector_list <- teal.transform::data_extract_multiple_srv(
data_extract = list(x = x, y = y),
datasets = data,
Expand Down
3 changes: 3 additions & 0 deletions R/tm_variable_browser.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ srv_variable_browser <- function(id,
checkmate::assert_class(data, "reactive")
checkmate::assert_class(isolate(data()), "teal_data")
moduleServer(id, function(input, output, session) {

logger::log_shiny_input_changes(input, namespace = "teal.modules.general")

# if there are < this number of unique records then a numeric
# variable can be treated as a factor and all factors with < this groups
# have their values plotted
Expand Down

0 comments on commit fd89b57

Please sign in to comment.