How to set the distance between nodes in react-vis-force?

1k Views Asked by At

I am having troble in figuring out, how to set the distance between nodes in react-vis-force. Is there anyway to dynamically set link length based on the individual link? For example, some nodes are further apart than others.

1

There are 1 best solutions below

0
On

Edges have the length property, have you tried that? If you define edges using vis.DataSet like this

edges = new vis.DataSet([edge1, edge2, ..]);

modifying edges[i].length should do the trick.