Ocultar / mostrar saídas R brilhante
Estou tentando descobrir como mostrar e ocultar minhas saídas, como gráficos e tabelas, sempre que o usuário altera algo nos widjets. Por exemplo, eu tenho uma entrada deslizante para minha variável chamada "gender" com 2 opções: masculino e feminino. Eu também tenho um botão que executa estimativas quando o usuário clica nele. Quero ocultar as saídas sempre que o usuário altera pelo menos uma opção entre os diferentes widjets. Por exemplo, após uma estimativa, o usuário decide alterar apenas o nível de escolaridade e quando o usuário clica na caixa sliderInput, eu gostaria de ocultar os resultados anteriores.
Tentei usar o pacote R shinyjs e as funções hide / show, mas elas não estão funcionando para saídas.
Você tem alguma idéia de como fazer isso sem usar o pacote shinyjs?
Aqui está uma parte do meu código:
shinyUI(fluidPage(
sidebarLayout(
fluidRow(
column(4, wellPanel(
fluidRow(
column(5,selectInput("gender",
label = div("Sexe",style = "color:royalblue"),
choices = list("Male", "Female"),
selected = "Female")),
# other different widjets..
column(8, plotOutput('simulationChange')),
column(4, tableOutput('simulationChangeTable'),
tags$style("#simulationChangeTable table {font-size:9pt;background-color: #E5E4E2;font-weight:bold;margin-top: 121px; margin-left:-30px;overflow:hidden; white-space:nowrap;text-align:left;align:left;}",
media="screen",
type="text/css"),
fluidRow(
column(6, tableOutput('simulationChangeEsperance'),
tags$style("#simulationChangeEsperance table {font-size:9pt;background-color: #E5E4E2;font-weight:bold;margin-top: -10px; margin-left:-30px;overflow:hidden; white-space:wrap;word-break: break-word;width:173px;text-align:left;}"))
)
)
)
)
)
))
shinyServer(function(input, output, session) {
# part of my server.R code
observe({
if (input$gender|input$age|input$birthplace|input$education){
shinyjs::hide("simulationChange")
shinyjs::hide("simulationChangeTable")
shinyjs::hide("simulationChangeEsperance")
}
})
Obrigado.