-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
64 lines (54 loc) · 2.2 KB
/
demo.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
57
58
59
60
61
62
63
64
<html>
<head>
<title>Thread Arcs Demo</title>
<script type="text/javascript" src="raphael.js"></script>
<script type="text/javascript" src="ThreadArcs.js"></script>
<link href="ThreadArcs.css" type="text/css" rel="stylesheet" />
<link href="omslag.css" type="text/css" rel="stylesheet" />
<script type="text/javascript">
window.onload = function() {
nodes = [
{'title': 'Tegen academische vrijheid', 'author': 'Trudy Dehue', 'date': 1, 'href':'#'},
{'title': 'Vrij voorbarig', 'author': 'Klaas van Berkel', 'date': 2, 'href':'#'},
{'title': 'Excellente schapen voor de wolven', 'author': 'Trudy Dehue', 'date': 3,'href':'#'},
{'title': 'Realistische wetenschap', 'author': 'Ruud Abma', 'date': 4, 'href':'#'},
{'title': 'Democratische wetenschap is realistische wetenschap', 'author': 'Trudy Dehue', 'date': 5, 'href':'#'}
]
tooltipHTML = function(node) {
return '<a href="' + node['href'] + '" title="' + node['title'] + '">'
+'<span class="inline-author">' + node['author'] + '.</span> '
+ '<span class="title">' + node['title'] + '</span>'
+'</a>';
}
// List of parents of every note.
// j in parents[i] means that j --> i,
// which means that i is reply to article j
parents = [
[],
[0],
[1],
[0],
[3]
]
options = {
'nodes': nodes,
'tooltipHTML': tooltipHTML,
'orientation': 'vertical'
}
TA = ThreadArcs('canvas_container', parents, options)
TA.sort()
TA.draw()
TA.activate(2)
TA2 = ThreadArcs('canvas_container2', parents, (options['orientation']='horizontal'))
TA2.sort(2).draw()
// TA3 = ThreadArcs('canvas_container3', articles, connList, options)
// TA3.sort([9, 8, 7, 6, 5, 4, 3, 2, 1, 0]).draw()
}
</script>
</head>
<body>
<div id="canvas_container" class="ThreadArcsContainer"></div>
<div style="margin-top:100px;" id="canvas_container2"></div>
<div id="canvas_container3"></div>
</body>
</html>