Skip to content

Calculate euclidean distances of edges for graphology

License

Notifications You must be signed in to change notification settings

Yomguithereal/graphology-distances

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

import distances from 'graphology-distances';

// ...

// To retrieve the distances between nodes that have edges
const dist = distances(graph);

// To directly assign distance as an edge attribute
distances.assign(graph);

Arguments

  • graph Graph: graph on which you want to calculate distances between nodes

License

MIT

About

Calculate euclidean distances of edges for graphology

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%