Skip to content

Commit 5e3a1c3

Browse files
committed
minor change
1 parent 716a864 commit 5e3a1c3

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

plugins/sigma.parseGexf.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ sigma.publicPrototype.parseGexf = function(gexfPath) {
88
new XMLHttpRequest() :
99
new ActiveXObject('Microsoft.XMLHTTP');
1010

11-
if (gexfhttp.overrideMimeType) {
11+
if (gexfhttp.overrideMimeType) {
1212
gexfhttp.overrideMimeType('text/xml');
13-
}
13+
}
1414

1515
gexfhttp.open('GET', gexfPath, false);
1616
gexfhttp.send();
@@ -23,53 +23,53 @@ if (gexfhttp.overrideMimeType) {
2323
var nodesAttributes = []; // The list of attributes of the nodes of the graph that we build in json
2424
var edgesAttributes = []; // The list of attributes of the edges of the graph that we build in json
2525
var attributesNodes = gexf.getElementsByTagName('attributes'); // In the gexf (that is an xml), the list of xml nodes 'attributes' (note the plural 's')
26-
26+
2727
for(i = 0; i<attributesNodes.length; i++){
2828
var attributesNode = attributesNodes[i]; // attributesNode is each xml node 'attributes' (plural)
2929
if(attributesNode.getAttribute('class') == 'node'){
3030
var attributeNodes = attributesNode.getElementsByTagName('attribute'); // The list of xml nodes 'attribute' (no 's')
3131
for(j = 0; j<attributeNodes.length; j++){
3232
var attributeNode = attributeNodes[j]; // Each xml node 'attribute'
33-
33+
3434
var id = attributeNode.getAttribute('id'),
3535
title = attributeNode.getAttribute('title'),
3636
type = attributeNode.getAttribute('type');
37-
37+
3838
var attribute = {id:id, title:title, type:type};
3939
nodesAttributes.push(attribute);
40-
40+
4141
}
4242
} else if(attributesNode.getAttribute('class') == 'edge'){
4343
var attributeNodes = attributesNode.getElementsByTagName('attribute'); // The list of xml nodes 'attribute' (no 's')
4444
for(j = 0; j<attributeNodes.length; j++){
4545
var attributeNode = attributeNodes[j]; // Each xml node 'attribute'
46-
46+
4747
var id = attributeNode.getAttribute('id'),
4848
title = attributeNode.getAttribute('title'),
4949
type = attributeNode.getAttribute('type');
50-
50+
5151
var attribute = {id:id, title:title, type:type};
5252
edgesAttributes.push(attribute);
53-
53+
5454
}
5555
}
5656
}
57-
57+
5858
var nodes = []; // The nodes of the graph
5959
var nodesNodes = gexf.getElementsByTagName('nodes') // The list of xml nodes 'nodes' (plural)
60-
60+
6161
for(i=0; i<nodesNodes.length; i++){
6262
var nodesNode = nodesNodes[i]; // Each xml node 'nodes' (plural)
6363
var nodeNodes = nodesNode.getElementsByTagName('node'); // The list of xml nodes 'node' (no 's')
6464

6565
for(j=0; j<nodeNodes.length; j++){
6666
var nodeNode = nodeNodes[j]; // Each xml node 'node' (no 's')
67-
67+
6868
window.NODE = nodeNode;
6969

7070
var id = nodeNode.getAttribute('id');
7171
var label = nodeNode.getAttribute('label') || id;
72-
72+
7373
//viz
7474
var size = 1;
7575
var x = 100 - 200*Math.random();
@@ -105,10 +105,10 @@ if (gexfhttp.overrideMimeType) {
105105
parseFloat(colorNode.getAttribute('g')),
106106
parseFloat(colorNode.getAttribute('b')));
107107
}
108-
108+
109109
// Create Node
110110
var node = {label:label, size:size, x:x, y:y, attributes:[], color:color}; // The graph node
111-
111+
112112
// Attribute values
113113
var attvalueNodes = nodeNode.getElementsByTagName('attvalue');
114114
for(k=0; k<attvalueNodes.length; k++){
@@ -158,4 +158,4 @@ if (gexfhttp.overrideMimeType) {
158158
sigmaInstance.addEdge(id,source,target,edge);
159159
}
160160
}
161-
};
161+
};

0 commit comments

Comments
 (0)