gpt4 book ai didi

r - 折叠absolutePanel发光吗?

转载 作者:行者123 更新时间:2023-12-04 13:26:32 24 4
gpt4 key购买 nike

按照superZip(http://shiny.rstudio.com/gallery/superzip-example.html)的示例,可以在光泽中创建一个折叠absoltePanel,如果有很多控件和输出,则可以折叠到右下角。

感谢您的任何建议。

这是absolutePanel的最小示例:

library(shiny)

ui <- shinyUI(bootstrapPage(
absolutePanel(
id = "controls", class = "panel panel-default", fixed = TRUE,
draggable = TRUE, top = 60, left = "auto", right = 20, bottom = "auto",
width = 330, height = "auto",
checkboxInput('input_draw_point', 'Draw point', FALSE ),
verbatimTextOutput('summary'))
))

server <- shinyServer(function(input, output, session) {
output$summary <- renderPrint(print(cars))

})

shinyApp(ui = ui, server = server)

最佳答案

Bootstrap具有创建折叠面板的功能。但是我不确定这是最好的方法:

library(shiny)

ui <- shinyUI(bootstrapPage(
absolutePanel(
id = "controls", class = "panel panel-default", fixed = TRUE,
draggable = TRUE, top = 60, left = "auto", right = 20, bottom = "auto",
width = 330, height = "auto",
HTML('<button data-toggle="collapse" data-target="#demo">Collapsible</button>'),
tags$div(id = 'demo', class="collapse",
checkboxInput('input_draw_point', 'Draw point', FALSE ),
verbatimTextOutput('summary')))
))

server <- shinyServer(function(input, output, session) {
output$summary <- renderPrint(print(cars))

})

shinyApp(ui = ui, server = server)

关于r - 折叠absolutePanel发光吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35175167/

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