christophergandrud / networkD3

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

center forceNetwork and reheat when updated #179

Closed cjyetman closed 7 years ago

cjyetman commented 7 years ago

This PR changes d3.forceX and d3.forceY to d3.forceCenter, which has a behavior, in D3v4, closer to what was intended (changes in D3v4 make d3.forceX and d3.forceY cause a drift from the top left corner). It also forces the the force simulation to "reheat" whenever it's updated, to resolve an issue when the plots are used in shiny and arguments are being updated interactively.

this PR resolve #176, #109, and #174