client/annotviz/app/annotstimeline.html
author rougeronj
Thu, 16 Apr 2015 12:15:33 +0200
changeset 153 60bd2b36b9dc
parent 135 d3066fa80a81
permissions -rw-r--r--
put showTime as an option and add it to static pianoroll template on server
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>
124
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    17
    <h1>annotation timeline</h1>
101
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>
124
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    29
101
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    30
        var annotationChannel = 'ANNOT';
133
rougeronj
parents: 124
diff changeset
    31
        var eventCode = 'atelier2';
101
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    32
        var wsUri;
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    33
        if (window.location.protocol === 'file:') {
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    34
            wsUri = 'ws://127.0.0.1:8090/broadcast';
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    35
        }
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    36
        else {
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    37
            wsUri = 'ws://' + window.location.hostname + ':8090/broadcast';
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    38
        }
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    39
        wsUriAnnotation = wsUri + '?channel=' + annotationChannel + '&event_code=' + eventCode;
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    40
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    41
        var logger = new annotviz.ConsoleLogger(true);
124
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    42
101
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    43
        var stageView = new annotviz.StageView({
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    44
        	logger: logger
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    45
        });
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    46
124
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    47
        annotCategories = [{
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    48
            ts: 0,
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    49
            colors: {
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    50
                'ntm': '#CDC83F',
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    51
                'iam': '#CDC83F',
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    52
                'hip': '#CDC83F',
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    53
                'hop': '#CDC83F',
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    54
                'rock': '#DE8B53',
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    55
                'rap': '#DE8B53',
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    56
                'classic': '#DE8B53',
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    57
                'drums': '#C5A3CA',
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    58
                'guitar': '#C5A3CA',
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    59
                'bass': '#79BB92',
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    60
                'default': '#808080'
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    61
            },
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    62
            order: ['ntm', 'iam', 'hip', 'hop', 'rock', 'rap', 'classic', 'drums', 'guitar', 'bass', 'default']
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    63
        }];
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    64
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    65
        annotviz.getAnnotCategories("http://localhost:8080/p/api/v1/event/"+eventCode, annotCategories);
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    66
        console.log("ANNOTS CAT",annotCategories);
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    67
101
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    68
        var annotstimeline = new annotviz.AnnotsTimeLine({
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    69
        	stageView : stageView,
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    70
            logger: logger,
133
rougeronj
parents: 124
diff changeset
    71
            serverUrl: serverUrl,
101
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    72
            ws: new annotviz.WsWrapper(wsUriAnnotation, logger),
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    73
            xInit: 0,
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    74
            yInit: 0,
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
    75
            width: 1024 - 435 - 300,
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
    76
            height: 768,
124
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    77
            timeBegin: Date.now() - 300000,
101
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    78
            timeEnd: Date.now() + 300000,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 102
diff changeset
    79
            intervalWidth: 6,
101
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    80
            intervalHeight: 10,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 102
diff changeset
    81
            maxCellHeight: 100,
124
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    82
            radius: 300,
102
cc7b06bfd574 update to circle representation
rougeronj
parents: 101
diff changeset
    83
            circleX:500,
124
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    84
            circleY:450,
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    85
            eventCode: eventCode,
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    86
            channel: annotationChannel,
b5697bcdbaff add history load for time lines
ymh <ymh.work@gmail.com>
parents: 104
diff changeset
    87
            annotCategories: annotCategories
101
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    88
        });
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    89
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    90
        function stop() {
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    91
        	stageView.stop();
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    92
        }
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    93
        function start() {
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    94
        	stageView.start();
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    95
        }
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    96
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    97
        window.onload = function() {
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    98
        	stageView.init();
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
    99
            start();
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
   100
        }
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
   101
    </script>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
   102
</body>
7e902dc550c5 add stageView and annotstimeline
rougeronj
parents:
diff changeset
   103
</html>