Skip to content

Commit

Permalink
fix barchart and forest_rsp as noticed by @mhallal1
Browse files Browse the repository at this point in the history
  • Loading branch information
gogonzo committed Sep 1, 2022
1 parent 9ff7c08 commit 2e0633e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/tm_g_barchart_simple.R
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,13 @@ srv_g_barchart_simple <- function(id,
})
quo <- teal.code::new_quosure(env = data)
quo <- teal.code::eval_code(quo, as.expression(merge_inputs()$expr))
teal::validate_has_data(quo[["ANL"]], 2)
quo
})

count_q <- shiny::reactive({
req(merged_data_q())
quo <- merged_data_q()
teal::validate_has_data(quo[["ANL"]], 2)
groupby_vars <- r_groupby_vars()

# count
Expand Down
8 changes: 7 additions & 1 deletion R/tm_g_forest_rsp.R
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,15 @@ srv_g_forest_rsp <- function(id,
input[[extract_input("paramcd", paramcd$filter[[1]]$dataname, filter = TRUE)]]
),
handlerExpr = {
req(anl_merged_q())
anl <- anl_merged_q()[["ANL"]]
aval_var <- anl_merged()$columns_source$aval_var

paramcd_level <- unlist(anl_merged()$filter_info$paramcd[[1]]$selected)
if (length(paramcd_level) == 0) return(NULL)

sel_param <- if (is.list(default_responses)) {
default_responses[[input[[extract_input("paramcd", paramcd$filter[[1]]$dataname, filter = TRUE)]]]]
default_responses[[paramcd_level]]
} else {
default_responses
}
Expand Down Expand Up @@ -558,6 +563,7 @@ srv_g_forest_rsp <- function(id,

# Prepare the analysis environment (filter data, check data, populate envir).
validate_checks <- shiny::reactive({
req(anl_merged_q())
q1 <- anl_merged_q()
adsl_filtered <- q1[[parentname]]
anl_filtered <- q1[[dataname]]
Expand Down

0 comments on commit 2e0633e

Please sign in to comment.