-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathgexfjs.js
More file actions
40 lines (29 loc) · 1.08 KB
/
gexfjs.js
File metadata and controls
40 lines (29 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
HTMLWidgets.widget({
name: "gexfjs",
type: "output",
factory: function(el, width, height) {
// create our sigma object and bind it to the element
// The GexFJS object is created before hand.
// var gf = new GexfJS(el.id);
return {
renderValue: function(x) {
// parse gexf data
var parser = new DOMParser();
var data = parser.parseFromString(x.data, "application/xml");
// Setting parameters
GexfJS.setParams({graphFile: x.path});
setGexfDoc(el.id, width, height);
},
resize: function(width, height) {
// forward resize on to sigma renderers
// for (var name in gf.renderers)
// gf.renderers[name].resize(width, height);
},
// Make the sigma object available as a property on the widget
// instance we're returning from factory(). This is generally a
// good idea for extensibility--it helps users of this widget
// interact directly with sigma, if needed.
s: GexfJS
};
}
});