Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught RangeError: Maximum call stack size exceeded #72

Closed
kkatusic opened this issue Aug 29, 2022 · 6 comments · Fixed by #74
Closed

Uncaught RangeError: Maximum call stack size exceeded #72

kkatusic opened this issue Aug 29, 2022 · 6 comments · Fixed by #74
Labels
bug Something isn't working
Milestone

Comments

@kkatusic
Copy link

When I using this array of data:

const chartDataTest = [ { from: 'User1', to: 'User2', flow: 23.67 }, { from: 'User1', to: 'User3', flow: 25.33 }, { from: 'User1', to: 'User4', flow: 41 }, { from: 'User1', to: 'User5', flow: 31.33 }, { from: 'User1', to: 'User6', flow: 11.33 }, { from: 'User1', to: 'User7', flow: 15.13 }, { from: 'User1', to: 'User8', flow: 2.67 }, { from: 'User1', to: 'User9', flow: 1.1 }, { from: 'User1', to: 'User10', flow: 8 }, { from: 'User1', to: 'User11', flow: 18.33 }, { from: 'User1', to: 'User3', flow: 52.33 }, { from: 'User1', to: 'User12', flow: 5.33 }, { from: 'User1', to: 'User13', flow: 16 }, { from: 'User1', to: 'User14', flow: 18.33 }, { from: 'User1', to: 'User7', flow: 16.67 }, { from: 'User1', to: 'User14', flow: 0.67 }, { from: 'User1', to: 'User4', flow: 0.43 }, { from: 'User1', to: 'User8', flow: 1 }, { from: 'User1', to: 'User11', flow: 4 }, { from: 'User1', to: 'User10', flow: 2.47 }, { from: 'User1', to: 'User15', flow: 48.87 }, { from: 'User1', to: 'User7', flow: 9.13 }, { from: 'User1', to: 'User12', flow: 6 }, { from: 'User1', to: 'User10', flow: 3.13 }, { from: 'User1', to: 'User14', flow: 22.67 }, { from: 'User1', to: 'User7', flow: 2.53 }, { from: 'User1', to: 'User8', flow: 3.67 }, { from: 'User1', to: 'User4', flow: 41.43 }, { from: 'User1', to: 'User5', flow: 20.33 }, { from: 'User1', to: 'User6', flow: 5.03 }, { from: 'User1', to: 'User3', flow: 52.5 }, { from: 'User1', to: 'User16', flow: 1.7 }, { from: 'User1', to: 'User1', flow: 1.33 }, { from: 'User1', to: 'User1', flow: 4.33 }, { from: 'User1', to: 'User6', flow: 15.67 }, { from: 'User1', to: 'User14', flow: 6.17 }, { from: 'User1', to: 'User9', flow: 6 }, { from: 'User4', to: 'User17', flow: 17.33 }, { from: 'User5', to: 'User12', flow: 1.33 }, { from: 'User6', to: 'User10', flow: 2.13 }, { from: 'User7', to: 'User17', flow: 19.67 }, { from: 'User9', to: 'User4', flow: 3.33 } ];

I'm getting error:

chartjs-chart-sankey.esm.js:109 Uncaught RangeError: Maximum call stack size exceeded at nodeCount (chartjs-chart-sankey.esm.js:109:1) at chartjs-chart-sankey.esm.js:109:1 at Array.reduce (<anonymous>) at nodeCount (chartjs-chart-sankey.esm.js:109:1) at chartjs-chart-sankey.esm.js:109:1 at Array.reduce (<anonymous>) at nodeCount (chartjs-chart-sankey.esm.js:109:1) at chartjs-chart-sankey.esm.js:109:1 at Array.reduce (<anonymous>) at nodeCount (chartjs-chart-sankey.esm.js:109:1)

when I reduce array in half everything works fine.

@MauriceHartmann
Copy link

MauriceHartmann commented Sep 14, 2022

{ from: 'User1', to: 'User1', flow: 1.33 } This is very likely the problem. As it is in the latter half of the array it works when you cut it in half. See: #24

@kkatusic
Copy link
Author

Thx @MauriceHartmann for reply, I removed that same users from and to, but still getting same error.
I'm using array that has 584 records :(

@MauriceHartmann
Copy link

I can only test your provided example. Have you also removed { from: 'User1', to: 'User1', flow: 4.33 }?

Interestingly your example worked for me, if I set priority: {} as dataset option. That also fixed a visual bug for me. So you can try that too.

@kkatusic
Copy link
Author

I tried, but same error, sorry I ask and I can provide you data: https://kkatusic.com/testdata.txt
you can check it and try it. Thx

@kurkle
Copy link
Owner

kurkle commented Sep 16, 2022

Took a quick look and the data does not contain any direct loops.
I'll take a closer look with the provided data.

@kurkle kurkle added the bug Something isn't working label Sep 16, 2022
@kurkle kurkle added this to the 0.9.1 milestone Sep 16, 2022
@kurkle
Copy link
Owner

kurkle commented Sep 16, 2022

So the data is circular. After preventing the error, it looks like this (anonymized):

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants