gpt4 book ai didi

r - 如何在 Shiny 的仪表板中制作信息按钮

转载 作者:行者123 更新时间:2023-12-04 16:40:31 25 4
gpt4 key购买 nike

我想在我 Shiny 的应用程序中显示一个信息按钮,用户可以单击该按钮,然后会弹出一个文本(信息)框,其中包含一些文本。这是为了让用户单击按钮以获取有关我 Shiny 应用程序某些部分的一般描述。

出于某种原因,我无法在 Shiny 或 Shiny 的仪表板中找到它。有谁知道我如何制作按钮?谢谢。

最佳答案

有一个名为 rintrojs 的简洁包,它使您能够描述 Shiny 应用程序的操作,您可以将任何对象包装到其中。更多示例可以在这里找到 https://github.com/carlganz/rintrojs

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)

enter image description here

关于r - 如何在 Shiny 的仪表板中制作信息按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61811177/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com