Skip to content

Commit 7addcec

Browse files
committed
BENDPX into constants
1 parent d7abd18 commit 7addcec

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/plots/cartesian/constants.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,8 @@ module.exports = {
3434
HOVERFONT: 'Arial, sans-serif',
3535

3636
// minimum time (msec) between hover calls
37-
HOVERMINTIME: 100
37+
HOVERMINTIME: 100,
38+
39+
// max pixels off straight before a lasso select line counts as bent
40+
BENDPX: 1.5
3841
};

src/plots/cartesian/select.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
var polygon = require('../../lib/polygon');
1313

1414
var axes = require('./axes');
15+
var constants = require('./constants');
1516

1617
var filteredPolygon = polygon.filter;
1718
var polygonTester = polygon.tester;
18-
var BENDPX = 1.5; // max pixels off straight before a line counts as bent
1919

2020
function getAxId(ax) { return ax._id; }
2121

@@ -33,7 +33,7 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
3333
yAxisIds = dragOptions.yaxes.map(getAxId);
3434

3535
if(mode === 'lasso') {
36-
var pts = filteredPolygon([[x0, y0]], BENDPX);
36+
var pts = filteredPolygon([[x0, y0]], constants.BENDPX);
3737
}
3838

3939
var outlines = plot.selectAll('path.select-outline').data([1,2]);

0 commit comments

Comments
 (0)