Search code examples
javascriptvivagraphjs

Specify link weight in VivaGraphJS


How to specify a weight for a link in a VivaGraphJS graph? E.g. I want get a resulting social graph where a married couple is displayed closer than somebody only loosely known.

With the springLength I can define a general distance, but nothing that is specific per link.


Solution

  • Here is an example how to do it: customLinkLength.html

    Unfortunately there is no easy way to find best force layout arguments, which would suite all kind of graphs.