Thursday, 5 September 2013

Crossfilter javascript Maximum call stack size exceeded, no Nan

Crossfilter javascript Maximum call stack size exceeded, no Nan

I am playing around with crossfilter.js, see
https://github.com/square/crossfilter/wiki/API-Reference and
http://square.github.io/crossfilter/.
Supposedly the library is very good at handling data swiftly. So to test
it I first create an array of random numbers, a big one, with one million
rows.
function create_random_json(){
result = []
for (var i = 1000000 - 1; i >= 0; i--) {
result.push( { 'a': Math.random() , 'b' : Math.random() * 5 } )
}
return result
}
json_array = create_random_json()
df = crossfilter( json_array )
So far so good, but then when I try to do some basic crossfilter things,
things go terribly wrong.
df.dimension( function(d){ return d.total; });
RangeError: Maximum call stack size exceeded
I've read that this error can be caused by NaN values but all the values
that I have generated are obviously floats, so I am assuming something
else is causing the trouble. Any hints?

No comments:

Post a Comment