graphology-metrics
Advanced tools
Comparing version 1.9.0 to 1.10.0
/** | ||
* Graphology Degree | ||
* =================== | ||
* ================== | ||
* | ||
@@ -5,0 +5,0 @@ * Functions used to compute the degree of each node of a given graph. |
export {default as centrality} from './centrality'; | ||
export {default as density} from './density'; | ||
export {default as extent} from './extent'; | ||
export {default as layoutQuality} from './layout-quality'; | ||
export {default as modularity} from './modularity'; | ||
export {default as weightedDegree} from './weighted-degree'; | ||
export {default as weightedSize} from './weighted-size'; |
@@ -10,4 +10,5 @@ /** | ||
exports.extent = require('./extent.js'); | ||
exports.layoutQuality = require('./layout-quality'); | ||
exports.modularity = require('./modularity.js'); | ||
exports.weightedDegree = require('./weighted-degree.js'); | ||
exports.weightedSize = require('./weighted-size.js'); |
{ | ||
"name": "graphology-metrics", | ||
"version": "1.9.0", | ||
"version": "1.10.0", | ||
"description": "Miscellaneous graph metrics for graphology.", | ||
@@ -9,3 +9,4 @@ "main": "index.js", | ||
"*.d.ts", | ||
"centrality" | ||
"centrality", | ||
"layout-quality" | ||
], | ||
@@ -52,2 +53,3 @@ "scripts": { | ||
"graphology-generators": "^0.10.1", | ||
"graphology-layout": "^0.2.0", | ||
"mocha": "^7.0.1" | ||
@@ -64,2 +66,3 @@ }, | ||
"globals": { | ||
"Set": true, | ||
"Float64Array": true | ||
@@ -69,7 +72,8 @@ } | ||
"dependencies": { | ||
"graphology-shortest-path": "^1.1.1", | ||
"graphology-shortest-path": "^1.3.0", | ||
"graphology-types": "^0.16.0", | ||
"graphology-utils": "^1.6.1", | ||
"lodash": "^4.17.11" | ||
"lodash": "^4.17.11", | ||
"mnemonist": "^0.34.0" | ||
} | ||
} |
@@ -34,2 +34,8 @@ [![Build Status](https://travis-ci.org/graphology/graphology-metrics.svg)](https://travis-ci.org/graphology/graphology-metrics) | ||
*Layout quality metrics* | ||
* [Edge Uniformity](#edge-uniformity) | ||
* [Neighborhood Preservation](#neighborhood-preservation) | ||
* [Stress](#stress) | ||
### Density | ||
@@ -366,1 +372,41 @@ | ||
* **attribute** *string|array*: target categorical attribute or array of categorical attributes. | ||
### Edge Uniformity | ||
Computes the edge uniformity layout quality metric from the given graph having `x` and `y` positions attached to its nodes. Edge uniformity is the normalized standard deviation of edge length of the graph. Lower values should be synonym of better layout according to this particular metric. | ||
Runs in `O(E)`. | ||
```js | ||
import edgeUniformity from 'graphology-metrics/layout-quality/edge-uniformity'; | ||
edgeUniformity(graph); | ||
>>> ~1.132 | ||
``` | ||
### Neighborhood preservation | ||
Computes the "neighborhood preservation" layout quality metric from the given graph having `x` and `y` positions attached to its nodes. Neighborhood preservation is the average proportion of node neighborhood being the same both in the graph's topology and its 2d layout space. The metric is therefore comprised between `0` and `1`, `1` being the best, meaning that every node keeps its neighborhood perfectly intact within the layout space. | ||
Runs in approximately `O(N * log(N))`. | ||
```js | ||
import neighborhoodPreservation from 'graphology-metrics/layout-quality/neighborhood-preservation'; | ||
neighborhoodPreservation(graph); | ||
// >>> 0.456 | ||
``` | ||
### Stress | ||
Computes the "stress" layout quality metric from the given graph having `x` and `y` positions attached to its nodes. Stress is the sum of normalized delta between node topology distances and their layout space distances. Lower values should be synonym of better layout according to this particular metric. | ||
Runs in `O(N^2)`. | ||
```js | ||
import stress from 'graphology-metrics/layout-quality/stress'; | ||
stress(graph); | ||
// >>> ~24510.2914 | ||
``` |
67242
31
1545
411
5
7
+ Addedmnemonist@^0.34.0
+ Addedmnemonist@0.34.0(transitive)
+ Addedobliterator@1.6.1(transitive)