@@ -24,28 +24,24 @@ export class Brush extends Mark {
24
24
this . currentElement = null ;
25
25
}
26
26
render ( index , { x, y} , { x : X , y : Y } , dimensions ) {
27
- const { marginLeft, width, marginRight, marginTop, height, marginBottom} = dimensions ;
28
27
const { ariaLabel, ariaDescription, ariaHidden, ...options } = this ;
29
- const left = marginLeft ;
30
- const top = marginTop ;
31
- const right = width - marginRight ;
32
- const bottom = height - marginBottom ;
33
- const mark = this ;
28
+ const { marginLeft, width, marginRight, marginTop, height, marginBottom} = dimensions ;
29
+ const brush = this ;
34
30
const g = create ( "svg:g" )
35
31
. call ( applyIndirectStyles , { ariaLabel, ariaDescription, ariaHidden} )
36
32
. call ( ( X && Y ? brusher : X ? brusherX : brusherY ) ( )
37
- . extent ( [ [ left , top ] , [ right , bottom ] ] )
33
+ . extent ( [ [ marginLeft , marginTop ] , [ width - marginRight , height - marginBottom ] ] )
38
34
. on ( "start brush end" , function ( event ) {
39
35
const { type, selection} = event ;
40
36
// For faceting, when starting a brush in a new facet, clear the
41
37
// brush and selection on the old facet. In the future, we might
42
38
// allow independent brushes across facets by disabling this?
43
- if ( type === "start" && mark . currentElement !== this ) {
44
- if ( mark . currentElement !== null ) {
45
- select ( mark . currentElement ) . call ( event . target . clear , event ) ;
46
- mark . currentElement . selection = null ;
39
+ if ( type === "start" && brush . currentElement !== this ) {
40
+ if ( brush . currentElement !== null ) {
41
+ select ( brush . currentElement ) . call ( event . target . clear , event ) ;
42
+ brush . currentElement . selection = null ;
47
43
}
48
- mark . currentElement = this ;
44
+ brush . currentElement = this ;
49
45
}
50
46
let S = null ;
51
47
if ( selection ) {
0 commit comments