client/annotviz/app/annotstimeline.html
author rougeronj
Thu, 22 Jan 2015 09:26:43 +0100
changeset 111 a7b72620d227
parent 104 685c5ebc59d0
child 124 b5697bcdbaff
permissions -rw-r--r--
Add variable "wait". When this variable set, the annotsroll wait ignore some annotations, and wait before printing an otherone so there is no superposition. Can be passed as an options
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
101
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
     1
<!DOCTYPE html>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
     2
<html lang="en">
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
     3
<head>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
     4
    <meta charset="utf-8">
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
     5
    <meta name="viewport" content="width=device-width,initial-scale=1">
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
     6
    <meta name="description" content="">
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
     7
    <meta name="author" content="I.R.I">
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
     8
    <link rel="shortcut icon" href="/img/favicon.ico">
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
     9
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    10
    <title>AnnotsTimeLine</title>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    11
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    12
    <!-- Custom styles for this template -->
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    13
    <link href="/css/annotviz.css" rel="stylesheet">
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    14
</head>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    15
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    16
<body>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    17
    <h1>Piano Roll vertical</h1>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    18
    <noscript>You must enable JavaScript</noscript>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    19
    <div id="canvasContainer"></div>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    20
    <p>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    21
        <a href="#" onclick="stop(); return false;">stop intervals</a> -
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    22
        <a href="#" onclick="start(); return false;">start intervals</a> -
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    23
        temps écoulé : <span id="timeStarted"></span>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    24
    </p>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    25
    <!--pre id="log"></pre-->
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    26
    <script src="/js/libs-annotviz.js"></script>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    27
    <script src="/js/annotviz.js"></script>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    28
    <script>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    29
        var annotationChannel = 'ANNOT';
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    30
        var eventCode = 'test_1';
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    31
        var wsUri;
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    32
        if (window.location.protocol === 'file:') {
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    33
            wsUri = 'ws://127.0.0.1:8090/broadcast';
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    34
        }
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    35
        else {
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    36
            wsUri = 'ws://' + window.location.hostname + ':8090/broadcast';
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    37
        }
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    38
        wsUriAnnotation = wsUri + '?channel=' + annotationChannel + '&event_code=' + eventCode;
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    39
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    40
        var logger = new annotviz.ConsoleLogger(true);
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    41
        
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    42
        var stageView = new annotviz.StageView({
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    43
        	logger: logger
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    44
        });
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    45
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    46
        var annotstimeline = new annotviz.AnnotsTimeLine({
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    47
        	stageView : stageView,
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    48
            logger: logger,
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    49
            ws: new annotviz.WsWrapper(wsUriAnnotation, logger),
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    50
            xInit: 0,
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    51
            yInit: 0,
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
    52
            width: 1024 - 435 - 300,
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
    53
            height: 768,
101
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    54
            timeBegin: Date.now(),
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    55
            timeEnd: Date.now() + 300000,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 102
diff changeset
    56
            intervalWidth: 6,
101
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    57
            intervalHeight: 10,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 102
diff changeset
    58
            maxCellHeight: 100,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 102
diff changeset
    59
            radius: 400,
102
cc7b06bfd574 update to circle representation
rougeronj
parents: 101
diff changeset
    60
            circleX:500,
cc7b06bfd574 update to circle representation
rougeronj
parents: 101
diff changeset
    61
            circleY:500,
101
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    62
            annotCategories: [{
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    63
           		ts: 0, 
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    64
           		colors: {		
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    65
       	       		'ntm': '#CDC83F',
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    66
       	       	    'iam': '#CDC83F',
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    67
       	       	    'hip': '#CDC83F',
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    68
       	       	    'hop': '#CDC83F',
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    69
       	       	    'rock': '#DE8B53',
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    70
       	       	    'rap': '#DE8B53',
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    71
       	       	    'classic': '#DE8B53',
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    72
       	       	    'drums': '#C5A3CA',
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    73
       	       	    'guitar': '#C5A3CA',
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    74
       	       	    'bass': '#79BB92',
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    75
       	       	   	'default': '#808080'
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    76
				},
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    77
            	order: ['ntm', 'iam', 'hip', 'hop', 'rock', 'rap', 'classic', 'drums', 'guitar', 'bass', 'default']
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    78
           	}]
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    79
        });
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    80
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    81
        function stop() {
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    82
        	stageView.stop();
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    83
        }
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    84
        function start() {
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    85
        	stageView.start();
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    86
        }
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    87
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    88
        window.onload = function() {
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    89
        	stageView.init();
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    90
            start();
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    91
        }
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    92
    </script>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    93
</body>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    94
</html>