graphology-metrics
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -7,2 +7,3 @@ /** | ||
*/ | ||
exports.density = require('./density.js'); | ||
exports.modularity = require('./modularity.js'); |
@@ -89,2 +89,3 @@ /** | ||
node2 = bounds[1]; | ||
if (node1 === node2) | ||
@@ -91,0 +92,0 @@ continue; |
{ | ||
"name": "graphology-metrics", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Miscellaneous graph metrics for graphology.", | ||
"main": "index.js", | ||
"files": [ | ||
"density.js", | ||
"index.js", | ||
@@ -20,2 +21,3 @@ "modularity.js" | ||
"keywords": [ | ||
"density", | ||
"graph", | ||
@@ -43,5 +45,5 @@ "graphology", | ||
"@yomguithereal/eslint-config": "^3.0.0", | ||
"chai": "^3.5.0", | ||
"chai": "^4.0.0", | ||
"eslint": "^3.5.0", | ||
"graphology": "^0.7.1", | ||
"graphology": "^0.10.0", | ||
"mocha": "^3.0.2" | ||
@@ -48,0 +50,0 @@ }, |
@@ -15,7 +15,46 @@ [![Build Status](https://travis-ci.org/graphology/graphology-metrics.svg)](https://travis-ci.org/graphology/graphology-metrics) | ||
* [Density](#density) | ||
* [Modularity](#modularity) | ||
### Density | ||
Computes the density of the given graph. | ||
```js | ||
import {density} from 'graphology-metrics'; | ||
import density from 'graphology-metrics/density'; | ||
// Passing a graph instance | ||
const d = density(graph); | ||
// Passing the graph's order & size | ||
const d = density(order, size); | ||
// Or to force the kind of density being computed | ||
import { | ||
mixedDensity, | ||
directedDensity, | ||
undirectedDensity, | ||
multiMixedDensity, | ||
multiDirectedDensity, | ||
multiUndirectedDensity | ||
} from 'graphology-metric/density'; | ||
const d = undirectedDensity(mixedGraph); | ||
``` | ||
*Arguments* | ||
Either: | ||
* **graph** *Graph*: target graph. | ||
Or: | ||
* **order** *number*: number of nodes in the graph. | ||
* **size** *number*: number of edges in the graph. | ||
### Modularity | ||
Compute the modularity, given the graph and a partitioning | ||
Computes the modularity, given the graph and a partitioning | ||
@@ -22,0 +61,0 @@ ```js |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11595
6
236
83