client/annotviz/app/annotsvizview.html
author rougeronj
Thu, 22 Jan 2015 15:03:58 +0100
changeset 121 df6b39f962bc
parent 117 c0034b35c44e
child 122 3b11017a76a4
permissions -rw-r--r--
Add getAnnotCategories to utils and propagate the modification to annotsvizview and annotstimeline
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
     1
<!DOCTYPE html>
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
     2
<html lang="en">
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
     3
<head>
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
     4
    <meta charset="utf-8">
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
     5
    <meta name="viewport" content="width=device-width,initial-scale=1">
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
     6
    <meta name="description" content="">
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
     7
    <meta name="author" content="I.R.I">
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
     8
    <link rel="shortcut icon" href="/img/favicon.ico">
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
     9
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    10
    <title>AnnotsVizView</title>
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    11
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    12
    <!-- Custom styles for this template -->
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    13
    <link href="/css/annotviz.css" rel="stylesheet">
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    14
</head>
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    15
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    16
<body>
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    17
    <h1>Piano Roll vertical</h1>
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    18
    <noscript>You must enable JavaScript</noscript>
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    19
    <div id="canvasContainer"></div>
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    20
    <!--pre id="log"></pre-->
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    21
    <script src="/js/libs-annotviz.js"></script>
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    22
    <script src="/js/annotviz.js"></script>
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    23
    <script>
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    24
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    25
        var PIXI = require('pixi');
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    26
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    27
        function colorToHex(input) {
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    28
            if (input.substring(0, 1) === '#') {
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    29
                return input;
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    30
            }
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    31
            else {
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    32
                var m = input.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    33
                var r = m[1], g=[2], b=[3];
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    34
                return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    35
            }
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    36
        }
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    37
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    38
	    var pianorollChannel  = 'PIANOROLL';
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    39
	    var annotationChannel = 'ANNOT';
121
df6b39f962bc Add getAnnotCategories to utils and propagate the modification to annotsvizview and annotstimeline
rougeronj
parents: 117
diff changeset
    40
	    var eventCode = 'atelier2';
df6b39f962bc Add getAnnotCategories to utils and propagate the modification to annotsvizview and annotstimeline
rougeronj
parents: 117
diff changeset
    41
	    var serverUrl = "http://172.16.0.20:8080";
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    42
	    var wsUri;
121
df6b39f962bc Add getAnnotCategories to utils and propagate the modification to annotsvizview and annotstimeline
rougeronj
parents: 117
diff changeset
    43
	    
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
    44
	    if (window.location.protocol === 'file:') {
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
    45
	        wsUri = 'ws://172.16.0.20:8090/broadcast';
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
    46
	    }
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
    47
	    else {
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
    48
	        wsUri = 'ws://' + window.location.hostname + ':8090/broadcast';
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
    49
	    }
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    50
	    wsUriPianoroll = wsUri + '?channel=' + pianorollChannel + '&event_code=' + eventCode;
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    51
	    wsUriAnnotation = wsUri + '?channel=' + annotationChannel + '&event_code=' + eventCode;
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    52
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    53
	    var logger = new annotviz.ConsoleLogger(true);
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    54
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    55
	    var stageView = new annotviz.StageView({
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    56
	    	logger: logger
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    57
	    });
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    58
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    59
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    60
        var annotsvizview = new annotviz.AnnotsVizView({
121
df6b39f962bc Add getAnnotCategories to utils and propagate the modification to annotsvizview and annotstimeline
rougeronj
parents: 117
diff changeset
    61
        	urlCategories: serverUrl + "/p/api/v1/event/" + eventCode,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    62
        	logger: logger,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    63
        	stageView: stageView,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    64
        	wsPianoroll: new annotviz.WsWrapper(wsUriPianoroll, logger),
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    65
        	wsAnnot: new annotviz.WsWrapper(wsUriAnnotation, logger),
113
7531e4180915 Minor time correction
rougeronj
parents: 108
diff changeset
    66
        	timeBegin: 1421919000000,
7531e4180915 Minor time correction
rougeronj
parents: 108
diff changeset
    67
        	timeEnd: 1421951400000
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    68
        });
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    69
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    70
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    71
        function stop() {
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    72
        	stageView.stop();
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    73
        }
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    74
        function start() {
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    75
        	stageView.start();
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    76
        }
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    77
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    78
        window.onload = function() {
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    79
        	stageView.init();
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    80
            start();
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    81
        }
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    82
    </script>
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    83
</body>
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents:
diff changeset
    84
</html>