Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphology-metrics

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphology-metrics - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

density.js

1

index.js

@@ -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;

8

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc