diff --git a/src/components/info/filtersSummary.js b/src/components/info/filtersSummary.js index f905695ab..fce050231 100644 --- a/src/components/info/filtersSummary.js +++ b/src/components/info/filtersSummary.js @@ -33,6 +33,7 @@ const closeBracketSmall = a.value < b.value ? -1 : a.value > b.value ? 1 : 0) .map((item) => { let label = `${item.value}`; - if (filterName!==strainSymbol) label+= ` (${this.props.totalStateCounts[filterName].get(item.value)})`; + if (filterName!==strainSymbol) { + /* Add the _total_ occurrences in parentheses. We don't compute the intersections / visible values here - + e.g. we can have "England (5)" "North America (100)" even though such an intersection will deselect everything. + If we have two trees shown we show both values. + */ + const tree1count = this.props.totalStateCounts[filterName]?.get(item.value) ?? 0; + if (this.props.totalStateCountsSecondTree) { + const tree2count = this.props.totalStateCountsSecondTree[filterName]?.get(item.value) ?? 0; + label+=` (L: ${tree1count}, R: ${tree2count})`; + } else { + label+=` (${tree1count})`; + } + } return this.createIndividualBadge({filterName, item, label, onHoverMessage}); }); }