ramnathv / rCharts

Interactive JS Charts from R
http://rcharts.io
Other
1.19k stars 654 forks source link

Rickshaw is very slow is large data #286

Open pachevalier opened 10 years ago

pachevalier commented 10 years ago

I've tried to draw a simple time series plot with rCharts and Rickshaw. It works fine with a small amount of data (ie 300 points) but it's very slow with a large amount of data (ie 5,000 points). Is there any solution ?

ramnathv commented 10 years ago

Can you share some data and code so that we can investigate?

pachevalier commented 10 years ago

Here is my gist file : https://gist.github.com/blaquans/7155409. My problem may be due to Firefox. It seems to be a bit faster with Chrome.

timelyportfolio commented 10 years ago

It is slow, and one of the drawback of d3 with svg is its inability to handle big data. However, in general 5,000 is not large. If you are ok using something other than Rickshaw, you could try nvd3 like this.

fake$d <- as.numeric(as.POSIXct(fake$date)) * 1000
n1 <- nPlot( x ~ d, data = fake, type = "lineWithFocusChart")
n1$xAxis( tickFormat =
    "#!function(d){return d3.time.format('%b %y')(new Date(d))}!#"
)
n1

Let me know how it works.

ramnathv commented 10 years ago

Okay. I see it now. I am not sure if the rendering is slow due to Rickshaw. I will check and see what can be done.

ramnathv commented 10 years ago

@timelyportfolio is nvd3 fast? then the issue might be rickshaw and not a d3.js limitation. Or it could have something to do with our rickshaw code.

timelyportfolio commented 10 years ago

not fast, but faster. No, don't think it is our code, since nothing we do really controls that.

hit9 commented 10 years ago

I meet the same problem,