0
uiOutput에 여러 플롯을 플롯하기위한 반짝이는 예제를 따르고 있습니다. 이 플롯을 포함하는 패널 (오른쪽 단어?)에 고정 된 높이가 있지만이 높이 이상의 플롯을 보려면 스크롤 할 수 있습니다.Shiny - 높이가 고정 된 스크롤 가능한 패널
고정 높이의 fixedRow 내에 uiOutput()을 포함 시키려고했으나 작동하지 않습니다.
나는
require(shiny)
ui <- shinyUI(fluidPage(
#fixedRow(uiOutput('plots'), height="100px")
uiOutput('plots')
))
server <- shinyServer(function(input, output) {
plots <- lapply(1:10, function(i){
plot(runif(50),main=sprintf('Plot nr #%d',i))
p <- recordPlot()
plot.new()
p
})
n.col <- 3
output$plots <- renderUI({
col.width <- round(12/n.col) # Calculate bootstrap column width
n.row <- ceiling(length(plots)/n.col) # calculate number of rows
cnter <<- 0 # Counter variable
# Create row with columns
rows <- lapply(1:n.row,function(row.num){
cols <- lapply(1:n.col, function(i) {
cnter <<- cnter + 1
plotname <- paste("plot", cnter, sep="")
column(col.width, plotOutput(plotname, height = 280, width = 250))
})
fluidRow(do.call(tagList, cols))
})
do.call(tagList, rows)
})
for (i in 1:length(plots)) {
local({
n <- i # Make local variable
plotname <- paste("plot", n , sep="")
output[[plotname]] <- renderPlot({
plots[[n]]
})
})
}
})
shinyApp(ui=ui,server=server)
위대한 작품입니다. 감사합니다. –
높이를 페이지 길이와 같게 만들 수 있음을 알고 있습니까? –
CSS를 높이 : 100 %로 변경할 수 있습니다. –