//show only one tree level
levelsToShow: 1,
//parent box title heights
- titleHeight: 0,
+ titleHeight: 11,
//enable animations
animate: animate,
//box offsets
}
},
//duration of the animations
- duration: 1000,
+ duration: 500,
//Enable tips
Tips: {
enable: true,
var html = "<div class=\"tip-title\">" + node.name
+ "</div><div class=\"tip-text\">";
var data = node.data;
- if(data.artist) {
- html += "Artist: " + data.artist + "<br />";
- }
- if(data.playcount) {
- html += "Play count: " + data.playcount;
- }
- if(data.image) {
- html += "<img src=\""+ data.image +"\" class=\"album\" />";
+
+ 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);
+
tip.innerHTML = html;
}
},
//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);
});
}
});
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();
});
tm.refresh();
}
- var sq = $jit.id('r-sq'),
- st = $jit.id('r-st'),
- sd = $jit.id('r-sd');
- var util = $jit.util;
- util.addEvent(sq, 'change', function() {
- if(!sq.checked) return;
- util.extend(tm, new $jit.Layouts.TM.Squarified);
- tm.refresh();
- });
- util.addEvent(st, 'change', function() {
- if(!st.checked) return;
- util.extend(tm, new $jit.Layouts.TM.Strip);
- tm.layout.orientation = "v";
- tm.refresh();
- });
- util.addEvent(sd, 'change', function() {
- if(!sd.checked) return;
- util.extend(tm, new $jit.Layouts.TM.SliceAndDice);
- tm.layout.orientation = "v";
- tm.refresh();
- });
//add event to the back button
var back = $jit.id('back');
$jit.util.addEvent(back, 'click', function() {