Skip to content

Commit e8b5118

Browse files
committed
Merge remote-tracking branch 'origin/pr/85'
* origin/pr/85: Use required ID attribute when parsing GEXF
2 parents e8ccc2f + 633ec12 commit e8b5118

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugins/sigma.parseGexf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,18 @@ sigma.publicPrototype.parseGexf = function(gexfPath) {
121121
}
122122

123123
var edges = [];
124-
var edgeId = 0;
125124
var edgesNodes = gexf.getElementsByTagName('edges');
126125
for(i=0; i<edgesNodes.length; i++){
127126
var edgesNode = edgesNodes[i];
128127
var edgeNodes = edgesNode.getElementsByTagName('edge');
129128
for(j=0; j<edgeNodes.length; j++){
130129
var edgeNode = edgeNodes[j];
130+
var id = edgeNode.getAttribute('id');
131131
var source = edgeNode.getAttribute('source');
132132
var target = edgeNode.getAttribute('target');
133133
var label = edgeNode.getAttribute('label');
134134
var edge = {
135-
id: j,
135+
id: id,
136136
sourceID: source,
137137
targetID: target,
138138
label: label,
@@ -152,7 +152,7 @@ sigma.publicPrototype.parseGexf = function(gexfPath) {
152152
edge.attributes.push({attr:attr, val:val});
153153
}
154154

155-
sigmaInstance.addEdge(edgeId++,source,target,edge);
155+
sigmaInstance.addEdge(id,source,target,edge);
156156
}
157157
}
158158
};

0 commit comments

Comments
 (0)