graphology-distances

1.0.1 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    2
  • 1.0.0
    0

Package Sidebar

Install

npm i graphology-distances

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

12.7 kB

Total Files

5

Last publish

Collaborators

  • staltz