101
|
1 |
<!DOCTYPE html> |
|
2 |
<html lang="en"> |
|
3 |
<head> |
|
4 |
<meta charset="utf-8"> |
|
5 |
<meta name="viewport" content="width=device-width,initial-scale=1"> |
|
6 |
<meta name="description" content=""> |
|
7 |
<meta name="author" content="I.R.I"> |
|
8 |
<link rel="shortcut icon" href="/img/favicon.ico"> |
|
9 |
|
|
10 |
<title>AnnotsTimeLine</title> |
|
11 |
|
|
12 |
<!-- Custom styles for this template --> |
|
13 |
<link href="/css/annotviz.css" rel="stylesheet"> |
|
14 |
</head> |
|
15 |
|
|
16 |
<body> |
124
|
17 |
<h1>annotation timeline</h1> |
101
|
18 |
<noscript>You must enable JavaScript</noscript> |
|
19 |
<div id="canvasContainer"></div> |
|
20 |
<p> |
|
21 |
<a href="#" onclick="stop(); return false;">stop intervals</a> - |
|
22 |
<a href="#" onclick="start(); return false;">start intervals</a> - |
|
23 |
temps écoulé : <span id="timeStarted"></span> |
|
24 |
</p> |
|
25 |
<!--pre id="log"></pre--> |
|
26 |
<script src="/js/libs-annotviz.js"></script> |
|
27 |
<script src="/js/annotviz.js"></script> |
|
28 |
<script> |
124
|
29 |
|
101
|
30 |
var annotationChannel = 'ANNOT'; |
133
|
31 |
var eventCode = 'atelier2'; |
101
|
32 |
var wsUri; |
|
33 |
if (window.location.protocol === 'file:') { |
|
34 |
wsUri = 'ws://127.0.0.1:8090/broadcast'; |
|
35 |
} |
|
36 |
else { |
|
37 |
wsUri = 'ws://' + window.location.hostname + ':8090/broadcast'; |
|
38 |
} |
|
39 |
wsUriAnnotation = wsUri + '?channel=' + annotationChannel + '&event_code=' + eventCode; |
|
40 |
|
|
41 |
var logger = new annotviz.ConsoleLogger(true); |
124
|
42 |
|
101
|
43 |
var stageView = new annotviz.StageView({ |
|
44 |
logger: logger |
|
45 |
}); |
|
46 |
|
124
|
47 |
annotCategories = [{ |
|
48 |
ts: 0, |
|
49 |
colors: { |
|
50 |
'ntm': '#CDC83F', |
|
51 |
'iam': '#CDC83F', |
|
52 |
'hip': '#CDC83F', |
|
53 |
'hop': '#CDC83F', |
|
54 |
'rock': '#DE8B53', |
|
55 |
'rap': '#DE8B53', |
|
56 |
'classic': '#DE8B53', |
|
57 |
'drums': '#C5A3CA', |
|
58 |
'guitar': '#C5A3CA', |
|
59 |
'bass': '#79BB92', |
|
60 |
'default': '#808080' |
|
61 |
}, |
|
62 |
order: ['ntm', 'iam', 'hip', 'hop', 'rock', 'rap', 'classic', 'drums', 'guitar', 'bass', 'default'] |
|
63 |
}]; |
|
64 |
|
|
65 |
annotviz.getAnnotCategories("http://localhost:8080/p/api/v1/event/"+eventCode, annotCategories); |
|
66 |
console.log("ANNOTS CAT",annotCategories); |
|
67 |
|
101
|
68 |
var annotstimeline = new annotviz.AnnotsTimeLine({ |
|
69 |
stageView : stageView, |
|
70 |
logger: logger, |
133
|
71 |
serverUrl: serverUrl, |
101
|
72 |
ws: new annotviz.WsWrapper(wsUriAnnotation, logger), |
|
73 |
xInit: 0, |
|
74 |
yInit: 0, |
104
|
75 |
width: 1024 - 435 - 300, |
|
76 |
height: 768, |
124
|
77 |
timeBegin: Date.now() - 300000, |
101
|
78 |
timeEnd: Date.now() + 300000, |
103
|
79 |
intervalWidth: 6, |
101
|
80 |
intervalHeight: 10, |
103
|
81 |
maxCellHeight: 100, |
124
|
82 |
radius: 300, |
102
|
83 |
circleX:500, |
124
|
84 |
circleY:450, |
|
85 |
eventCode: eventCode, |
|
86 |
channel: annotationChannel, |
|
87 |
annotCategories: annotCategories |
101
|
88 |
}); |
|
89 |
|
|
90 |
function stop() { |
|
91 |
stageView.stop(); |
|
92 |
} |
|
93 |
function start() { |
|
94 |
stageView.start(); |
|
95 |
} |
|
96 |
|
|
97 |
window.onload = function() { |
|
98 |
stageView.init(); |
|
99 |
start(); |
|
100 |
} |
|
101 |
</script> |
|
102 |
</body> |
|
103 |
</html> |