user5287246
user5287246

Reputation:

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?

Upvotes: 2

Views: 117

Answers (1)

Marcin
Marcin

Reputation: 8044

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,';'), '}'))

Upvotes: 2

Related Questions