christophergandrud / networkD3

D3 JavaScript Network Graphs from R
http://christophergandrud.github.io/networkD3
653 stars 268 forks source link

Fix use of `check_zero()` in `forceNetwork()` and `sankeyNetwork()` #282

Closed lewinfox closed 1 year ago

lewinfox commented 3 years ago

Fixes #281

Calling check_zero() too early in the function resulted in a bug where 1-indexed input would not be detected if either:

Moving check_zero() further down the functions and adding missing input checks for forceNetwork() fixes the issue.