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.3.0 to 1.4.0

extent.js

3

index.js

@@ -7,4 +7,5 @@ /**

*/
exports.centrality = require('./centrality');
exports.density = require('./density.js');
exports.extent = require('./extent.js');
exports.modularity = require('./modularity.js');
exports.centrality = require('./centrality');

@@ -45,9 +45,9 @@ /**

if (!isGraph(graph))
throw new Error('graphology-modularity: the given graph is not a valid graphology instance.');
throw new Error('graphology-metrics/modularity: the given graph is not a valid graphology instance.');
if (graph.multi)
throw new Error('graphology-louvain: multi graphs are not handled.');
throw new Error('graphology-metrics/modularity: multi graphs are not handled.');
if (!graph.size)
throw new Error('graphology-modularity: the given graph has no edges.');
throw new Error('graphology-metrics/modularity: the given graph has no edges.');

@@ -54,0 +54,0 @@ // Solving options

{
"name": "graphology-metrics",
"version": "1.3.0",
"version": "1.4.0",
"description": "Miscellaneous graph metrics for graphology.",

@@ -22,2 +22,3 @@ "main": "index.js",

"density",
"extent",
"graph",

@@ -46,5 +47,5 @@ "graphology",

"chai": "^4.0.0",
"eslint": "^4.10.0",
"graphology": "^0.11.0",
"mocha": "^4.0.1"
"eslint": "^4.18.2",
"graphology": "^0.11.1",
"mocha": "^4.1.0"
},

@@ -56,4 +57,4 @@ "eslintConfig": {

"graphology-utils": "^1.1.1",
"lodash": "^4.17.4"
"lodash": "^4.17.5"
}
}

@@ -18,2 +18,3 @@ [![Build Status](https://travis-ci.org/graphology/graphology-metrics.svg)](https://travis-ci.org/graphology/graphology-metrics)

* [Density](#density)
* [Extent](#extent)
* [Modularity](#modularity)

@@ -64,2 +65,27 @@

### Extent
Computes the extent - min, max - of a node or edge's attribute.
```js
import extent from 'graphology-metrics/extent';
// Retrieving a single node attribute's extent
extent(graph, 'size');
>>> [1, 34]
// Retrieving multiple node attributes' extents
extent(graph, ['x', 'y']);
>>> {x: [-4, 3], y: [-34, 56]}
// For edges
extent.edgeExtent(graph, 'weight');
>>> [0, 5.7]
```
*Arguments*
* **graph** *Graph*: target graph.
* **attributes** *string|array*: single attribute names or array of attribute names.
### Modularity

@@ -66,0 +92,0 @@

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