Skip to content

Commit 344dfb1

Browse files
committed
Improvements for the gexf plugin
The plugin is now able to understand some edge viz attributes such as thickness and color.
1 parent 781988d commit 344dfb1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

plugins/sigma.parsers.gexf/sigma.parsers.gexf.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,16 @@
5757
obj = arr[i];
5858

5959
obj.id = typeof obj.id === 'string' ? obj.id : edgeId();
60-
obj.size = obj.weight;
6160
obj.source = '' + obj.source;
6261
obj.target = '' + obj.target;
62+
63+
if (obj.viz && typeof obj.viz === 'object') {
64+
obj.color = obj.viz.color;
65+
obj.size = obj.viz.thickness;
66+
}
67+
68+
// Weight over viz.thickness?
69+
obj.size = obj.weight;
6370
}
6471

6572
// Update the instance's graph:

0 commit comments

Comments
 (0)