λλ‘λ μ€ν μκ°μ μμΈ‘ν μ μλ λ°©λ²μ΄ μμ΅λλ€. μ΄λ¬ν κ²½μ° λ°©μ¬ν μ§νλ₯ νμκΈ° λλ μμ§μ΄λ ν΄μΉ λ§λκ° μμΌλ©΄ μ μ©ν©λλ€.
https://groups.google.com/d/msg/shiny-discuss/a3TcQ2C_hS0/3H4zocpRD0AJ
λ λ€λ₯Έ κ°λ₯μ±μ λ¨μν μ€λ¬΄λ¬λ₯Ό λ μ 보μ΄κ² λ§λ€κ³ μ§νλ₯ κ°μ 1λ‘ μ€μ νλ κ²μ λλ€.
server <- function(input, output) {
output$plot <- renderPlot({
input$goPlot # Re-run when button is clicked
dat <- data.frame(x = rnorm(10), y = rnorm(10))
withProgress(message = 'Making plot', value = 1, {
Sys.sleep(20)
})
plot(dat$x, dat$y)
})
}
ui <- shinyUI(basicPage(
tags$head(tags$style(HTML("
.progress-striped .bar {
background-color: #149bdf;
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.6)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.6)), color-stop(0.75, rgba(255, 255, 255, 0.6)), color-stop(0.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.6) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0.6) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.6) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0.6) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.6) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0.6) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.6) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0.6) 75%, transparent 75%, transparent);
-webkit-background-size: 40px 40px;
-moz-background-size: 40px 40px;
-o-background-size: 40px 40px;
background-size: 40px 40px;
}
"))),
plotOutput('plot', width = "300px", height = "300px"),
actionButton('goPlot', 'Go plot')
))
shinyApp(ui = ui, server = server)
μμ μ μμ λ°μ λ³΄λ €κ³ νμ§λ§ ... μλνμ§ μλ κ² κ°μ΅λλ€ ...
λ΄ μλμ λν΄ μλλ₯Ό μ°Έμ‘°νμμμ€. λμμ μ£Όμλ©΄ κ°μ¬νκ² μ΅λλ€.
http://stackoverflow.com/questions/38339593/shiny-loading-bar-for-htmlwidgets
μ΄λ°κ²λ μ¨λλ κΉμ...?
https://getbootstrap.com/docs/3.4/components/#progress -animatedλ₯Ό μ¬μ©ν μ μλ€κ³ μκ°ν©λλ€.
@jcheng5 λ value = NA
λ₯Ό μ€μ νμ¬ "λΆνμ λͺ¨λ"λ₯Ό νμ±νν κ²μ μ μνμ΅λλ€. κ·Έλ¬λ μ΄κ²μ΄ "μ λλ©μ΄μ
"μ΄λΌκ³ νλ κ²½μ° animated
맀κ°λ³μλ₯Ό μΆκ°νλ κ²μ΄ λ μ μ°ν μ μμΌλ―λ‘ withProgress(..., value = 1, animate = TRUE)
κ°μ₯ μ μ©ν λκΈ
λ λ€λ₯Έ κ°λ₯μ±μ λ¨μν μ€λ¬΄λ¬λ₯Ό λ μ 보μ΄κ² λ§λ€κ³ μ§νλ₯ κ°μ 1λ‘ μ€μ νλ κ²μ λλ€.