Visual representation of nodes. Symetric sorter updated

This commit is contained in:
Gonzalo Bellver
2011-12-30 17:48:11 -03:00
parent 9ed6df2158
commit 14cb5b586e
8 changed files with 111 additions and 27 deletions

View File

@@ -119,6 +119,7 @@ mindplot.nlayout.SymetricSorder = new Class({
return {id:child.getId(),height:this._computeChildrenHeight(treeSet, child)};
}.bind(this));
// Compute the center of the branch ...
var totalHeight = 0;
heights.forEach(function(elem) {
@@ -131,8 +132,8 @@ mindplot.nlayout.SymetricSorder = new Class({
for (var i = 0; i < heights.length; i++) {
ysum = ysum - heights[i].height;
var yOffset = ysum + mindplot.nlayout.SymetricSorder.INTERNODE_VERTICAL_PADDING;
var xOffset = mindplot.nlayout.SymetricSorder.INTERNODE_HORIZONTAL_PADDING;
var yOffset = ysum + heights[i].height/2;
var xOffset = node.getSize().width + mindplot.nlayout.SymetricSorder.INTERNODE_HORIZONTAL_PADDING;
$assert(!isNaN(xOffset), "xOffset can not be null");
$assert(!isNaN(yOffset), "yOffset can not be null");
@@ -141,6 +142,10 @@ mindplot.nlayout.SymetricSorder = new Class({
}
return result;
},
toString:function() {
return "Symmetric Sorter";
}
});