graphology-gexf
Advanced tools
Comparing version 0.7.2 to 0.7.3
@@ -193,12 +193,10 @@ /* eslint no-self-compare: 0 */ | ||
function collectNodeData(graph, format) { | ||
var nodes = graph.nodes(), | ||
node, | ||
data; | ||
var nodes = new Array(graph.order); | ||
var i = 0; | ||
for (var i = 0, l = nodes.length; i < l; i++) { | ||
node = nodes[i]; | ||
data = format(node, graph.getNodeAttributes(node)); | ||
graph.forEachNode(function(node, attr) { | ||
var data = format(node, attr); | ||
data.key = node; | ||
nodes[i] = data; | ||
} | ||
nodes[i++] = data; | ||
}); | ||
@@ -216,15 +214,13 @@ return nodes; | ||
function collectEdgeData(graph, reducer) { | ||
var edges = graph.edges(), | ||
edge, | ||
data; | ||
var edges = new Array(graph.size); | ||
var i = 0; | ||
for (var i = 0, l = edges.length; i < l; i++) { | ||
edge = edges[i]; | ||
data = reducer(edge, graph.getEdgeAttributes(edge)); | ||
graph.forEachEdge(function(edge, attr, source, target, _sa, _ta, undirected) { | ||
var data = reducer(edge, attr); | ||
data.key = edge; | ||
data.source = graph.source(edge); | ||
data.target = graph.target(edge); | ||
data.undirected = graph.isUndirected(edge); | ||
edges[i] = data; | ||
} | ||
data.source = source; | ||
data.target = target; | ||
data.undirected = undirected; | ||
edges[i++] = data; | ||
}); | ||
@@ -231,0 +227,0 @@ return edges; |
{ | ||
"name": "graphology-gexf", | ||
"version": "0.7.2", | ||
"version": "0.7.3", | ||
"description": "GEXF parser & writer for graphology.", | ||
@@ -40,5 +40,5 @@ "main": "index.js", | ||
"@yomguithereal/eslint-config": "^4.0.0", | ||
"eslint": "^7.15.0", | ||
"graphology": "^0.19.2", | ||
"graphology-types": "^0.19.0", | ||
"eslint": "^7.18.0", | ||
"graphology": "^0.19.3", | ||
"graphology-types": "^0.19.2", | ||
"mocha": "^8.2.1" | ||
@@ -56,3 +56,3 @@ }, | ||
"dependencies": { | ||
"graphology-utils": "^1.8.0", | ||
"graphology-utils": "^2.0.0", | ||
"xmldom": "^0.4.0", | ||
@@ -59,0 +59,0 @@ "xml-writer": "^1.7.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
31323
848
+ Addedgraphology-utils@2.5.2(transitive)
- Removedgraphology-utils@1.8.0(transitive)
Updatedgraphology-utils@^2.0.0