0
가정하자 나는 다음과 같은 응용 프로그램이 있습니다 (최소 재현 예)반짝이 관찰자와 dygraph에서 줌을 유지
library(shiny)
library(dygraphs)
library(xts)
runApp(
list(
ui =
mainPanel(
tableOutput(outputId="dataTable")
,dygraphOutput("testGraph")
),
server = function(input, output, session) {
myReact <- reactiveValues(df = data.frame(time_stamp = as.integer(Sys.time()), foo = rnorm(1)))
readTimestamp <- function() Sys.time()
readValue <- function(){
data.frame(time_stamp = as.integer(Sys.time()), foo = rnorm(1))
}
data <- reactivePoll(5*1000, session, readTimestamp, readValue) # Add to data frame every x seconds
observe({
myReact$df <- rbind(data(), isolate(myReact$df))
})
output$dataTable <- renderTable({
head(myReact$df, 10)
})
output$testGraph <- renderDygraph({
x <- myReact$df
x.ts <- xts(x = x[,2], order.by = as.POSIXct(x[[1]], origin = "1970-01-01"))
dygraph(x.ts, main = "This should work")
})
})
)
난 데 문제는이다 : 사용자가 reactivePoll()를 실행하는 (의 확대, 때 이 경우 5 초마다) reactiveValues ()에 추가하면 다이 그래프가 다시 렌더링되고 축소됩니다. 확대/축소를 유지할 수있는 방법이 있습니까?