2015-01-14 5 views
0

rCharts 패키지로 수천 개의 점을 그려보고자하지만 기본 매개 변수가 약간 느립니다. turboThresold 매개 변수를 0으로 설정하려고 시도했지만 도움이되지 않았습니다.수천 개의 점을 그릴 때 rCharts 성능 향상

  • 100 점 음모를 꾸미고 : 00.05의
  • 플로팅 1,000 포인트 : 00.54의
  • 음모를 꾸미고 10000 개 포인트 : 17.00의

누구든지 향상시킬 수를 여기에

성능의 테이블 이 코드의 성능? 당신의 도움에 대한

library(shiny) 
library(rCharts) 
runApp(
    # User interface with 1 select box, 1 graph and 1 timer 
    list(ui = pageWithSidebar( 
    headerPanel(""), 
    sidebarPanel( 
     selectInput("value",NULL,choices=c(100,1000,10000), selected = 100) 
    ), 
    mainPanel(  
     showOutput("plot", "highcharts"), 
     textOutput("timer") 
    ) 
), 
    # server side 
    server = function(input, output){ 
    values<-reactiveValues() 
    values$timer <- NULL 
    # generating highcharts plot 
    output$plot <- renderChart2({ 
     x <- 1:input$value 
     df <- data.frame(x, x^2) 
     names(df) <- c("x","xpower2") 
     values$timer <- Sys.time() 
     plot <- Highcharts$new() 
     plot$series(
     data = toJSONArray2(df, json = F, names = F), 
     name = "xpower2", 
     type = "line" 
    ) 
     plot$plotOptions(series=list(turboThreshold=0)) 
     return(plot) 
    }) 
    # calculating time 
    output$timer <- renderText({ 
     input$value 
     isolate({ 
     values$timer <- Sys.time() - values$timer 
     return(paste("Time elapsed :", round(values$timer,3) , "seconds")) 
     }) 
    }) 
    } 
) 
) 

감사합니다, 매트 일반적으로

+0

이 명령은 도움이되지 않습니다 중 하나 플롯 $의 plotOptions (시리즈 = 목록 (애니메이션 = FALSE, enableMouseTracking = FALSE)) – mbh86

+0

시도 오는 –

+0

안녕하세요 세바스찬 그림자/애니메이션/마커를 해제합니다. 불행히도 개선이 없습니다. – mbh86

답변

0

, 나는 어떤 브라우저 그래프 패키지 브라우저에 약 3000 점보다는 더 이상 전송하지 권하고 싶습니다. 옵션은 무한하지만 데이터에 따라 다릅니다. 밖에서는 rCharts으로 속도를 높일 수 없지만 여기서는 ggvis입니다.

library(shiny);library(ggvis) 
runApp(
    list(ui = fluidPage(
    titlePanel('ggvis speed example'), 
    sidebarLayout( 
    sidebarPanel( 
     selectInput('points','Points To Plot', 
        choices=c(100,1000,10000,100000), selected = 1000) 
    ), 
    mainPanel(  
     ggvisOutput('ggvis') 
    ) 
)), 
    server = function(input, output){ 
    reactive({ 
     1:input$points %>%    
     data.frame('x'=.,'y'=.^2) %>% 
     ggvis(~x, ~y) %>% 
     layer_points() %>% 
     add_axis("y", title_offset = 70) %>% 
     add_tooltip(function(df) HTML(paste0('x: ',df$x,'<br>y: ',df$y))) 
    }) %>% bind_shiny('ggvis') 
    } 
) 
) 
+0

몇 가지 이유로 "ggvis"패키지를 사용할 수 없습니다. 내 시리즈를 보여줄 다른 방법을 찾아야 할 것 같아. 큰 시리즈를 작은 샘플로 샘플링하여 동일한 모양을 갖는 올바른 방법을 선택하려고합니다. – mbh86

+0

히트 맵? 목적에 따라 많은 점을 보여줄 수있는 명확한 방법이있을 것입니다. – ideamotor

+0

제 경우는 아니지만, 저는 시계열을 다루고 있습니다. – mbh86