File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 588
588
. attr ( 'd' , function ( d ) { return d . path ; } ) ;
589
589
590
590
// draw the selection area
591
+ var selectionExtent = [
592
+ d3 . min ( items , function ( d ) { return d . start ; } ) ,
593
+ d3 . max ( items , function ( d ) { return d . end ; } ) ] ;
591
594
var brush = d3 . svg . brush ( )
592
595
. x ( x )
593
- . extent ( [
594
- d3 . min ( items , function ( d ) { return d . start ; } ) ,
595
- d3 . max ( items , function ( d ) { return d . end ; } ) ] )
596
+ . extent ( selectionExtent )
596
597
. on ( "brush" , display ) ;
597
598
598
599
mini . append ( 'g' )
606
607
display ( ) ;
607
608
608
609
function display ( ) {
609
- var minExtent = Math . max ( 0 , brush . extent ( ) [ 0 ] ) ;
610
- var maxExtent = Math . min ( lastEndTime , brush . extent ( ) [ 1 ] ) ;
610
+ var minExtent = Math . max ( selectionExtent [ 0 ] , brush . extent ( ) [ 0 ] ) ;
611
+ var maxExtent = Math . min ( selectionExtent [ 1 ] , brush . extent ( ) [ 1 ] ) ;
611
612
var visItems = items . filter ( function ( d ) { return d . start < maxExtent && d . end > minExtent } ) ;
612
613
613
614
mini . select ( '.brush' ) . call ( brush . extent ( [ minExtent , maxExtent ] ) ) ;
You can’t perform that action at this time.
0 commit comments