Grid sorter first approach

This commit is contained in:
Gonzalo Bellver
2012-01-02 17:10:14 -03:00
parent 14cb5b586e
commit 93e035bbbb
6 changed files with 113 additions and 11 deletions

View File

@@ -48,15 +48,12 @@ mindplot.nlayout.OriginalLayout = new Class({
layout: function() {
var roots = this._treeSet.getTreeRoots();
roots.forEach(function(node) {
console.log('node = ' + node.getId()); //TODO(gb): Remove trace!!!
// Calculate all node heights ...
var sorter = node.getSorter();
console.log('sorter = ' + sorter); //TODO(gb): Remove trace!!!
// @Todo: This must not be implemented in this way.Each sorter could have different notion of heights ...
var heightById = sorter.computeChildrenIdByHeights(this._treeSet, node);
console.log('heightById = ' + heightById[0]); //TODO(gb): Remove trace!!!
this._layoutChildren(node, heightById);
}, this);
@@ -98,7 +95,8 @@ mindplot.nlayout.OriginalLayout = new Class({
});
mindplot.nlayout.OriginalLayout.SYMETRIC_SORTER = new mindplot.nlayout.SymetricSorder();
mindplot.nlayout.OriginalLayout.GRID_SORTER = new mindplot.nlayout.SymetricSorder();
mindplot.nlayout.OriginalLayout.GRID_SORTER = new mindplot.nlayout.GridSorter();
//mindplot.nlayout.OriginalLayout.GRID_SORTER = new mindplot.nlayout.SymetricSorder();