-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.json-hierarchy.html
56 lines (47 loc) · 1.24 KB
/
test.json-hierarchy.html
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
52
53
54
55
56
<!DOCTYPE html>
<html lang="zh" class="">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="https://cdn.metroui.org.ua/v4/css/metro-all.min.css">
<style>
.link {
stroke: #ccc;
}
.node text {
pointer-events: none;
font: 10px sans-serif;
}
</style>
</head>
<body>
<div>
<span>JSON file: </span>
<input id="file" name="file" type="text" value="https://api.github.com/meta"></input>
<button onclick="process();">PROCESS</button>
</div>
<div id="container"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.metroui.org.ua/v4/js/metro.min.js"></script>
<script src="./lib/linq.js"></script>
<script src="https://d3js.org/d3.v5.js"></script>
<script src="./lib/d3/d3-tip.js"></script>
<script src="./lib/json-hierarchy.js"></script>
<script>
var params = {
svgContainer: "container",
width: 960,
height: 600,
};
JsonHierarchy = $.extend(JsonHierarchy, params);
JsonHierarchy.init();
function process(){
var url = document.getElementById("file").value;
JsonHierarchy.process(url);
}
// test:
// √ http://api.nobelprize.org/v1/country.json
// √ http://httpbin.org/user-agent
// √ https://api.github.com/meta
</script>
</body>
</html>