client/annotviz/app/annotstimeline.html
changeset 101 7e902dc550c5
child 102 cc7b06bfd574
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/annotviz/app/annotstimeline.html	Tue Jan 20 18:38:18 2015 +0100
@@ -0,0 +1,91 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width,initial-scale=1">
+    <meta name="description" content="">
+    <meta name="author" content="I.R.I">
+    <link rel="shortcut icon" href="/img/favicon.ico">
+
+    <title>AnnotsTimeLine</title>
+
+    <!-- Custom styles for this template -->
+    <link href="/css/annotviz.css" rel="stylesheet">
+</head>
+
+<body>
+    <h1>Piano Roll vertical</h1>
+    <noscript>You must enable JavaScript</noscript>
+    <div id="canvasContainer"></div>
+    <p>
+        <a href="#" onclick="stop(); return false;">stop intervals</a> -
+        <a href="#" onclick="start(); return false;">start intervals</a> -
+        temps écoulé : <span id="timeStarted"></span>
+    </p>
+    <!--pre id="log"></pre-->
+    <script src="/js/libs-annotviz.js"></script>
+    <script src="/js/annotviz.js"></script>
+    <script>
+        var annotationChannel = 'ANNOT';
+        var eventCode = 'test_1';
+        var wsUri;
+        if (window.location.protocol === 'file:') {
+            wsUri = 'ws://127.0.0.1:8090/broadcast';
+        }
+        else {
+            wsUri = 'ws://' + window.location.hostname + ':8090/broadcast';
+        }
+        wsUriAnnotation = wsUri + '?channel=' + annotationChannel + '&event_code=' + eventCode;
+
+        var logger = new annotviz.ConsoleLogger(true);
+        
+        var stageView = new annotviz.StageView({
+        	logger: logger
+        });
+
+        var annotstimeline = new annotviz.AnnotsTimeLine({
+        	stageView : stageView,
+            logger: logger,
+            ws: new annotviz.WsWrapper(wsUriAnnotation, logger),
+            xInit: 0,
+            yInit: 0,
+            width: 1920 - 435 - 300,
+            height: 1080,
+            timeBegin: Date.now(),
+            timeEnd: Date.now() + 300000,
+            intervalWidth: 30,
+            intervalHeight: 10,
+            maxCellHeight: 50,
+            annotCategories: [{
+           		ts: 0, 
+           		colors: {		
+       	       		'ntm': '#CDC83F',
+       	       	    'iam': '#CDC83F',
+       	       	    'hip': '#CDC83F',
+       	       	    'hop': '#CDC83F',
+       	       	    'rock': '#DE8B53',
+       	       	    'rap': '#DE8B53',
+       	       	    'classic': '#DE8B53',
+       	       	    'drums': '#C5A3CA',
+       	       	    'guitar': '#C5A3CA',
+       	       	    'bass': '#79BB92',
+       	       	   	'default': '#808080'
+				},
+            	order: ['ntm', 'iam', 'hip', 'hop', 'rock', 'rap', 'classic', 'drums', 'guitar', 'bass', 'default']
+           	}]
+        });
+
+        function stop() {
+        	stageView.stop();
+        }
+        function start() {
+        	stageView.start();
+        }
+
+        window.onload = function() {
+        	stageView.init();
+            start();
+        }
+    </script>
+</body>
+</html>