From 6d6bb74a06fa77cffb7bfdcb6ec280642a367d03 Mon Sep 17 00:00:00 2001 From: GaelleA Date: Thu, 25 Jun 2026 10:31:46 -0400 Subject: [PATCH] fix(summary): SJIP-1575 fix on click mondo and phenotype graphs --- .../MostFrequentDiagnosisGraphCard/index.tsx | 2 +- .../MostFrequentPhenotypesGraphCard/index.tsx | 32 ++++++++++--------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/views/DataExploration/components/PageContent/tabs/Summary/MostFrequentDiagnosisGraphCard/index.tsx b/src/views/DataExploration/components/PageContent/tabs/Summary/MostFrequentDiagnosisGraphCard/index.tsx index 6e4ea347..5487fcc5 100644 --- a/src/views/DataExploration/components/PageContent/tabs/Summary/MostFrequentDiagnosisGraphCard/index.tsx +++ b/src/views/DataExploration/components/PageContent/tabs/Summary/MostFrequentDiagnosisGraphCard/index.tsx @@ -66,7 +66,7 @@ const MostFrequentDiagnosisGraphCard = () => { useEffect(() => { setMondoLoading(true); - phenotypeStore.current?.fetch({ field: 'mondo', sqon }).then(() => { + phenotypeStore.current?.fetch({ field: 'mondo', sqon, filterThemselves: true }).then(() => { setMondoLoading(false); const flattenMondoTree = getFlattenTree(phenotypeStore.current?.tree as TreeNode).sort( (a, b) => { diff --git a/src/views/DataExploration/components/PageContent/tabs/Summary/MostFrequentPhenotypesGraphCard/index.tsx b/src/views/DataExploration/components/PageContent/tabs/Summary/MostFrequentPhenotypesGraphCard/index.tsx index 4fb22b51..f011fa0f 100644 --- a/src/views/DataExploration/components/PageContent/tabs/Summary/MostFrequentPhenotypesGraphCard/index.tsx +++ b/src/views/DataExploration/components/PageContent/tabs/Summary/MostFrequentPhenotypesGraphCard/index.tsx @@ -89,21 +89,23 @@ const MostFrequentPhenotypesGraphCard = () => { useEffect(() => { setPhenotypesLoading(true); - phenotypeStore.current?.fetch({ field: 'observed_phenotype', sqon }).then(() => { - setPhenotypesLoading(false); - const flattenHPOTree = getFlattenTree(phenotypeStore.current?.tree as TreeNode).sort( - (a, b) => { - if ((a.exactTagCount ?? 0) > (b.exactTagCount ?? 0)) { - return -1; - } - if ((a.exactTagCount ?? 0) < (b.exactTagCount ?? 0)) { - return 1; - } - return 0; - }, - ); - setPhenotypes(filterPhenotypesData(treeNodeToChartData(flattenHPOTree)).reverse()); - }); + phenotypeStore.current + ?.fetch({ field: 'observed_phenotype', sqon, filterThemselves: true }) + .then(() => { + setPhenotypesLoading(false); + const flattenHPOTree = getFlattenTree(phenotypeStore.current?.tree as TreeNode).sort( + (a, b) => { + if ((a.exactTagCount ?? 0) > (b.exactTagCount ?? 0)) { + return -1; + } + if ((a.exactTagCount ?? 0) < (b.exactTagCount ?? 0)) { + return 1; + } + return 0; + }, + ); + setPhenotypes(filterPhenotypesData(treeNodeToChartData(flattenHPOTree)).reverse()); + }); }, [JSON.stringify(sqon)]); return (