@@ -7570,7 +7570,7 @@ d3 = function() {
75707570 return subticks ;
75717571 }
75727572 d3 . svg . brush = function ( ) {
7573- var event = d3_eventDispatch ( brush , "brushstart" , "brush" , "brushend" ) , x = null , y = null , resizes = d3_svg_brushResizes [ 0 ] , extent = [ [ 0 , 0 ] , [ 0 , 0 ] ] , extentDomain ;
7573+ var event = d3_eventDispatch ( brush , "brushstart" , "brush" , "brushend" ) , x = null , y = null , resizes = d3_svg_brushResizes [ 0 ] , extent = [ [ 0 , 0 ] , [ 0 , 0 ] ] , clamp = true , extentDomain ;
75747574 function brush ( g ) {
75757575 g . each ( function ( ) {
75767576 var g = d3 . select ( this ) , bg = g . selectAll ( ".background" ) . data ( [ 0 ] ) , fg = g . selectAll ( ".extent" ) . data ( [ 0 ] ) , tz = g . selectAll ( ".resize" ) . data ( resizes , String ) , e ;
@@ -7691,7 +7691,16 @@ d3 = function() {
76917691 r0 -= position ;
76927692 r1 -= size + position ;
76937693 }
7694- min = Math . max ( r0 , Math . min ( r1 , point [ i ] ) ) ;
7694+ if ( typeof clamp === "boolean" ) {
7695+ apply_clamp = clamp ;
7696+ } else {
7697+ apply_clamp = clamp [ i ] ;
7698+ }
7699+ if ( apply_clamp || ! dragging ) {
7700+ min = Math . max ( r0 , Math . min ( r1 , point [ i ] ) ) ;
7701+ } else {
7702+ min = point [ i ] ;
7703+ }
76957704 if ( dragging ) {
76967705 max = ( min += position ) + size ;
76977706 } else {
@@ -7733,6 +7742,11 @@ d3 = function() {
77337742 resizes = d3_svg_brushResizes [ ! x << 1 | ! y ] ;
77347743 return brush ;
77357744 } ;
7745+ brush . clamp = function ( z ) {
7746+ if ( ! arguments . length ) return clamp ;
7747+ clamp = z ;
7748+ return brush ;
7749+ } ;
77367750 brush . extent = function ( z ) {
77377751 var x0 , x1 , y0 , y1 , t ;
77387752 if ( ! arguments . length ) {
0 commit comments