graphology-utils
Advanced tools
Comparing version 1.1.2 to 1.2.0
@@ -7,6 +7,5 @@ /** | ||
*/ | ||
var isGraph = require('./is-graph.js'), | ||
isGraphConstructor = require('./is-graph-constructor.js'); | ||
exports.isGraph = isGraph; | ||
exports.isGraphConstructor = isGraphConstructor; | ||
exports.addPath = require('./add-path.js'); | ||
exports.addStar = require('./add-star.js'); | ||
exports.isGraph = require('./is-graph.js'); | ||
exports.isGraphConstructor = require('./is-graph-constructor.js'); |
{ | ||
"name": "graphology-utils", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "Miscellaneous utils for graphology.", | ||
@@ -35,6 +35,6 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@yomguithereal/eslint-config": "^3.0.0", | ||
"eslint": "^3.5.0", | ||
"graphology": "^0.7.1", | ||
"mocha": "^3.0.2" | ||
"@yomguithereal/eslint-config": "^4.0.0", | ||
"eslint": "^4.18.2", | ||
"graphology": "^0.11.1", | ||
"mocha": "^5.0.4" | ||
}, | ||
@@ -41,0 +41,0 @@ "eslintConfig": { |
@@ -15,5 +15,51 @@ [![Build Status](https://travis-ci.org/graphology/graphology-utils.svg)](https://travis-ci.org/graphology/graphology-utils) | ||
* [#.addPath](#addpath) | ||
* [#.addStar](#addstar) | ||
* [#.isGraph](#isgraph) | ||
* [#.isGraphConstructor](#isgraphconstructor) | ||
### #.addPath | ||
Function adding a path to the given graph. | ||
```js | ||
import Graph from 'graphology'; | ||
import {addPath} from 'graphology-utils'; | ||
// Alternatively, if you want to only load the relevant code: | ||
import addPath from 'graphology-utils/add-path'; | ||
const graph = new Graph(); | ||
addPath(graph, [1, 2, 3, 4, 5]); | ||
graph.edges().map(e => graph.extremities(e)); | ||
>>> [[1, 2], [2, 3], [3, 4], [4, 5]] | ||
``` | ||
*Arguments* | ||
* **graph** *Graph*: target graph. | ||
* **path** *array*: array of nodes representing the path to add. | ||
### #.addStar | ||
Function adding a star to the given graph. | ||
```js | ||
import Graph from 'graphology'; | ||
import {addStar} from 'graphology-utils'; | ||
// Alternatively, if you want to only load the relevant code: | ||
import addStar from 'graphology-utils/add-star'; | ||
const graph = new Graph(); | ||
addStar(graph, [1, 2, 3, 4, 5]); | ||
graph.edges().map(e => graph.extremities(e)); | ||
>>> [[1, 2], [1, 3], [1, 4], [1, 5]] | ||
``` | ||
*Arguments* | ||
* **graph** *Graph*: target graph. | ||
* **star** *array*: array of nodes representing the star to add. | ||
### #.isGraph | ||
@@ -41,2 +87,6 @@ | ||
*Arguments* | ||
* **value** *any*: value to test. | ||
### #.isGraphConstructor | ||
@@ -61,1 +111,5 @@ | ||
``` | ||
*Arguments* | ||
* **value** *any*: value to test. |
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
5896
113