diff --git a/src/components/tree/phyloTree/helpers.js b/src/components/tree/phyloTree/helpers.js index 4be4dc830..82a13684e 100644 --- a/src/components/tree/phyloTree/helpers.js +++ b/src/components/tree/phyloTree/helpers.js @@ -2,6 +2,7 @@ import { max } from "d3-array"; import {getTraitFromNode, getDivFromNode, getBranchMutations} from "../../../util/treeMiscHelpers"; import { NODE_VISIBLE } from "../../../util/globals"; +import { timerStart, timerEnd } from "../../../util/perf"; /** get a string to be used as the DOM element ID * Note that this cannot have any "special" characters @@ -88,6 +89,8 @@ function _getSpaceBetweenSubtrees(numSubtrees, numTips) { * @returns {undefined} */ export const setDisplayOrder = ({nodes, focus}) => { + timerStart("setDisplayOrder"); + const numSubtrees = nodes[0].n.children.filter((n) => n.fullTipCount!==0).length; const numTips = focus ? nodes[0].n.tipCount : nodes[0].n.fullTipCount; const spaceBetweenSubtrees = _getSpaceBetweenSubtrees(numSubtrees, numTips); @@ -135,6 +138,8 @@ export const setDisplayOrder = ({nodes, focus}) => { /* note that nodes[0] is a dummy node holding each subtree */ nodes[0].displayOrder = undefined; nodes[0].displayOrderRange = [undefined, undefined]; + + timerEnd("setDisplayOrder"); };