From c22d98176f5808cb8ef89556e0c543e8fdb1f07c Mon Sep 17 00:00:00 2001 From: Shashank Budhanuru Ramaraju Date: Mon, 18 Nov 2024 13:45:09 +0000 Subject: [PATCH] fixes --- .../LinearApolloDisplay/stateModel/layouts.ts | 12 ++++---- .../src/components/FilterFeatures.tsx | 28 ++++++++++--------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/stateModel/layouts.ts b/packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/stateModel/layouts.ts index 7ea4823d..6d6c0081 100644 --- a/packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/stateModel/layouts.ts +++ b/packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/stateModel/layouts.ts @@ -37,7 +37,9 @@ export function layoutsModelFactory( if ( refName !== assembly?.getCanonicalRefName(feature.refSeq) || !doesIntersect2(start, end, feature.min, feature.max) || - feature.length > self.featuresMinMaxLimit + feature.length > self.featuresMinMaxLimit || + (self.filteredFeatureTypes && + !self.filteredFeatureTypes.includes(feature.type)) ) { continue } @@ -90,7 +92,9 @@ export function layoutsModelFactory( } if ( refName !== assembly?.getCanonicalRefName(feature.refSeq) || - !doesIntersect2(start, end, feature.min, feature.max) + !doesIntersect2(start, end, feature.min, feature.max) || + (self.filteredFeatureTypes && + !self.filteredFeatureTypes.includes(feature.type)) ) { continue } @@ -226,9 +230,7 @@ export function layoutsModelFactory( feature.min, feature.max, ) && - !self.seenFeatures.has(feature._id) && - self.filteredFeatureTypes && - self.filteredFeatureTypes.includes(feature.type) + !self.seenFeatures.has(feature._id) ) { self.addSeenFeature(feature) } diff --git a/packages/jbrowse-plugin-apollo/src/components/FilterFeatures.tsx b/packages/jbrowse-plugin-apollo/src/components/FilterFeatures.tsx index f1d15226..3b392500 100644 --- a/packages/jbrowse-plugin-apollo/src/components/FilterFeatures.tsx +++ b/packages/jbrowse-plugin-apollo/src/components/FilterFeatures.tsx @@ -96,20 +96,22 @@ export const FilterFeatures = observer(function FilterFeatures({ {selectedFeatureTypes.length > 0 && ( -
+

- Selected feature types: - - {selectedFeatureTypes.map((value) => ( - { - handleFeatureTypeDelete(value) - }} - /> - ))} - +
+ Selected feature types: + + {selectedFeatureTypes.map((value) => ( + { + handleFeatureTypeDelete(value) + }} + /> + ))} + +
)}