christophergandrud / networkD3

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

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

Closed lewinfox closed 11 months 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.