Closed shambhu112 closed 3 years ago
Refer app code here.
The Problem:
Link here for example - https://rstudio.cloud/project/2498232 Code below
library(shiny) library(tippy) ui <- fluidPage( # Application title titlePanel("Tippy Bug"), selectizeInput("dataset_selection", "Select Dataset", choices = c("iris" , "airquality") , multiple = FALSE, width = 400 , options = NULL ), uiOutput("conditional_checkboxes") ) server <- function(input, output) { names <- list("iris" , "airquality") data_r <- reactiveValues(name = names(1) , ds = iris) observe({ data_r$name <- input$dataset_selection if(data_r$name == "iris"){ data_r$ds <- iris }else{ data_r$ds <- airquality } }) output$conditional_checkboxes <- renderUI({ pretty_names <- snakecase::to_snake_case(colnames(data_r$ds )) dq <- SmartEDA::ExpData(data_r$ds , type = 2) dq$pretty_name <- pretty_names lapply(1:nrow(dq), function(i){ ids <- paste0(data_r$name , "_" , i) print(ids) cb <- create_pretty_checkbox_with_tippy(id = ids , dq[i,]) }) }) } create_pretty_checkbox_with_tippy <- function(id , dq , missing_threshhold = 0.0){ x <- dq$Per_of_Missing missing <- case_when( x > missing_threshhold ~ "high" , TRUE ~ "low") if("high" == missing){ ui <- tippy::with_tippy( element = shinyWidgets::prettyCheckbox( inputId = id , label = dq$pretty_name , value = FALSE , shape = "curve" , status = "danger" , inline = TRUE ) , tooltip = glue::glue("<strong> missing {x * 100}% </strong> of values") , allowHTML = TRUE ) }else{ ui <-tippy::with_tippy( element = shinyWidgets::prettyCheckbox( inputId = id , label = dq$pretty_name , value = TRUE , shape = "curve", status = "success" , inline = TRUE) , tooltip = glue::glue("type: {dq$Variable_Type}" ) , allowHTML = TRUE ) } ui } shinyApp(ui = ui, server = server)
here is a recreatable example of the above app https://rstudio.cloud/project/2498232
The dev version should fix this. I'm very sorry for the extremely late response. Feel free to reopen if it does not work.
Refer app code here.
The Problem:
Link here for example - https://rstudio.cloud/project/2498232
Code below