graphology-operators
Advanced tools
Comparing version 1.4.2 to 1.4.3
{ | ||
"name": "graphology-operators", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"description": "Miscellaneous operators for graphology.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -114,2 +114,4 @@ # Graphology Operators | ||
If passing a multi graph, undirected edges will only be converted as pairs ofmutual ones and will never be merged. | ||
```js | ||
@@ -159,2 +161,4 @@ import {toDirected} from 'graphology-operators'; | ||
If passing a multi graph, directed edges will only be converted as undirected ones and will never be merged. | ||
```js | ||
@@ -161,0 +165,0 @@ import {toUndirected} from 'graphology-operators'; |
@@ -35,5 +35,10 @@ /** | ||
var existingOutEdge = | ||
graph.type === 'mixed' && directedGraph.edge(source, target); | ||
!graph.multi && | ||
graph.type === 'mixed' && | ||
directedGraph.edge(source, target); | ||
var existingInEdge = | ||
graph.type === 'mixed' && directedGraph.edge(target, source); | ||
!graph.multi && | ||
graph.type === 'mixed' && | ||
directedGraph.edge(target, source); | ||
@@ -40,0 +45,0 @@ if (existingOutEdge) { |
@@ -34,13 +34,15 @@ /** | ||
graph.forEachDirectedEdge(function (edge, attr, source, target) { | ||
var existingEdge = undirectedGraph.edge(source, target); | ||
if (!graph.multi) { | ||
var existingEdge = undirectedGraph.edge(source, target); | ||
if (existingEdge) { | ||
// We need to merge | ||
if (mergeEdge) | ||
undirectedGraph.replaceEdgeAttributes( | ||
existingEdge, | ||
mergeEdge(undirectedGraph.getEdgeAttributes(existingEdge), attr) | ||
); | ||
if (existingEdge) { | ||
// We need to merge | ||
if (mergeEdge) | ||
undirectedGraph.replaceEdgeAttributes( | ||
existingEdge, | ||
mergeEdge(undirectedGraph.getEdgeAttributes(existingEdge), attr) | ||
); | ||
return; | ||
return; | ||
} | ||
} | ||
@@ -47,0 +49,0 @@ |
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
21159
411
183