correct timeline archive loading
authorymh <ymh.work@gmail.com>
Fri, 23 Jan 2015 11:28:25 +0100
changeset 137 750d9076a4a8
parent 136 83a5ab5e2e81
child 138 30dc3baf1ab9
correct timeline archive loading
client/annotviz/app/annotsvizview.html
client/annotviz/app/js/annotstimeline.js
--- a/client/annotviz/app/annotsvizview.html	Fri Jan 23 10:46:26 2015 +0100
+++ b/client/annotviz/app/annotsvizview.html	Fri Jan 23 11:28:25 2015 +0100
@@ -24,8 +24,8 @@
 
         var pianorollChannel  = 'PIANOROLL';
         var annotationChannel = 'ANNOT';
-        var eventCode = 'atelier2';
-        var eventCodeSessionDay1 = 'atelier2_jour2';
+        var eventCode = 'atelier2_jour2';
+        var eventCodeSessionDay1 = 'atelier2';
         var serverUrl = "http://172.16.0.20:8080";
         var wsUri;
 
@@ -40,7 +40,7 @@
         });
 
         var annotsvizview = new annotviz.AnnotsVizView({
-            urlCategories: serverUrl + "/p/api/v1/event/" + eventCode,
+            urlCategories: serverUrl + "/p/api/v1/event/",
             logger: logger,
             stageView: stageView,
             serverUrl:serverUrl,
--- a/client/annotviz/app/js/annotstimeline.js	Fri Jan 23 10:46:26 2015 +0100
+++ b/client/annotviz/app/js/annotstimeline.js	Fri Jan 23 11:28:25 2015 +0100
@@ -86,7 +86,10 @@
         //query -> need channel + eventCode
         //iterate over data fill cells
         var startTs = _this.timeBegin;
-        var endTs = _this.startTs;
+        var endTs = Math.min(_this.timeEnd,_this.startTs);
+
+        console.log("START TS",new Date(startTs).toISOString());
+        console.log("END TS",new Date(endTs).toISOString());
 
         var url = serverUrl + '/p/api/v1/annotation';
         var filters = [
@@ -102,7 +105,7 @@
         var currentPage = 1;
 
         var processResFunction = function(res) {
-
+            //console.log("RES archive", res);
             if(res) {
                 var data = res.target.json;
                 /*jshint -W069 */
@@ -117,7 +120,6 @@
                 jsonLoader.load();
                 currentPage++;
             }
-            console.log(res);
         };
         processResFunction();
 
@@ -135,6 +137,10 @@
             }
         });
 
+        if(!colorsDef) {
+            return;
+        }
+
         if (this.timeEnd > ts){
             var i = Math.floor((ts - this.timeBegin)/(1000*this.intervalDuration));