File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -47,14 +47,18 @@ export class Brush extends Mark {
47
47
let index = filter ( I , X , Y ) ;
48
48
if ( selection ) {
49
49
if ( x ) {
50
- const e = y ? [ selection [ 0 ] [ 0 ] , selection [ 1 ] [ 0 ] ] : selection ;
51
- const [ x0 , x1 ] = extent ( e . map ( x . invert ) ) ;
52
- index = index . filter ( i => X [ i ] >= x0 && X [ i ] <= x1 ) ;
50
+ const [ x0 , x1 ] = y ? [ selection [ 0 ] [ 0 ] , selection [ 1 ] [ 0 ] ] : selection ;
51
+ index = index . filter ( i => {
52
+ const c = x ( X [ i ] ) ;
53
+ return c >= x0 && c <= x1 ;
54
+ } ) ;
53
55
}
54
56
if ( y ) {
55
- const e = x ? [ selection [ 0 ] [ 1 ] , selection [ 1 ] [ 1 ] ] : selection ;
56
- const [ y0 , y1 ] = extent ( e . map ( y . invert ) ) ;
57
- index = index . filter ( i => Y [ i ] >= y0 && Y [ i ] <= y1 ) ;
57
+ const [ y0 , y1 ] = x ? [ selection [ 0 ] [ 1 ] , selection [ 1 ] [ 1 ] ] : selection ;
58
+ index = index . filter ( i => {
59
+ const c = y ( Y [ i ] ) ;
60
+ return c >= y0 && c <= y1 ;
61
+ } ) ;
58
62
}
59
63
}
60
64
const dots = selection ? Array . from ( index , i => J [ i ] ) : data ;
You can’t perform that action at this time.
0 commit comments