Picker input not appearing on clicking the circle in R shiny

617 views Asked by At

The script when executed creates a red circle icon and a reactive scatterplot below. I have made the script such that upon choosing a choice "A","B","C", we are able to update the plot dynamically. However, clicking the red circle, I just the see the first choice in the dropdown. I want to see all the choices in this dropdown. I shall attach the screenshot for you.

## app.R ##
library(shiny)
library(shinydashboard)
library(shinyWidgets)

ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(
),
dashboardBody(
dropdownButton(
pickerInput(inputId = "statnames", 
              label = "", 
              choices = c("A", 
                          "B", 
                          "C", 
                          "D", 
                          "E", 
                          "F"), 
              choicesOpt = list(icon = c("glyphicon glyphicon-arrow-right", 
                                         "glyphicon glyphicon-cog", 
                                         "glyphicon glyphicon-play", 
                                         "glyphicon glyphicon-ok-sign", 
                                         "glyphicon glyphicon-euro", 
                                         "glyphicon glyphicon-music")), 
              options = list(`icon-base` = "")),
  circle = TRUE, status = "danger", icon = icon("gear"), width = "300px",
  tooltip = tooltipOptions(title = "Click to see inputs !")),
  plotOutput("state")
  )
  )
server <- function(input, output) 
{
output$state = renderPlot(
if(input$statnames == "A")
 plot(iris$Sepal.Length)
else
 if(input$statnames == "B")
   plot(iris$Sepal.Width)
else
 if(input$statnames == "C")
   plot(iris$Petal.Width)
else
 if(input$statnames == "D")
   plot(iris$Petal.Length)
else
 if(input$statnames == "E")
   plot(iris$Sepal.Width)
else
 if(input$statnames == "F")
   plot(iris$Sepal.Length)
else
 return()
 )
 }
 shinyApp(ui, server)

0

There are 0 answers