@@ -50,6 +50,7 @@ var minicharts_d3fns_date = function() {
5050
5151 var brush = d3 . svg . brush ( )
5252 . x ( barcodeX )
53+ . on ( 'brushstart' , brushstart )
5354 . on ( 'brush' , brushed )
5455 . on ( 'brushend' , brushend ) ;
5556
@@ -118,6 +119,7 @@ var minicharts_d3fns_date = function() {
118119 var background = parent . find ( 'g.brush > rect.background' ) [ 0 ] ;
119120 var brushNode = parent . find ( 'g.brush' ) [ 0 ] ;
120121 var start = barcodeX . invert ( d3 . mouse ( background ) [ 0 ] ) ;
122+ brushstart . call ( brushNode , line ) ;
121123
122124 var w = d3 . select ( window )
123125 . on ( 'mousemove' , mousemove )
@@ -167,7 +169,9 @@ var minicharts_d3fns_date = function() {
167169 var upperBarBottom = innerHeight / 2 - 20 ;
168170
169171 barcodeX
170- . domain ( d3 . extent ( values , function ( d ) { return d . ts ; } ) )
172+ . domain ( d3 . extent ( values , function ( d ) {
173+ return d . ts ;
174+ } ) )
171175 . range ( [ 0 , innerWidth ] ) ;
172176
173177 // group by weekdays
@@ -210,27 +214,27 @@ var minicharts_d3fns_date = function() {
210214 gEnter . append ( 'g' )
211215 . attr ( 'class' , 'weekday' )
212216 . append ( 'text' )
213- . attr ( 'class' , 'date-icon fa-fw' )
214- . attr ( 'x' , 0 )
215- . attr ( 'dx' , '-0.6em' )
216- . attr ( 'y' , 0 )
217- . attr ( 'dy' , '1em' )
218- . attr ( 'text-anchor' , 'end' )
219- . attr ( 'font-family' , 'FontAwesome' )
220- . text ( '\uf133' ) ;
217+ . attr ( 'class' , 'date-icon fa-fw' )
218+ . attr ( 'x' , 0 )
219+ . attr ( 'dx' , '-0.6em' )
220+ . attr ( 'y' , 0 )
221+ . attr ( 'dy' , '1em' )
222+ . attr ( 'text-anchor' , 'end' )
223+ . attr ( 'font-family' , 'FontAwesome' )
224+ . text ( '\uf133' ) ;
221225
222226 gEnter . append ( 'g' )
223227 . attr ( 'class' , 'hour' )
224228 . attr ( 'transform' , 'translate(' + ( width / ( upperRatio + 1 ) + upperMargin ) + ', 0)' )
225229 . append ( 'text' )
226- . attr ( 'class' , 'date-icon fa-fw' )
227- . attr ( 'x' , 0 )
228- . attr ( 'dx' , '-0.6em' )
229- . attr ( 'y' , 0 )
230- . attr ( 'dy' , '1em' )
231- . attr ( 'text-anchor' , 'end' )
232- . attr ( 'font-family' , 'FontAwesome' )
233- . text ( '\uf017' ) ;
230+ . attr ( 'class' , 'date-icon fa-fw' )
231+ . attr ( 'x' , 0 )
232+ . attr ( 'dx' , '-0.6em' )
233+ . attr ( 'y' , 0 )
234+ . attr ( 'dy' , '1em' )
235+ . attr ( 'text-anchor' , 'end' )
236+ . attr ( 'font-family' , 'FontAwesome' )
237+ . text ( '\uf017' ) ;
234238
235239 var gBrush = g . selectAll ( '.brush' ) . data ( [ 0 ] ) ;
236240 gBrush . enter ( ) . append ( 'g' )
@@ -251,8 +255,8 @@ var minicharts_d3fns_date = function() {
251255 . on ( 'mouseout' , tip . hide )
252256 . on ( 'mousedown' , handleMouseDown ) ;
253257
254- // disabling direct onClick handler in favor of click-drag
255- // .on('click', handleClick);
258+ // disabling direct onClick handler in favor of click-drag
259+ // .on('click', handleClick);
256260
257261 lines
258262 . attr ( 'y1' , barcodeTop )
0 commit comments