@@ -28,14 +28,6 @@ export class Filter {
2828 return filteredArray . filter ( value => value >= this . minValue && value <= this . maxValue )
2929 }
3030
31- public getFilteredIndices ( filteredArray : number [ ] ) : number [ ] {
32- const indices = [ ] ;
33- filteredArray . forEach ( ( value , index ) => {
34- if ( value >= this . minValue && value <= this . maxValue ) indices . push ( index ) ;
35- } )
36- return indices
37- }
38-
3931 public static fromRubberBand ( rubberBand : RubberBand ) : Filter {
4032 return new Filter ( rubberBand . attributeName , rubberBand . minValue , rubberBand . maxValue )
4133 }
@@ -335,9 +327,7 @@ export class Multiplot {
335327
336328 private updateSelectedIndices ( ) : void {
337329 const previousIndices = [ ...this . selectedIndices ] ;
338- const filteredIndices = this . getFilteredIndices ( ) ;
339330 this . selectedIndices = range ( 0 , this . nSamples ) ;
340- if ( filteredIndices . length != 0 ) this . selectedIndices = arrayIntersection ( this . selectedIndices , this . getFilteredIndices ( ) ) ;
341331 let isSelecting = false ;
342332 this . figures . forEach ( figure => [ this . selectedIndices , isSelecting ] = figure . multiplotSelectedIntersection ( this . selectedIndices , isSelecting ) ) ;
343333 if ( this . selectedIndices . length == this . nSamples && ! isSelecting ) this . selectedIndices = [ ] ;
@@ -378,18 +368,15 @@ export class Multiplot {
378368 this . draw ( ) ;
379369 }
380370
381- private getFilteredIndices ( ) : number [ ] {
382- const filteredIndices = [ ] ;
383- this . filters . forEach ( filter => {
384- if ( filter . isDefined ) filteredIndices . push ( filter . getFilteredIndices ( this . features . get ( filter . attribute ) ) ) ;
385- } )
386- return intersectArrays ( filteredIndices )
387- }
388-
389371 private setRubberBandsFromFilters ( feature : string , minValue : number , maxValue : number ) : void {
390372 if ( ! this . rubberBands ) this . initRubberBands ( ) ;
391373 for ( const figure of this . figures ) {
392- if ( figure . setFeatureFilter ( feature , minValue , maxValue ) ) break ;
374+ if ( figure . setFeatureFilter ( feature , minValue , maxValue ) ) {
375+ this . isSelecting = true ;
376+ this . updateRubberBands ( figure ) ;
377+ this . isSelecting = false ;
378+ break ;
379+ }
393380 }
394381 }
395382
0 commit comments