r - ConditionalPannels not showing -
i having weird issue when using conditional panels.
i have similar this
shinyui(bootstrappage( selectinput(inputid = "grapht", label = "type of graph :", choices = c("x","y"), selected = "x"), conditionalpanel( condition = "input.grapht == 'x'", plotoutput(outputid = "plot1")), conditionalpanel( condition = "input.grapht == 'y'", splitlayout( cellwidths = c("50%", "50%"), plotoutput(outputid = "plot1"), plotoutput(outputid = "plot2") )) ))
if remove either of condition panels, other renders when select correct option. if keep both conditional panels nothing shows, don't error or message, it's not sending input. gives?
the problem have 2 outputs same id plot1
. if change in chunk outputid plot3
conditionalpanel( condition = "input.grapht == 'x'", plotoutput(outputid = "plot1")),
and render third plot on server side work.
example:
library(shiny) ui <- shinyui(bootstrappage( selectinput(inputid = "grapht", label = "type of graph :", choices = c("x","y"), selected = "x"), conditionalpanel( condition = "input.grapht == 'x'", plotoutput(outputid = "plot3")), conditionalpanel( condition = "input.grapht == 'y'", splitlayout( cellwidths = c("50%", "50%"), plotoutput(outputid = "plot1"), plotoutput(outputid = "plot2") )) )) server <- function(input, output) { output$plot1 <- renderplot({ plot(1) }) output$plot2 <- renderplot({ plot(1:10) }) output$plot3 <- renderplot({ plot(1:100) }) } shinyapp(ui, server)
Comments
Post a Comment