Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 如何在闪亮的仪表板中制作信息按钮_R_Shiny_Shinydashboard - Fatal编程技术网

R 如何在闪亮的仪表板中制作信息按钮

R 如何在闪亮的仪表板中制作信息按钮,r,shiny,shinydashboard,R,Shiny,Shinydashboard,我想在我闪亮的应用程序中显示一个信息按钮,用户可以在其中单击并弹出一个文本(信息)框,其中包含一些文本。这是供用户点击按钮,以获得有关我的闪亮应用程序的某些部分的一般说明 出于某种原因,我无法在闪亮或闪亮的仪表板上找到它。有人知道我怎么做按钮吗?谢谢 以下是使用软件包中的“dropMenu()”和注释中建议的a的两种可能性。在本例中,在仪表板标题中放置一个按钮,打开信息面板,或者单击仪表板主体中的一个操作按钮,以打开一个单独的窗口 在仪表板标题中放置一个按钮将允许它保持不变,而不管激活了哪个选项

我想在我闪亮的应用程序中显示一个信息按钮,用户可以在其中单击并弹出一个文本(信息)框,其中包含一些文本。这是供用户点击按钮,以获得有关我的闪亮应用程序的某些部分的一般说明


出于某种原因,我无法在闪亮或闪亮的仪表板上找到它。有人知道我怎么做按钮吗?谢谢

以下是使用软件包中的“dropMenu()”和注释中建议的a的两种可能性。在本例中,在仪表板标题中放置一个按钮,打开信息面板,或者单击仪表板主体中的一个操作按钮,以打开一个单独的窗口

在仪表板标题中放置一个按钮将允许它保持不变,而不管激活了哪个选项卡。如果需要始终访问菜单,这可能会有所帮助

library(shiny)
library(shinydashboard)
library(shinyWidgets)

ui <- dashboardPage(
  dashboardHeader( title = "app",
                   tags$li(class = "dropdown",
                           dropMenu(
                             dropdownButton("Info", status = 'success', icon = icon('info')),
                             h3(strong('Information')),
                             br(),
                             h5('This is really helpful'),
                             textInput('text', 'You can also put UI elements here'),
                             placement = "bottom",
                             arrow = TRUE)

                   )

  )
  ,
  dashboardSidebar(),
  dashboardBody(actionButton('help', 'Help'))
)

server <- function(input, output) { 

  observeEvent(input$help,{
    showModal(modalDialog(
      title = "Help!",
      "Information",
      textInput('text2', 'You can also put UI elements here')
    ))
  })
  }

shinyApp(ui, server)
库(闪亮)
图书馆(shinydashboard)
图书馆(shinyWidgets)

ui有一个名为
rintrojs
的简洁软件包,它让您能够描述闪亮应用程序的操作,您可以将任何对象包装到其中。更多的例子可以在这里找到

库(闪亮)
图书馆(rintrojs)

ui我可能会使用样式化的模态对话框来显示信息。
library(shiny)
library(rintrojs)

ui <- fluidPage(
    introjsUI(),
    column(2,
           br(),
           actionButton("help", "About this Page")
    ),
    column(2,
           introBox(
               selectInput("Task", label = "Select Task",choices =  c("Please select","Upload","Analyze Data")),
               data.step = 1,data.intro = "This is the selectInput called Task, you do xyz with this"
           )
    ),
    column(2,
           introBox(
               selectInput(
                   "breaks", "Breaks",
                   c("Sturges",
                     "Scott",
                     "Freedman-Diaconis",
                     "[Custom]" = "custom")),
               data.step = 2,data.intro = "This is the selectInput called breaks, you do xyz with this"
           )
    ),
    column(2,
           introBox(
               sliderInput("breakCount", "Break Count", min=1, max=1000, value=10),
               data.step = 3,data.intro = "This is the sliderInput called breakCount, you do xyz with this"
           )
    )
)


# Define server logic required to draw a histogram
server <- function(input, output,session) {
    observeEvent(input$help,
                 introjs(session, options = list("showBullets"="false", "showProgress"="true", 
                                                 "showStepNumbers"="false","nextLabel"="Next","prevLabel"="Prev","skipLabel"="Skip"))
    )

}

# Run the application 
shinyApp(ui = ui, server = server)