Skip to content

Commit

Permalink
Merge pull request #1570
Browse files Browse the repository at this point in the history
Fix Hide Unselected Cases for maps and graphs
  • Loading branch information
bfinzer authored Oct 29, 2024
2 parents 53874f2 + 29012f0 commit 140ea6f
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,12 @@ export const DataConfigurationModel = types
* present in any of the case sets, not just the 0th one.
*/
get selection() {
if (!self.dataset || !self.filteredCases[0]) return []
if (!self.dataset) return []
return Array.from(this.visibleCaseIds).filter(caseId => self.dataset?.isCaseSelected(caseId))
},
/**
* Note that in order to eliminate a selected case from the graph's selection, we have to check that it is not
* present in any of the case sets, not just the 0th one.
*/
get unselectedCases() {
if (!self.dataset || !self.filteredCases[0]) return []
const selection = self.dataset.selection,
allGraphCaseIds = Array.from(this.visibleCaseIds)
return allGraphCaseIds.filter((caseId: string) => !selection.has(caseId))
if (!self.dataset) return []
return Array.from(this.visibleCaseIds).filter(caseId => !self.dataset?.isCaseSelected(caseId))
}
}))
.views(self => ({
Expand Down

0 comments on commit 140ea6f

Please sign in to comment.