client/annotviz/app/js/main.js
changeset 91 09a9074ea7b0
parent 89 b4bd49f01837
child 92 a323578ea954
equal deleted inserted replaced
90:111350ddb81d 91:09a9074ea7b0
   138 
   138 
   139 var AnnotsRoll = require('./annotsRoll.js')
   139 var AnnotsRoll = require('./annotsRoll.js')
   140 
   140 
   141 var AnnotationRoll = new AnnotsRoll(uberContainer, sceneWidth - (prSize2 + prSize3), 0, prSize3 + prSize2, sceneHeight, prSize3, pixelsPerSecond3, lineInterval);
   141 var AnnotationRoll = new AnnotsRoll(uberContainer, sceneWidth - (prSize2 + prSize3), 0, prSize3 + prSize2, sceneHeight, prSize3, pixelsPerSecond3, lineInterval);
   142 
   142 
       
   143 /* ---------------------------------------------------------------- */
       
   144 /* ------------------- Init generalView container ----------------- */
       
   145 /* ---------------------------------------------------------------- */
       
   146 
       
   147 var GeneralView = require('./generalView.js')
       
   148 
       
   149 var GeneralRoll = new GeneralView(uberContainer, 0, 0, sceneWidth - (prSize2 + prSize3), sceneHeight, 3600, 60, Date.now());
       
   150 
       
   151 
   143 function addAnnots(data){
   152 function addAnnots(data){
   144     var title = data.content.category.label;
   153     var title = data.content.category.label;
   145     var user = data.content.user;
   154     var user = data.content.user;
       
   155     //Test cat and color
   146     var colorAnnot = 0x65A954;
   156     var colorAnnot = 0x65A954;
       
   157     
   147     AnnotationRoll.addAnnot(title, user, colorAnnot);
   158     AnnotationRoll.addAnnot(title, user, colorAnnot);
       
   159     GeneralRoll.addAnnot(title, Date.now());
   148 }
   160 }
   149 
   161 
   150 /* ---------------------------------------------------------------- */
   162 /* ---------------------------------------------------------------- */
   151 /* ----------------------- Socket management ---------------------- */
   163 /* ----------------------- Socket management ---------------------- */
   152 /* ---------------------------------------------------------------- */
   164 /* ---------------------------------------------------------------- */
   230 
   242 
   231         sock2.onmessage = function(e) {
   243         sock2.onmessage = function(e) {
   232             if(logger){
   244             if(logger){
   233                 log('Got message: ' + e.data);
   245                 log('Got message: ' + e.data);
   234             }
   246             }
       
   247             console.log(e);
   235             addAnnots(JSON.parse(e.data));
   248             addAnnots(JSON.parse(e.data));
   236         };
   249         };
   237     }
   250     }
   238 };
   251 };
   239 
   252