kurkle / chartjs-chart-sankey

Chart.js module for creating sankey diagrams
MIT License
142 stars 27 forks source link

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

Open Mihailoff opened 1 year ago

Mihailoff commented 1 year ago

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

https://github.com/kurkle/chartjs-chart-sankey/blob/9dbd19faa27a67000403197ca6940a2c2931e357/src/layout.js#L215

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 commented 1 year ago

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 commented 1 year ago

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