Search code examples
rnetworkd3

netoworkD3: Visualization issues


I have created a network graph in R using networkD3.

The graph looks so congested.

enter image description here

So i tried to increase the distance between edges. when I pass in some value through linkDistance, the whole shape is distorted and some nodes disappear. I gave some arbitrary value 10 for all the edges.

enter image description here

What am I doing wrong?


Solution

  • The linkDistance looks like to be a value to multiple the distance between nodes. Maybe you should change this to 2 or 3?

    For linkDistance you can use javascript functions like:

    value <- 1.3
    linkDistance=JS('function(d) {', paste('return d.value *', value,';'), '}'))