@@ -50,6 +50,7 @@ var minicharts_d3fns_date = function() {
50
50
51
51
var brush = d3 . svg . brush ( )
52
52
. x ( barcodeX )
53
+ . on ( 'brushstart' , brushstart )
53
54
. on ( 'brush' , brushed )
54
55
. on ( 'brushend' , brushend ) ;
55
56
@@ -118,6 +119,7 @@ var minicharts_d3fns_date = function() {
118
119
var background = parent . find ( 'g.brush > rect.background' ) [ 0 ] ;
119
120
var brushNode = parent . find ( 'g.brush' ) [ 0 ] ;
120
121
var start = barcodeX . invert ( d3 . mouse ( background ) [ 0 ] ) ;
122
+ brushstart . call ( brushNode , line ) ;
121
123
122
124
var w = d3 . select ( window )
123
125
. on ( 'mousemove' , mousemove )
@@ -167,7 +169,9 @@ var minicharts_d3fns_date = function() {
167
169
var upperBarBottom = innerHeight / 2 - 20 ;
168
170
169
171
barcodeX
170
- . domain ( d3 . extent ( values , function ( d ) { return d . ts ; } ) )
172
+ . domain ( d3 . extent ( values , function ( d ) {
173
+ return d . ts ;
174
+ } ) )
171
175
. range ( [ 0 , innerWidth ] ) ;
172
176
173
177
// group by weekdays
@@ -210,27 +214,27 @@ var minicharts_d3fns_date = function() {
210
214
gEnter . append ( 'g' )
211
215
. attr ( 'class' , 'weekday' )
212
216
. 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' ) ;
221
225
222
226
gEnter . append ( 'g' )
223
227
. attr ( 'class' , 'hour' )
224
228
. attr ( 'transform' , 'translate(' + ( width / ( upperRatio + 1 ) + upperMargin ) + ', 0)' )
225
229
. 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' ) ;
234
238
235
239
var gBrush = g . selectAll ( '.brush' ) . data ( [ 0 ] ) ;
236
240
gBrush . enter ( ) . append ( 'g' )
@@ -251,8 +255,8 @@ var minicharts_d3fns_date = function() {
251
255
. on ( 'mouseout' , tip . hide )
252
256
. on ( 'mousedown' , handleMouseDown ) ;
253
257
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);
256
260
257
261
lines
258
262
. attr ( 'y1' , barcodeTop )
0 commit comments