File tree Expand file tree Collapse file tree 7 files changed +51
-39
lines changed Expand file tree Collapse file tree 7 files changed +51
-39
lines changed Original file line number Diff line number Diff line change @@ -258,7 +258,6 @@ var ConnectView = View.extend({
258
258
}
259
259
this . onConnectionSuccessful ( model , options ) ;
260
260
} . bind ( this ) ) ;
261
-
262
261
} . bind ( this ) ) ;
263
262
} ,
264
263
/**
Original file line number Diff line number Diff line change 33
33
34
34
function tip ( vis ) {
35
35
svg = getSVGNode ( vis ) ;
36
- if ( ! svg ) return ;
36
+ if ( ! svg ) {
37
+ return ;
38
+ }
37
39
point = svg . createSVGPoint ( ) ;
38
40
document . body . appendChild ( node ) ;
39
41
}
127
129
//
128
130
// Returns tip or direction
129
131
tip . direction = function ( v ) {
130
- if ( ! arguments . length ) return direction ;
132
+ if ( ! arguments . length ) {
133
+ return direction ;
134
+ }
131
135
direction = v == null ? v : d3 . functor ( v ) ;
132
136
133
137
return tip ;
139
143
//
140
144
// Returns offset or
141
145
tip . offset = function ( v ) {
142
- if ( ! arguments . length ) return offset ;
146
+ if ( ! arguments . length ) {
147
+ return offset ;
148
+ }
143
149
offset = v == null ? v : d3 . functor ( v ) ;
144
150
145
151
return tip ;
151
157
//
152
158
// Returns html value or tip
153
159
tip . html = function ( v ) {
154
- if ( ! arguments . length ) return html ;
160
+ if ( ! arguments . length ) {
161
+ return html ;
162
+ }
155
163
html = v == null ? v : d3 . functor ( v ) ;
156
164
157
165
return tip ;
270
278
271
279
function getSVGNode ( el ) {
272
280
el = el . node ( ) ;
273
- if ( ! el ) return ;
274
- if ( el . tagName . toLowerCase ( ) === 'svg' )
281
+ if ( ! el ) {
282
+ return ;
283
+ }
284
+ if ( el . tagName . toLowerCase ( ) === 'svg' ) {
275
285
return el ;
286
+ }
276
287
277
288
return el . ownerSVGElement ;
278
289
}
Original file line number Diff line number Diff line change @@ -159,9 +159,9 @@ var minicharts_d3fns_few = function() {
159
159
return d . tooltip ( d , i ) ;
160
160
}
161
161
return d . tooltip || tooltipHtml ( {
162
- label : shared . truncateTooltip ( d . label ) ,
163
- count : percentFormat ( d . count / sumValues * 100 , false )
164
- } ) ;
162
+ label : shared . truncateTooltip ( d . label ) ,
163
+ count : percentFormat ( d . count / sumValues * 100 , false )
164
+ } ) ;
165
165
} ) ;
166
166
el . call ( tip ) ;
167
167
Original file line number Diff line number Diff line change @@ -199,9 +199,9 @@ var minicharts_d3fns_many = function() {
199
199
return d . tooltip ( d , i ) ;
200
200
}
201
201
return d . tooltip || tooltipHtml ( {
202
- label : shared . truncateTooltip ( d . label ) ,
203
- count : percentFormat ( d . count / sumValues * 100 , false )
204
- } ) ;
202
+ label : shared . truncateTooltip ( d . label ) ,
203
+ count : percentFormat ( d . count / sumValues * 100 , false )
204
+ } ) ;
205
205
} ) ;
206
206
el . call ( tip ) ;
207
207
Original file line number Diff line number Diff line change @@ -59,23 +59,23 @@ module.exports = {
59
59
60
60
// determine what kind of query this is (distinct or range)
61
61
switch ( this . model . getType ( ) ) {
62
- case 'Boolean' : // fall-through to String
63
- case 'String' :
62
+ case 'Boolean' : // fall-through to String
63
+ case 'String' :
64
+ queryType = 'distinct' ;
65
+ break ;
66
+ case 'Number' :
67
+ if ( data . source === 'unique' ) {
64
68
queryType = 'distinct' ;
65
- break ;
66
- case 'Number' :
67
- if ( data . source === 'unique' ) {
68
- queryType = 'distinct' ;
69
- } else {
70
- queryType = 'range' ;
71
- }
72
- break ;
73
- case 'ObjectID' : // fall-through to Date
74
- case 'Date' :
69
+ } else {
75
70
queryType = 'range' ;
76
- break ;
77
- default : // @todo other types not implemented yet
78
- throw new Error ( 'unsupported querybuilder type ' + this . model . getType ( ) ) ;
71
+ }
72
+ break ;
73
+ case 'ObjectID' : // fall-through to Date
74
+ case 'Date' :
75
+ queryType = 'range' ;
76
+ break ;
77
+ default : // @todo other types not implemented yet
78
+ throw new Error ( 'unsupported querybuilder type ' + this . model . getType ( ) ) ;
79
79
}
80
80
81
81
// now call appropriate event handlers and query build methods
Original file line number Diff line number Diff line change @@ -89,16 +89,16 @@ var VizView = AmpersandView.extend({
89
89
// pick html, canvas or svg template
90
90
if ( ! this . template ) {
91
91
switch ( this . renderMode ) {
92
- case 'canvas' :
93
- this . template = '<canvas data-hook="viz-container" id="canvas"></canvas>' ;
94
- break ;
95
- case 'svg' :
96
- this . template = require ( './svg-template.jade' ) ;
97
- break ;
98
- case 'html' :
99
- default :
100
- this . template = '<div data-hook="viz-container"></div>' ;
101
- break ;
92
+ case 'canvas' :
93
+ this . template = '<canvas data-hook="viz-container" id="canvas"></canvas>' ;
94
+ break ;
95
+ case 'svg' :
96
+ this . template = require ( './svg-template.jade' ) ;
97
+ break ;
98
+ case 'html' :
99
+ default :
100
+ this . template = '<div data-hook="viz-container"></div>' ;
101
+ break ;
102
102
}
103
103
}
104
104
} ,
Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ module.exports = Connection.extend({
25
25
var model = this ;
26
26
debug ( 'Testing connection to `%j`...' , this ) ;
27
27
client . test ( app . endpoint , this , function ( err ) {
28
- if ( err ) return done ( err ) ;
28
+ if ( err ) {
29
+ return done ( err ) ;
30
+ }
29
31
30
32
debug ( 'test worked!' ) ;
31
33
done ( null , model ) ;
You can’t perform that action at this time.
0 commit comments