Question

The following page loads in Chrome, but in Firefox/IE the error "too much recursion" happens in the crossfilter.js script (crossfilter.js).

Link:http://bit.ly/1epx0Gs

How can this be avoided (or debugged)?

EDIT

Turns out that Chrome can parse dates with dashes ("6-12-2013"), but firefox/ie need spaces ("6 12 2013")

Was it helpful?

Solution

There's not really any way I can verify that this is the problem without a runnable example, but you probably have non-naturally-ordered values in your dimensions. You need to cast your dimension values and make sure that all your values are valid. The relevant section looks to be:

self.data.push({
            index:index,
            starttime:new Date(d.starttime),
            sex:d.gender == '' ? 'Non-Subscriber' : d.gender,
            value:d.count
        })

I'd at least change this to:

self.data.push({
                index:+index,
                starttime:new Date(d.starttime),
                sex:d.gender == '' ? 'Non-Subscriber' : '' + d.gender,
                value:+d.count
            })

The Date() could still be tripping you up if you have invalid d.starttime values, so if you are still getting the error you may want to try replacing it with just "new Date()".

Again, no guarantee that's causing your issue, but when I get these recursion errors, this is usually the cause.

OTHER TIPS

I just encountered the same problem, but the solution was not in the date format but in the encoding of the JS-file itself. Maybe this will help someone else.

I was using following dimension to do some filtering:

CF_data = crossfilter(data);
CF_data_id = CF_data.dimension(function(d) { return  +d.properties['Código']; });

Notice the spanish "o" character in the selector of the return statement.

And the following error was thrown:

# too much recursion crossfilter.js:174:9

After checking everything, I noticed that my file was suddenly encoded in ANSI and not in UTF8. So in notepadd++ I converted the file back to UTF8 and the error was gone.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top