Skip to content

Commit 75f0d98

Browse files
authored
Merge pull request #2004 from nextstrain/selected-branch-labels
Update "Show all labels" only show branch labels for visible branches
2 parents 1af86ab + 43e53c7 commit 75f0d98

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Changelog
22

3+
* "show all branch labels" toggle has been updated to only show labels for visible branches, i.e. branches of selected tips after applying filters ([#2004](https://github.com/nextstrain/auspice/pull/2004))
4+
35
## version 2.64.0 - 2025/08/15
46

57

src/components/tree/phyloTree/labels.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,16 @@ const branchLabelFontWeight = (key) => {
7272

7373
/** createBranchLabelVisibility (the return value should be passed to d3 style call)
7474
* @param {str} key e.g. "aa" or "clade"
75-
* @param {bool} showAll
75+
* @param {bool} showAll show all labels for visible nodes
7676
* @param {str} layout
7777
* @param {int} totalTipsInView visible tips also in view
7878
* @return {func} Returns a function with 1 argument: the current node (branch).
7979
* This fn will return "visible" or "hidden".
8080
* NOTE: the fn should only be provided nodes which have a label.
8181
*/
8282
const createBranchLabelVisibility = (key, showAll, layout, totalTipsInView) => (d) => {
83-
if (showAll) return "visible";
8483
if (d.visibility !== NODE_VISIBLE) return "hidden";
84+
if (showAll) return "visible";
8585
const magicTipFractionToShowBranchLabel = 0.03;
8686
/* if the number of _visible_ tips descending from this node are over the
8787
magicTipFractionToShowBranchLabel (c/w the total number of _visible_ and

0 commit comments

Comments
 (0)