-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest425.html
More file actions
41 lines (39 loc) · 993 Bytes
/
Copy pathtest425.html
File metadata and controls
41 lines (39 loc) · 993 Bytes
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
41
<!DOCTYPE html>
<meta charset="utf-8">
<style>
#btn1 {
position:absolute;
left:25%;
top:10%;
}
</style>
<body>
<div id="a" style="width:800px;height:600px;float:left;border:solid 1px #a0ffff;"></div>
<script src="jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="d3/d3.v3.min.js"></script>
<script type="text/javascript" src="d3_Tree425.js"></script>
<script>
var datas;
function selectTree() {
if(typeof datas == "undefined") {
$.get("data/test425.json?name=510790198010218790&group=6", function(data) {
// datas = JSON.parse(data);
datas = data;
showTree();
})
}else {
showTree();
}
}
selectTree();
function showTree() {
d3_Tree425("a",JSON.parse(JSON.stringify(datas)),
function(node) {// 单击节点回调函数
console.log(node.name,"###单击",node.group);
},
function(node,update,links,nodes) {// 双击节点回调函数
},
function(line) {// 点击线回调函数
});
}
</script>