Hi,
Indeed the code for the general morphing operation is only tested in the Hypertree/RGraph visualizations but not in the Spacetree visualization.
This is because I made some high level methods that wrap this object with (what I thought was) useful Tree specific functions like addSubtree and removeSubtree:
http://thejit.org/docs/files/Spacetree-js.html#ST.addSubtreeI think I spotted the bug though. I also created an issue at github. I don't have time right now to check if this works, but you can try it if you want.
Search for the "$design" function in jit.js. You'll find the Graph.eachSubnode method like this:
GUtil.eachSubnode(node, function(n) {
if(n.exist && (!multitree ||
('$orn' in n.data) &&
n.data.$orn == orn)) {
if(!chmaxsize)
chmaxsize = getBoundaries(graph, config, n._depth, orn);
var s = $design(n, chmaxsize[nots], acum + chacum);
trees.push(s.tree);
extents.push(s.extent);
}
});
This iterator should ignore all nodes that are going to be removed by the morphing operation. These nodes are flagged with "ignore=true". This is done by adding a flag list as third parameter to GUtil.eachSubnode:
GUtil.eachSubnode(node, function(n) {
if(n.exist && (!multitree ||
('$orn' in n.data) &&
n.data.$orn == orn)) {
if(!chmaxsize)
chmaxsize = getBoundaries(graph, config, n._depth, orn);
var s = $design(n, chmaxsize[nots], acum + chacum);
trees.push(s.tree);
extents.push(s.extent);
}
}, "ignore");
More info on this method can be found here:
http://thejit.org/docs/files/Graph-js.html#Graph.Util.eachSubnode
Lets hope that works ;)