Skip to content

Commit

Permalink
Remove unused set of selected values and cache the set of annotation IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
arteymix committed Sep 1, 2023
1 parent 959f1d6 commit de01189
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/components/AnnotationSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export default {
* @returns {(*&{isCategory: boolean, children: *, id: *})[]}
*/
rankedAnnotations() {
let selectedValues = new Set(this.selectedValues);
let byNumberOfExpressionExperiments = (a, b) => {
return this.getNumberOfExpressionExperiments(b) - this.getNumberOfExpressionExperiments(a);
};
Expand Down
16 changes: 5 additions & 11 deletions src/components/DatasetPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,13 @@ export default {
BioMaterial: 'blue'
};
},
availableAnnotationIds() {
return new Set(this.availableAnnotations.flatMap(c => c.children).map(this.getId));
},
availableAnnotationsIncludedTerms() {
const availableAnnotationIds = new Set();
this.availableAnnotations.forEach(annotation => {
annotation.children.forEach(child => {
availableAnnotationIds.add(this.getId(child));
});
});
const filteredIncludedTerms = this.includedTerms.filter(term => {
return availableAnnotationIds.has(this.getId(term));
return this.includedTerms.filter(term => {
return this.availableAnnotationIds.has(this.getId(term));
});
return filteredIncludedTerms;
},
...mapState({
debug: state => state.debug
Expand Down

0 comments on commit de01189

Please sign in to comment.