mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2026-06-19 04:27:30 +02:00
feat: button activation
This commit is contained in:
parent
a7d8fd4b36
commit
82ffc6a7a3
1 changed files with 19 additions and 13 deletions
|
|
@ -37,7 +37,7 @@ data_missings_ui <- function(id, ...) {
|
||||||
label = i18n$t("Evaluate"),
|
label = i18n$t("Evaluate"),
|
||||||
width = "100%",
|
width = "100%",
|
||||||
icon = shiny::icon("calculator"),
|
icon = shiny::icon("calculator"),
|
||||||
disabled = FALSE
|
disabled = TRUE
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
do.call(bslib::accordion_panel, c(
|
do.call(bslib::accordion_panel, c(
|
||||||
|
|
@ -87,19 +87,25 @@ data_missings_server <- function(id, data, max_level = 20, ...) {
|
||||||
)
|
)
|
||||||
|
|
||||||
output$missings <- shiny::reactive({
|
output$missings <- shiny::reactive({
|
||||||
shiny::req(data())
|
# shiny::req(data())
|
||||||
any(is.na(data()))
|
any(is.na(datar()))
|
||||||
})
|
})
|
||||||
shiny::outputOptions(output, "missings", suspendWhenHidden = FALSE)
|
shiny::outputOptions(output, "missings", suspendWhenHidden = FALSE)
|
||||||
|
|
||||||
observe({
|
shiny::observeEvent(list(datar(), input$missings_method, input$missings_var),
|
||||||
shiny::req(data())
|
{
|
||||||
if (!any(is.na(data()))) {
|
# shiny::req(data())
|
||||||
rv$feedback <- info_alert
|
# browser()
|
||||||
} else {
|
if (!any(is.na(datar()))) {
|
||||||
rv$feedback <- NULL
|
rv$feedback <- info_alert
|
||||||
}
|
shiny::updateActionButton(inputId = "act_miss", disabled = TRUE)
|
||||||
})
|
rv$table <- NULL
|
||||||
|
output$missings_table <- gt::render_gt({ NULL })
|
||||||
|
} else {
|
||||||
|
rv$feedback <- NULL
|
||||||
|
shiny::updateActionButton(inputId = "act_miss", disabled = FALSE)
|
||||||
|
}
|
||||||
|
},ignoreInit = TRUE)
|
||||||
|
|
||||||
|
|
||||||
output$feedback <- renderUI(rv$feedback)
|
output$feedback <- renderUI(rv$feedback)
|
||||||
|
|
@ -110,7 +116,7 @@ data_missings_server <- function(id, data, max_level = 20, ...) {
|
||||||
## Direct table export would be nice
|
## Direct table export would be nice
|
||||||
|
|
||||||
shiny::observe(output$missings_method <- shiny::renderUI({
|
shiny::observe(output$missings_method <- shiny::renderUI({
|
||||||
shiny::req(data())
|
shiny::req(datar())
|
||||||
vectorSelectInput(
|
vectorSelectInput(
|
||||||
inputId = ns("missings_method"),
|
inputId = ns("missings_method"),
|
||||||
label = i18n$t("Analysis method for missingness overview"),
|
label = i18n$t("Analysis method for missingness overview"),
|
||||||
|
|
@ -130,7 +136,7 @@ data_missings_server <- function(id, data, max_level = 20, ...) {
|
||||||
# browser()
|
# browser()
|
||||||
if (input$missings_method == "predictors") {
|
if (input$missings_method == "predictors") {
|
||||||
label <- i18n$t("Select a variable for grouped overview")
|
label <- i18n$t("Select a variable for grouped overview")
|
||||||
df <- data_type_filter(data(), type = c("categorical", "dichotomous"))
|
df <- data_type_filter(datar(), type = c("categorical", "dichotomous"))
|
||||||
col_subset <- c("none", names(df))
|
col_subset <- c("none", names(df))
|
||||||
} else {
|
} else {
|
||||||
label <- i18n$t("Select outcome variable for overview")
|
label <- i18n$t("Select outcome variable for overview")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue