-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest422.html
More file actions
51 lines (49 loc) · 1.27 KB
/
Copy pathtest422.html
File metadata and controls
51 lines (49 loc) · 1.27 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
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<meta charset="utf-8">
<style>
#btn1 {
position:absolute;
left:25%;
top:10%;
}
</style>
<body>
<button id="btn1">显示/隐藏</button>
<button id="btn2">刷新</button>
<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_Tree22.js"></script>
<script>
$("#btn1").on("click", function() {
$(".t123").toggle();
})
$("#btn2").on("click", function() {
selectTree();
})
// 1电话 2车牌号 3微信 4QQ 5姓名 6身份证
// 7住址 8邮箱 9IMEI 10IMSI 11MAC 12护照 13微博 JSON.parse(JSON.stringify(datas))
var datas;
function selectTree() {
if(typeof datas == "undefined") {
$.get("data/test3.json?name=510790198010218790&group=6", function(data) {
// datas = JSON.parse(data);
datas = data;
showTree();
})
}else {
showTree();
}
}
selectTree();
function showTree() {
d3_Tree2("a",JSON.parse(JSON.stringify(datas)),
function(node) {// 单击节点回调函数
console.log(node,"###单击",node.group);
},
function(node,update,links,nodes) {// 双击节点回调函数
},
function(line) {
});
}
</script>