-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.html
51 lines (41 loc) · 996 Bytes
/
example.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
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script type="text/javascript" src="./lib/bst.js"></script>
<style type="text/css">
.node rect {
cursor: pointer;
fill: #fff;
stroke: steelblue;
stroke-width: 1.5px;
}
.node text {
font-size: 12px;
}
path.link {
fill: none;
stroke: #ccc;
stroke-width: 1.5px;
}
</style>
<script>
var data = {
"name":"steve",
"children":[
{
"name":"bob",
"children":[]
}
]
}
//optional parameters
var w = 500,
h = 800;
bst = d3.bst(d3, "body" , w, h)
//body can be an id tag like "#canvas" or a
//class, such as, ".canvases".
bst.make(data)
</script
</head>
<body></body>
</html>