From 9329a4dd5e8065626710d8e6d311ef8997c1d9a7 Mon Sep 17 00:00:00 2001 From: jgould Date: Thu, 12 Apr 2018 12:11:11 -0400 Subject: [PATCH] use supplied bandwidth if provided --- src/traces/violin/calc.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/traces/violin/calc.js b/src/traces/violin/calc.js index 2311e7c4b16..d4dc7d11328 100644 --- a/src/traces/violin/calc.js +++ b/src/traces/violin/calc.js @@ -42,13 +42,12 @@ module.exports = function calc(gd, trace) { // sample standard deviation var ssd = Lib.stdev(vals, len - 1, cdi.mean); - var bandwidthDflt = ruleOfThumbBandwidth(vals, ssd, cdi.q3 - cdi.q1); - var bandwidth = cdi.bandwidth = trace.bandwidth || bandwidthDflt; + var bandwidth = cdi.bandwidth = trace.bandwidth || ruleOfThumbBandwidth(vals, ssd, cdi.q3 - cdi.q1); var span = cdi.span = calcSpan(trace, cdi, valAxis, bandwidth); // step that well covers the bandwidth and is multiple of span distance var dist = span[1] - span[0]; - var n = Math.ceil(dist / (Math.min(bandwidthDflt, bandwidth) / 3)); + var n = Math.ceil(dist / (bandwidth / 3)); var step = dist / n; if(!isFinite(step) || !isFinite(n)) {