【问题标题】:Shiny input Text popup闪亮的输入文本弹出窗口
【发布时间】:2015-05-15 04:49:04
【问题描述】:

我希望在启动闪亮的应用程序后立即出现一个 inpuText 弹出窗口,但我不知道该怎么做。 有人知道怎么做吗? 谢谢!

【问题讨论】:

    标签: popup shiny


    【解决方案1】:

    我想这可以使用 conditionalPanel 和一点 css 来完成:

    library(shiny)
    
    server <- function(input, output) { 
      userInput <- eventReactive(input$submit, input$text)
      output$usertext <- renderUI( p(paste("User Input:", userInput()))) 
      }
    
    ui <- shinyUI(fluidPage(
      sidebarLayout(
        mainPanel(uiOutput("usertext")),        
        conditionalPanel(
          condition = "input.submit == 0", 
          wellPanel(style = "position: absolute; width: 30%; left: 35%; top: 40%; 
                             box-shadow: 10px 10px 15px grey;",
                    textInput("text", "Text Input:"),
                    actionButton("submit", "Submit"))
          )
        )
      )
    )
    shinyApp(ui = ui, server = server)
    

    【讨论】:

      【解决方案2】:

      shinyBS 包允许您创建工具提示和弹出框引导样式。它已经在 CRAN 上,所以你可以使用 install.packages("shinyBS") 安装它。见:https://ebailey78.github.io/shinyBS/

      【讨论】:

        猜你喜欢
        • 2017-02-27
        • 2017-01-10
        • 2016-09-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-04-07
        • 2016-08-31
        • 2016-03-23
        相关资源
        最近更新 更多