Skip to content

Commit

Permalink
Merge pull request #1503 from nextstrain/show-subtree-labels
Browse files Browse the repository at this point in the history
Show labels for subtree root nodes
  • Loading branch information
jameshadfield authored Apr 28, 2022
2 parents 27a88ad + 83da57e commit c8cf8ab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/tree/phyloTree/labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ const createBranchLabelVisibility = (key, layout, totalTipsInView) => (d) => {
if (d.n.tipCount > magicTipFractionToShowBranchLabel * totalTipsInView) {
return "visible";
}
/* if the label is on the root of a subtree then always show it
(unless the label is "aa" as these can be very long) */
if (key!=='aa' && (d.n.name===d.n.parent.name || d.n.parent.name==="__ROOT")) {
return "visible";
}
return "hidden";
};

Expand Down

0 comments on commit c8cf8ab

Please sign in to comment.