christophergandrud / networkD3

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

Use different data columns to derive linkWidth and linkDistance #263

Closed Jesse-Kerr closed 4 years ago

Jesse-Kerr commented 5 years ago

Thank you for this great library. I was wondering if it is possible to use different columns in your dataset for the linkDistance and the linkWidth? In the examples listed, it uses JS("function(d) { return Math.sqrt(d.value); }"). But I would want to use value for linkWidth and another column for linkDistance, or vice versa. I imagine there is a Javascript way to do thus, but I am not very skilled in Javascript.

Thanks for the help!

cjyetman commented 4 years ago

answered on StackOverflow here