basic leaves pass-thru
[p5sagit/Devel-Size.git] / static / public / tm.js
index 5f5b36d..bd689cd 100644 (file)
@@ -36,7 +36,7 @@ function init(){
     //show only one tree level
     levelsToShow: 1,
     //parent box title heights
-    titleHeight: 0,
+    titleHeight: 11,
     //enable animations
     animate: animate,
     //box offsets
@@ -84,7 +84,7 @@ function init(){
       }
     },
     //duration of the animations
-    duration: 1000,
+    duration: 500,
     //Enable tips
     Tips: {
       enable: true,
@@ -100,20 +100,15 @@ function init(){
           + "</div><div class=\"tip-text\">";
         var data = node.data;
 
-    //"child_seqns"     => 4,
-    //"depth"           => 2,
-    //"id"              => 3,
-    //"kids_node_count" => 4426,
-    //"kids_size"       => 560058,
-    //"name"            => "SV(PVHV)",
-    //"parent_seqn"     => 2,
-    //"self_size"       => 1080,
-
-        html += sprintf("Name: %s<br />\n", data.name);
         html += sprintf("Size: %d (%d + %d)<br />", data.self_size+data.kids_size, data.self_size, data.kids_size);
         if (data.child_count) {
             html += sprintf("Children: %d of %d<br />", data.child_count, data.kids_node_count);
         }
+        html += sprintf("Depth: %d<br />", data.depth);
+        html += sprintf("Parent: %d<br />", data.parent_id);
+        html += sprintf("Id: %s%s<br />", node.id, data._ids_merged ? data._ids_merged : "");
+        html += JSON.stringify(data.attr, undefined, 4) + "<br />";
+        html += JSON.stringify(data.leaves, undefined, 4) + "<br />";
 
         tip.innerHTML =  html; 
       }  
@@ -125,7 +120,9 @@ function init(){
     //callback method should be called.  
     request: function(nodeId, level, onComplete){  
         if (true) {
-            jQuery.getJSON('jit_tree/'+nodeId+'/3', function(data) {
+            jQuery.getJSON('jit_tree/'+nodeId+'/1', function(data) {
+                console.log("Node "+nodeId);
+                console.log(data);
                 onComplete.onComplete(nodeId, data);  
             });
         }
@@ -144,8 +141,8 @@ function init(){
   });
   
 if(true) {
-    jQuery.getJSON('jit_tree/1/2', function(data) {
-  console.log(data);
+    jQuery.getJSON('jit_tree/1/1', function(data) {
+        console.log(data);
         tm.loadJSON(data);
         tm.refresh();
     });