Skip to content

Commit 00a1742

Browse files
committed
cleanup code
1 parent a7a8ce1 commit 00a1742

File tree

6 files changed

+28
-25
lines changed

6 files changed

+28
-25
lines changed

src/minicharts/d3fns/date.js

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

src/minicharts/d3fns/many.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var minicharts_d3fns_many = function() {
1616
bgbars: false,
1717
scale: false,
1818
labels: false, // label defaults will be set further below
19-
selectable: true // setting to false disables query builder for this chart
19+
selectable: true // setting to false disables query builder for this chart
2020
};
2121

2222
var xScale = d3.scale.ordinal();

src/minicharts/querybuilder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ module.exports = {
317317
} else if (message.dx === 0) {
318318
// handle non-binned ranges
319319
mustSelect = checkBounds[message.lowerOp](d.value, message.selected[0])
320-
&& checkBounds[message.upperOp](d.value, message.selected[1]);
320+
&& checkBounds[message.upperOp](d.value, message.selected[1]);
321321
} else {
322322
// handle binned ranges
323323
var halfSelect = false;

src/minicharts/viz.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var AmpersandView = require('ampersand-view');
22
var _ = require('lodash');
33
var $ = require('jquery');
44
var d3 = require('d3');
5-
var debug = require('debug')('scout:minicharts:viz');
5+
// var debug = require('debug')('scout:minicharts:viz');
66

77
var VizView = AmpersandView.extend({
88
_values: {},

src/models/editable-query.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ var Model = require('ampersand-model');
22
var EJSON = require('mongodb-extended-json');
33
var Query = require('mongodb-language-model').Query;
44
var _ = require('lodash');
5-
65
// var debug = require('debug')('scout:models:editable-query');
76

87
/**
@@ -45,10 +44,10 @@ module.exports = Model.extend({
4544
// // return the string without key quotes for display in RefineBarView
4645
// }
4746
// },
47+
/*eslint no-new: 0*/
4848
valid: {
4949
deps: ['cleanString'],
5050
fn: function() {
51-
/*eslint no-new: 0*/
5251
try {
5352
// is it valid eJSON?
5453
var parsed = EJSON.parse(this.cleanString);

src/refine-view/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var EditableQuery = require('../models/editable-query');
33
var $ = require('jquery');
44
var EJSON = require('mongodb-extended-json');
55
var Query = require('mongodb-language-model').Query;
6-
var debug = require('debug')('scout:refine-view:index');
6+
// var debug = require('debug')('scout:refine-view:index');
77

88
module.exports = AmpersandView.extend({
99
template: require('./index.jade'),

0 commit comments

Comments
 (0)