phylotree
Version:
A JavaScript library for developing applications and interactive visualizations involving [phylogenetic trees](https://en.wikipedia.org/wiki/Phylogenetic_tree), written as an extension of the [D3](http://d3js.org) [hierarchy layout](https://github.com/d3/
21 lines (18 loc) • 431 B
JavaScript
function handleRotate(only_self, this_node) {
// TODO: This might need tested
tree.resortChildren( // eslint-disable-line
function(node1, node2) {
return node2.ordering - node1.ordering;
},
this_node,
only_self
? function(node) {
return node == this_node;
}
: null
);
this_node.children.forEach(function(n, i) {
n.ordering = i;
});
}
export default handleRotate;