diff --git a/src/components/tree/phyloTree/layouts.js b/src/components/tree/phyloTree/layouts.js index 164fcc7d8..17cd4b39c 100644 --- a/src/components/tree/phyloTree/layouts.js +++ b/src/components/tree/phyloTree/layouts.js @@ -290,12 +290,12 @@ export const setDistance = function setDistance(distanceAttribute) { }; /** - * given nodes add y values (node.yvalue) to every node + * given nodes add y values (node.displayOrder) to every node * Nodes are the phyloTree nodes (i.e. node.n is the redux node) * Nodes must have parent child links established (via createChildrenAndParents) * PhyloTree can subsequently use this information. Accessed by prototypes * rectangularLayout, radialLayout, createChildrenAndParents - * side effects: node.n.yvalue (i.e. in the redux node) and node.yRange (i.e. in the phyloTree node) + * side effects: node.displayOrder and node.displayOrderRange (i.e. in the phyloTree node) */ export const calcYValues = (nodes, spacing = "even") => { // console.log("calcYValues started with ", spacing); @@ -321,13 +321,13 @@ export const calcYValues = (nodes, spacing = "even") => { recurse(node.children[i]); } } else { - node.n.yvalue = calcY(node); - node.yRange = [node.n.yvalue, node.n.yvalue]; + node.displayOrder = calcY(node); + node.displayOrderRange = [node.displayOrder, node.displayOrder]; return; } /* if here, then all children have yvalues, but we dont. */ - node.n.yvalue = node.children.reduce((acc, d) => acc + d.n.yvalue, 0) / node.children.length; - node.yRange = [node.n.children[0].yvalue, node.n.children[node.n.children.length - 1].yvalue]; + node.displayOrder = node.children.reduce((acc, d) => acc + d.displayOrder, 0) / node.children.length; + node.displayOrderRange = [node.n.children[0].displayOrder, node.n.children[node.n.children.length - 1].displayOrder]; }; recurse(nodes[0]); };