graphology-distances
Calculate euclidean distances of edges for graphology
.
Installation
npm install --save graphology-distances
Usage
Note: your graph must have numeric attributes x
and y
for all nodes! Make sure you pass your graph through a layout algorithm prior to running this algorithm.
; // ... // To retrieve the distances between nodes that have edgesconst dist = ; // To directly assign distance as an edge attributedistances;
Arguments
- graph Graph: graph on which you want to calculate distances between nodes