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

TypeError: nodes[0] is undefined - custom priority parameter #79

Open
Mihailoff opened this issue Oct 10, 2022 · 2 comments
Open

TypeError: nodes[0] is undefined - custom priority parameter #79

Mihailoff opened this issue Oct 10, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@Mihailoff
Copy link

I'm using a custom priority parameter and getting the following error TypeError: nodes[0] is undefined

nextYStart = nodes[0].to.filter(to => to.node.x > x + 1).reduce((acc, cur) => acc + cur.flow, 0) || 0;

nodes[0] assumes that there is always at least one element and this is not true in my case.

chartjs-chart-sankey@0.11.0
chart.js@3.8.2

@Mihailoff
Copy link
Author

Don't know if this is related or not. In my data set, if I filter items with flow > 1 the error goes away.

@kurkle kurkle added the bug Something isn't working label Oct 12, 2022
@kurkle
Copy link
Owner

kurkle commented Oct 12, 2022

If you can, please provide a codepen or equivalent that reproduces the issue.

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

No branches or pull requests

2 participants