-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo1.js
30 lines (30 loc) · 2.04 KB
/
demo1.js
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
treeData=JSON.parse(jsonstr);
treeJson = d3.json("data.json", function(error, treeData) {
treeData=JSON.parse(jsonstr);
dTree.init(treeData,
{
target: "#graph",
debug: true,
hideMarriageNodes: true,
marriageNodeSize: 5,
height: 800,
width: 1200,
callbacks: {
nodeClick: function(name, extra) {
},
nodeRightClick: function(name, extra) {
},
textRenderer: function(name, extra, textClass) {
if (extra && extra.nickname)
name = name + " (" + extra.nickname + ")";
return "<p align='center' class='" + textClass + "'>" + name + "</p>";
},
marriageClick: function(extra, id) {
alert('Clicked marriage node' + id);
},
marriageRightClick: function(extra, id) {
alert('Right-clicked marriage node' + id);
},
}
});
});