Skip to content

Commit 9329a4d

Browse files
author
jgould
committed
use supplied bandwidth if provided
1 parent 3d65de3 commit 9329a4d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/traces/violin/calc.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,12 @@ module.exports = function calc(gd, trace) {
4242

4343
// sample standard deviation
4444
var ssd = Lib.stdev(vals, len - 1, cdi.mean);
45-
var bandwidthDflt = ruleOfThumbBandwidth(vals, ssd, cdi.q3 - cdi.q1);
46-
var bandwidth = cdi.bandwidth = trace.bandwidth || bandwidthDflt;
45+
var bandwidth = cdi.bandwidth = trace.bandwidth || ruleOfThumbBandwidth(vals, ssd, cdi.q3 - cdi.q1);
4746
var span = cdi.span = calcSpan(trace, cdi, valAxis, bandwidth);
4847

4948
// step that well covers the bandwidth and is multiple of span distance
5049
var dist = span[1] - span[0];
51-
var n = Math.ceil(dist / (Math.min(bandwidthDflt, bandwidth) / 3));
50+
var n = Math.ceil(dist / (bandwidth / 3));
5251
var step = dist / n;
5352

5453
if(!isFinite(step) || !isFinite(n)) {

0 commit comments

Comments
 (0)