graphology-operators
Advanced tools
Comparing version 1.4.3 to 1.5.0
@@ -5,4 +5,6 @@ export {default as disjointUnion} from './disjoint-union'; | ||
export {default as toDirected} from './to-directed'; | ||
export {default as toMixed} from './to-mixed'; | ||
export {default as toMulti} from './to-multi'; | ||
export {default as toSimple} from './to-simple'; | ||
export {default as toUndirected} from './to-undirected'; | ||
export {default as union} from './union'; |
@@ -11,4 +11,6 @@ /** | ||
exports.toDirected = require('./to-directed.js'); | ||
exports.toMixed = require('./to-mixed.js'); | ||
exports.toMulti = require('./to-multi.js'); | ||
exports.toSimple = require('./to-simple.js'); | ||
exports.toUndirected = require('./to-undirected.js'); | ||
exports.union = require('./union.js'); |
{ | ||
"name": "graphology-operators", | ||
"version": "1.4.3", | ||
"version": "1.5.0", | ||
"description": "Miscellaneous operators for graphology.", | ||
@@ -14,2 +14,4 @@ "main": "index.js", | ||
"to-directed.js", | ||
"to-mixed.js", | ||
"to-multi.js", | ||
"to-undirected.js", | ||
@@ -16,0 +18,0 @@ "to-simple.js", |
@@ -26,2 +26,4 @@ # Graphology Operators | ||
- [toDirected](#todirected) | ||
- [toMixed](#tomixed) | ||
- [toMulti](#tomulti) | ||
- [toSimple](#tosimple) | ||
@@ -54,3 +56,3 @@ - [toUndirected](#toundirected) | ||
- **graph** _Graph_: target graph. | ||
- **nodes** _array|Set|function_: either an array of nodes to keep, or a set of nodes to keep or a function taking a node's key and its attributes and tasked to filter the nodes to keep. | ||
- **nodes** _array\|Set\|function_: either an array of nodes to keep, or a set of nodes to keep or a function taking a node's key and its attributes and tasked to filter the nodes to keep. | ||
@@ -137,5 +139,33 @@ ### reverse | ||
- **graph** _Graph_: target graph. | ||
- **mergeOrOptions** _?function|object_: either a merging function or an options object: | ||
- **mergeOrOptions** _?function\|object_: either a merging function or an options object: | ||
- **mergeEdge** _?function_: merging function to use. | ||
### toMixed | ||
Returns the given graph as mixed. | ||
If an already mixed graph is passed, the function will only return a copy of it. | ||
```js | ||
import {toMixed} from 'graphology-operators'; | ||
// Alternatively, to load only the relevant code: | ||
import toMixed from 'graphology-operators/to-mixed'; | ||
const mixedGraph = toMixed(graph); | ||
``` | ||
### toMulti | ||
Returns the given graph as multi. | ||
If an already multi graph is passed, the function will only return a copy of it. | ||
```js | ||
import {toMulti} from 'graphology-operators'; | ||
// Alternatively, to load only the relevant code: | ||
import toMulti from 'graphology-operators/to-multi'; | ||
const mixedGraph = toMulti(graph); | ||
``` | ||
### toSimple | ||
@@ -142,0 +172,0 @@ |
/** | ||
* Graphology Operators To Directed Caster | ||
* ========================================== | ||
* ======================================== | ||
* | ||
@@ -5,0 +5,0 @@ * Function used to cast any graph to a directed one. |
23703
23
461
213