Skip to content

Commit 33357df

Browse files
committed
no closure; explicit args
1 parent e0bd6e9 commit 33357df

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/transforms/bin.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,7 @@ function maybeBin(options) {
172172
}
173173

174174
function maybeThresholds(thresholds) {
175-
if (thresholds === undefined) {
176-
return (...args) => Math.min(200, thresholdScott(...args));
177-
}
175+
if (thresholds === undefined) return thresholdDefault;
178176
if (typeof thresholds === "string") {
179177
switch (thresholds.toLowerCase()) {
180178
case "freedman-diaconis": return thresholdFreedmanDiaconis;
@@ -186,6 +184,10 @@ function maybeThresholds(thresholds) {
186184
return thresholds; // pass array, count, or function to bin.thresholds
187185
}
188186

187+
function thresholdDefault(values, min, max) {
188+
return Math.min(200, thresholdScott(values, min, max));
189+
}
190+
189191
function isTimeInterval(t) {
190192
return t ? typeof t.range === "function" : false;
191193
}

0 commit comments

Comments
 (0)