client/annotviz/app/js/annotsvizview.js
author rougeronj
Fri, 17 Apr 2015 11:48:03 +0200
changeset 161 0b01cbd8ed9e
parent 144 1762372184ae
child 162 44320144951a
permissions -rw-r--r--
update annotvizview for 'atelier 3 jour 2'
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
98
72d767c5142d refactor and make work annotsroll
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
/**
72d767c5142d refactor and make work annotsroll
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
* js/annotsvizview.js
72d767c5142d refactor and make work annotsroll
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
*
72d767c5142d refactor and make work annotsroll
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
* This is the starting point for your application.
72d767c5142d refactor and make work annotsroll
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
* Take a look at http://browserify.org/ for more info
144
1762372184ae clean code
ymh <ymh.work@gmail.com>
parents: 141
diff changeset
     6
*
98
72d767c5142d refactor and make work annotsroll
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
*/
144
1762372184ae clean code
ymh <ymh.work@gmail.com>
parents: 141
diff changeset
     8
/*jshint unused: false */
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
     9
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    10
'use strict';
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    11
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    12
var PIXI = require('pixi');
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    13
var _ = require('lodash');
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    14
var DoubleRoll = require('./doubleroll.js');
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    15
var AnnotsTimeLine = require('./annotstimeline.js');
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    16
var AnnotsRoll = require('./annotsroll.js');
121
df6b39f962bc Add getAnnotCategories to utils and propagate the modification to annotsvizview and annotstimeline
rougeronj
parents: 113
diff changeset
    17
