Skip to content

Commit 40de12c

Browse files
committed
Style changes to make [email protected] happy
1 parent 67bf6cd commit 40de12c

File tree

7 files changed

+51
-39
lines changed

7 files changed

+51
-39
lines changed

src/connect/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ var ConnectView = View.extend({
258258
}
259259
this.onConnectionSuccessful(model, options);
260260
}.bind(this));
261-
262261
}.bind(this));
263262
},
264263
/**

src/minicharts/d3-tip.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333

3434
function tip(vis) {
3535
svg = getSVGNode(vis);
36-
if (!svg) return;
36+
if (!svg) {
37+
return;
38+
}
3739
point = svg.createSVGPoint();
3840
document.body.appendChild(node);
3941
}
@@ -127,7 +129,9 @@
127129
//
128130
// Returns tip or direction
129131
tip.direction = function(v) {
130-
if (!arguments.length) return direction;
132+
if (!arguments.length) {
133+
return direction;
134+
}
131135
direction = v == null ? v : d3.functor(v);
132136

133137
return tip;
@@ -139,7 +143,9 @@
139143
//
140144
// Returns offset or
141145
tip.offset = function(v) {
142-
if (!arguments.length) return offset;
146+
if (!arguments.length) {
147+
return offset;
148+
}
143149
offset = v == null ? v : d3.functor(v);
144150

145151
return tip;
@@ -151,7 +157,9 @@
151157
//
152158
// Returns html value or tip
153159
tip.html = function(v) {
154-
if (!arguments.length) return html;
160+
if (!arguments.length) {
161+
return html;
162+
}
155163
html = v == null ? v : d3.functor(v);
156164

157165
return tip;
@@ -270,9 +278,12 @@
270278

271279
function getSVGNode(el) {
272280
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') {
275285
return el;
286+
}
276287

277288
return el.ownerSVGElement;
278289
}

src/minicharts/d3fns/few.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ var minicharts_d3fns_few = function() {
159159
return d.tooltip(d, i);
160160
}
161161
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+
});
165165
});
166166
el.call(tip);
167167

src/minicharts/d3fns/many.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ var minicharts_d3fns_many = function() {
199199
return d.tooltip(d, i);
200200
}
201201
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+
});
205205
});
206206
el.call(tip);
207207

src/minicharts/querybuilder.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,23 @@ module.exports = {
5959

6060
// determine what kind of query this is (distinct or range)
6161
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') {
6468
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 {
7570
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());
7979
}
8080

8181
// now call appropriate event handlers and query build methods

src/minicharts/viz.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@ var VizView = AmpersandView.extend({
8989
// pick html, canvas or svg template
9090
if (!this.template) {
9191
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;
102102
}
103103
}
104104
},

src/models/connection.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ module.exports = Connection.extend({
2525
var model = this;
2626
debug('Testing connection to `%j`...', this);
2727
client.test(app.endpoint, this, function(err) {
28-
if (err) return done(err);
28+
if (err) {
29+
return done(err);
30+
}
2931

3032
debug('test worked!');
3133
done(null, model);

0 commit comments

Comments
 (0)