2
我在儀表板上工作,我想創建一個動態彈出框,即我們可以移動。 我可以創建一個彈出窗口,但這個是靜態的,我喜歡一個可以把它並將其移動到右側,左側...RShiny動態彈出菜單(可移動)
我彈出的一個例子:
library(shiny)
library(shinyBS)
shinyApp(
ui =
fluidPage(
sidebarLayout(
box(actionButton("tabBut", "View Table")),
mainPanel(
bsModal("modalExample", "Data Table", "tabBut", size = "large",
dataTableOutput("distTable"))))),
server =
function(input, output, session) {
output$distTable <- renderDataTable({
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = 30 + 1)
tab <- hist(x, breaks = bins, plot = FALSE)
tab$breaks <- sapply(seq(length(tab$breaks) - 1), function(i) {
paste0(signif(tab$breaks[i], 3), "-", signif(tab$breaks[i+1], 3))})
tab <- as.data.frame(do.call(cbind, tab))
colnames(tab) <- c("Bins", "Counts", "Density")
return(tab[, 1:3])},
options = list(pageLength=10))}
)
我希望用戶可以移動此窗口。 如果您有想要更改的選項,或者如果您知道BS以外的任何其他方法閃亮創建新窗口...
先謝謝您,並且對我的英語感到抱歉!
退房[superzip示例](http://shiny.rstudio.com/gallery/superzip-example.html)來查看他們如何使用'absolutePa nel',它允許你添加'draggable = T'。應該以最小的努力給你想要的東西。 – brittenb
真的非常感謝你的絕對panel也可以。 – CClaire