- Fix position of isolated nodes ...

This commit is contained in:
Paulo Gustavo Veiga
2012-07-09 18:52:59 -03:00
parent 39c2b37a1f
commit 890364f13c
7 changed files with 61 additions and 58 deletions

View File

@@ -202,26 +202,14 @@ mindplot.layout.BalancedSorter = new Class({
}
},
getDirection:function (treeSet, node) {
return node.getOrder() % 2 == 0 ? 1 : -1;
getChildDirection:function (treeSet, child) {
return child.getOrder() % 2 == 0 ? 1 : -1;
},
toString:function () {
return "Balanced Sorter";
},
_getOrderForPosition:function (rootNode, position) {
return position.x > rootNode.getPosition().x ? 0 : 1;
},
_getChildrenForSide:function (parent, graph, position) {
position = position || {x:parent.getPosition().x + 1, y:parent.getPosition().y + 1};
var rootPosition = graph.getRootNode(parent).getPosition();
return graph.getChildren(parent).filter(function (child) {
return position.x > rootPosition.x ? child.getPosition().x > rootPosition.x : child.getPosition().x < rootPosition.x;
});
},
_getChildrenForOrder:function (parent, graph, order) {
return this._getSortedChildren(graph, parent).filter(function (child) {
return child.getOrder() % 2 == order % 2;