var Utils = require('./utils.js');
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    18
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    19
var defaultOptions = {
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    20
    xInit: 0,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    21
    yInit: 0,
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
    22
    width: 1024,
126
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
    23
    height: 768
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    24
};
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    25
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    26
function AnnotsVizView(options){
139
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
    27
    var _this = this;
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    28
    var opts = _(options).defaults(defaultOptions).value();
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    29
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    30
    this.container = new PIXI.DisplayObjectContainer();
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    31
    this.container.x = opts.xInit;
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    32
    this.container.y = opts.yInit;
139
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
    33
    this.width = opts.width;
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
    34
    this.height= opts.height;
113
7531e4180915 Minor time correction
rougeronj
parents: 110
diff changeset
    35
    this.timeBegin = opts.timeBegin;
7531e4180915 Minor time correction
rougeronj
parents: 110
diff changeset
    36
    this.timeEnd = opts.timeEnd;
141
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    37
128
9f2334598088 add archive variable to desactivate the socket listening for the static timeLines
rougeronj
parents: 126
diff changeset
    38
    this.annotCategories = [];
141
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    39
    this.annotCategoriesDay2 = [];
136
83a5ab5e2e81 Get categories from the correct eventCode
rougeronj
parents: 135
diff changeset
    40
    this.annotCategoriesDay1 = [];
139
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
    41
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
    42
    var wsPianoroll = opts.wsPianoroll;
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
    43
    var wsAnnot = opts.wsAnnot;
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
    44
    var stageView = opts.stageView;
128
9f2334598088 add archive variable to desactivate the socket listening for the static timeLines
rougeronj
parents: 126
diff changeset
    45
    var channel = opts.channel;
133
rougeronj
parents: 129
diff changeset
    46
    var serverUrl = opts.serverUrl;
144
1762372184ae clean code
ymh <ymh.work@gmail.com>
parents: 141
diff changeset
    47
141
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    48
    var eventCode = opts.eventCode;
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    49
    var eventCodeSessionDay2 = opts.eventCodeSessionDay2;
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    50
	var eventCodeSessionDay1 = opts.eventCodeSessionDay1;
144
1762372184ae clean code
ymh <ymh.work@gmail.com>
parents: 141
diff changeset
    51
    var logger = opts.logger;
139
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
    52
141
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    53
	Utils.getAnnotCategories(opts.urlCategories + eventCode, this.annotCategories);
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    54
    Utils.getAnnotCategories(opts.urlCategories + eventCodeSessionDay2, this.annotCategoriesDay2);
136
83a5ab5e2e81 Get categories from the correct eventCode
rougeronj
parents: 135
diff changeset
    55
    Utils.getAnnotCategories(opts.urlCategories + eventCodeSessionDay1, this.annotCategoriesDay1);
131
0bb70072a56f some quick cleaning
ymh <ymh.work@gmail.com>
parents: 129
diff changeset
    56
139
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
    57
    stageView.registerComponent(this);
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    58
141
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    59
    var currentDay = new AnnotsTimeLine.AnnotsTimeLine({
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    60
    	stageView : stageView,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    61
        logger: logger,
131
0bb70072a56f some quick cleaning
ymh <ymh.work@gmail.com>
parents: 129
diff changeset
    62
        ws: wsAnnot,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    63
        xInit: 0,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    64
        yInit: 0,
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
    65
        width: 1024 - 200 - 200,
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
    66
        height: 768-200,
113
7531e4180915 Minor time correction
rougeronj
parents: 110
diff changeset
    67
        timeBegin: this.timeBegin,
7531e4180915 Minor time correction
rougeronj
parents: 110
diff changeset
    68
        timeEnd: this.timeEnd,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    69
        intervalWidth: 6,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    70
        intervalHeight: 10,
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
    71
        maxCellHeight: 70,
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
    72
        radius: 200,
128
9f2334598088 add archive variable to desactivate the socket listening for the static timeLines
rougeronj
parents: 126
diff changeset
    73
        eventCode: eventCode,
9f2334598088 add archive variable to desactivate the socket listening for the static timeLines
rougeronj
parents: 126
diff changeset
    74
        channel: channel,
133
rougeronj
parents: 129
diff changeset
    75
        serverUrl: serverUrl,
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
    76
        annotCategories: this.annotCategories
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
    77
    });
144
1762372184ae clean code
ymh <ymh.work@gmail.com>
parents: 141
diff changeset
    78
141
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    79
	//Archive day 2
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    80
    var timeLineDay2 = new AnnotsTimeLine.AnnotsTimeLine({
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    81
    	stageView : stageView,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    82
        xInit: 0,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    83
        yInit: 0,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    84
        width: 1024 - 200 - 200,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    85
        height: 768-200,
161
0b01cbd8ed9e update annotvizview for 'atelier 3 jour 2'
rougeronj
parents: 144
diff changeset
    86
        timeBegin: Date.parse('2015-04-16T14:00:00+02:00'),
0b01cbd8ed9e update annotvizview for 'atelier 3 jour 2'
rougeronj
parents: 144
diff changeset
    87
        timeEnd: Date.parse('2015-04-16T21:00:00+02:00'),
141
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    88
        circleX: currentDay.circleX,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    89
        circleY: currentDay.circleY,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    90
        intervalWidth: (currentDay.radius*2/3)* currentDay.intervalWidth / currentDay.radius,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    91
        intervalHeight: (currentDay.intervalHeight * (currentDay.radius - currentDay.radius*2/3))/ currentDay.maxCellHeight,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    92
        maxCellHeight: (currentDay.radius - currentDay.radius*2/3)/2,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    93
        radius: currentDay.radius*2/3,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    94
        annotCategories: this.annotCategoriesDay2,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    95
        eventCode: eventCodeSessionDay2,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    96
        channel: channel,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    97
        serverUrl: serverUrl,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    98
        showClockGraphics:false,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
    99
        archive: true
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
   100
    });
144
1762372184ae clean code
ymh <ymh.work@gmail.com>
parents: 141
diff changeset
   101
141
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
   102
	//Archive day 1
126
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   103
    var timeLineDay1 = new AnnotsTimeLine.AnnotsTimeLine({
141
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
   104
    	stageView : stageView,
126
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   105
        xInit: 0,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   106
        yInit: 0,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   107
        width: 1024 - 200 - 200,
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   108
        height: 768-200,
161
0b01cbd8ed9e update annotvizview for 'atelier 3 jour 2'
rougeronj
parents: 144
diff changeset
   109
        timeBegin: Date.parse('2015-04-16T14:00:00+02:00'),
0b01cbd8ed9e update annotvizview for 'atelier 3 jour 2'
rougeronj
parents: 144
diff changeset
   110
        timeEnd: Date.parse('2015-04-16T21:00:00+02:00'),
141
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
   111
        circleX: currentDay.circleX,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
   112
        circleY: currentDay.circleY,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
   113
        intervalWidth: (currentDay.radius*2/3)* currentDay.intervalWidth / currentDay.radius,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
   114
        intervalHeight: (currentDay.intervalHeight * (currentDay.radius - currentDay.radius/3))/ currentDay.maxCellHeight,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
   115
        maxCellHeight: (currentDay.radius*2/3 - currentDay.radius/3)/4,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
   116
        radius: currentDay.radius/3,
136
83a5ab5e2e81 Get categories from the correct eventCode
rougeronj
parents: 135
diff changeset
   117
        annotCategories: this.annotCategoriesDay1,
133
rougeronj
parents: 129
diff changeset
   118
        eventCode: eventCodeSessionDay1,
128
9f2334598088 add archive variable to desactivate the socket listening for the static timeLines
rougeronj
parents: 126
diff changeset
   119
        channel: channel,
133
rougeronj
parents: 129
diff changeset
   120
        serverUrl: serverUrl,
141
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
   121
        showClockGraphics:false,
e6892a30d454 Update AnnotVizView for the 3rd Day
rougeronj
parents: 140
diff changeset
   122
        archive: true,
126
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   123
    });
139
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   124
144
1762372184ae clean code
ymh <ymh.work@gmail.com>
parents: 141
diff changeset
   125
    var currentTimeText = new PIXI.Text('-- : -- : --', { font: '18pt Gothic Standard', fill: '#646464' });
126
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   126
    currentTimeText.x = timeLineDay2.circleX - currentTimeText.width/2;
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   127
    currentTimeText.y = timeLineDay2.circleY - currentTimeText.height/2;
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   128
    this.container.addChild(currentTimeText);
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   129
144
1762372184ae clean code
ymh <ymh.work@gmail.com>
parents: 141
diff changeset
   130
139
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   131
    var doubleRollH = new DoubleRoll.DoubleRoll({
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   132
        stageView : stageView,
139
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   133
        logger: logger,
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   134
        ws: wsPianoroll,
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   135
        yInit: (this.height - 200),
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   136
        sceneHeight: 200,
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   137
        pianorolls : [
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   138
            {
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   139
                height: 200,
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   140
                timeWidth: 10,
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   141
                lineInterval: 5000,
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   142
                noteHeight: 10
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   143
            },
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   144
        ]
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   145
    });
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   146
139
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   147
    var doubleRollV = new DoubleRoll.DoubleRoll({
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   148
        stageView : stageView,
139
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   149
        logger: logger,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   150
        ws: wsPianoroll,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   151
        orientation: 'vertical',
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   152
        sceneHeight: 768-200,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   153
        pianorolls : [
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   154
            {
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
   155
                height: 200,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   156
                timeWidth: 60,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   157
                lineInterval: 5000,
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   158
                noteHeight: 5,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   159
            },
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   160
        ]
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   161
    });
139
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   162
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   163
    var annotsRoll = new AnnotsRoll.AnnotsRoll({
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   164
        stageView : stageView,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   165
        logger: logger,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   166
        ws: wsAnnot,
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   167
        parentContainer: doubleRollV.stage,
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
   168
        xInit: 1024 - 200 - 200,
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   169
        yInit: 768-200,
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
   170
        width: 200 + 200,
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   171
        height: 768-200,
104
685c5ebc59d0 update resolution screen
rougeronj
parents: 103
diff changeset
   172
        widthRoll: 200,
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   173
        framerate: doubleRollV.framerate,
105
25ac8802c189 Improve interface + Add horizontal pianoroll to annotsvizview
rougeronj
parents: 104
diff changeset
   174
        pixelsPerSecond: Math.floor(1024 / 60),
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   175
        annotColors: this.annotCategories
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   176
    });
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   177
139
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   178
    var limiters = new PIXI.Graphics()
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   179
        .lineStyle(1, 0x646464)
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   180
        .moveTo(annotsRoll.container.x, annotsRoll.container.y)
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   181
        .lineTo(annotsRoll.container.x, annotsRoll.container.y - annotsRoll.height)
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   182
        .moveTo(annotsRoll.container.x + annotsRoll.widthRoll, annotsRoll.container.y)
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   183
        .lineTo(annotsRoll.container.x + annotsRoll.widthRoll, annotsRoll.container.y - annotsRoll.height)
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   184
        .moveTo(0, this.height - 200)
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   185
        .lineTo(this.width, this.height - 200)
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   186
        .drawRect(0, 0, this.width -1, this.height -1)
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   187
        .beginFill(0xECECEC)
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   188
        .drawRect(1024 - 200, 0, 200, 768-200)
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   189
        .endFill();
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   190
    this.container.addChild(limiters);
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   191
139
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   192
    this.init = function(){
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   193
    };
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   194
139
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   195
    this.updateTime = function(){
129
7181e1f28eb0 Merge with f9dd7bfed9976461c79bf521ed01bf4caaf4fbcf
rougeronj
parents: 128
diff changeset
   196
        currentTimeText.setText(Utils.formatTime(Date.now()));
126
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   197
    };
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   198
13d9a532a0a7 Add timeline of the 2nd day - take out from the clock annotstimeline and put it in annotsvizview - make the clocks graphics optional through showClockGraphics
rougeronj
parents: 121
diff changeset
   199
    var refreshTimeInterval;
139
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   200
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   201
    this.start = function() {
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   202
        refreshTimeInterval = setInterval(function() {_this.updateTime();}, 1000);
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   203
    };
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   204
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   205
    this.refresh = function() {
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   206
    };
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   207
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   208
    this.stop = function(){
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   209
    };
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   210
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   211
    return this;
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   212
103
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   213
}
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   214
123a611c7903 minor update of options and add annotsvizview
rougeronj
parents: 98
diff changeset
   215
module.exports = {
139
b62fdb81ce6a duration is absolute
ymh <ymh.work@gmail.com>
parents: 136
diff changeset
   216
    AnnotsVizView: AnnotsVizView
108
082b64a5c699 add vizualizations to server
ymh <ymh.work@gmail.com>
parents: 105
diff changeset
   217
};