diff --git a/src/plot_api/plot_api.js b/src/plot_api/plot_api.js index 3cc56c97448..eff5bdfb3e3 100644 --- a/src/plot_api/plot_api.js +++ b/src/plot_api/plot_api.js @@ -199,10 +199,8 @@ Plotly.plot = function(gd, data, layout, config) { Plotly.Lib.markTime('done with bar/box adjustments'); // calc and autorange for errorbars - if(Plotly.ErrorBars) { - Plotly.ErrorBars.calc(gd); - Plotly.Lib.markTime('done Plotly.ErrorBars.calc'); - } + Plotly.ErrorBars.calc(gd); + Plotly.Lib.markTime('done Plotly.ErrorBars.calc'); // TODO: autosize extra for text markers return Plotly.Lib.syncOrAsync([ @@ -302,7 +300,7 @@ Plotly.plot = function(gd, data, layout, config) { } // finally do all error bars at once - if(gd._fullLayout._hasCartesian && Plotly.ErrorBars) { + if(gd._fullLayout._hasCartesian) { Plotly.ErrorBars.plot(gd, subplotInfo, cdError); Plotly.Lib.markTime('done ErrorBars'); } diff --git a/src/traces/bars/bars.js b/src/traces/bars/bars.js index 49b43756345..65dd651541a 100644 --- a/src/traces/bars/bars.js +++ b/src/traces/bars/bars.js @@ -61,10 +61,8 @@ bars.supplyDefaults = function(traceIn, traceOut, defaultColor, layout) { coerce('text'); // override defaultColor for error bars with defaultLine - if(Plotly.ErrorBars) { - Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, Plotly.Color.defaultLine, {axis: 'y'}); - Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, Plotly.Color.defaultLine, {axis: 'x', inherit: 'y'}); - } + Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, Plotly.Color.defaultLine, {axis: 'y'}); + Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, Plotly.Color.defaultLine, {axis: 'x', inherit: 'y'}); }; bars.supplyLayoutDefaults = function(layoutIn, layoutOut, fullData) { @@ -558,7 +556,7 @@ bars.hoverPoints = function(pointData, xval, yval, hovermode) { if(di.tx) pointData.text = di.tx; - if(Plotly.ErrorBars) Plotly.ErrorBars.hoverInfo(di, trace, pointData); + Plotly.ErrorBars.hoverInfo(di, trace, pointData); return [pointData]; }; diff --git a/src/traces/scatter/scatter.js b/src/traces/scatter/scatter.js index e11ec585763..b2f3ff54e1d 100644 --- a/src/traces/scatter/scatter.js +++ b/src/traces/scatter/scatter.js @@ -95,10 +95,8 @@ scatter.supplyDefaults = function(traceIn, traceOut, defaultColor, layout) { if(!scatter.hasLines(traceOut)) lineShapeDefaults(traceIn, traceOut, coerce); } - if(Plotly.ErrorBars) { - Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, defaultColor, {axis: 'y'}); - Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, defaultColor, {axis: 'x', inherit: 'y'}); - } + Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, defaultColor, {axis: 'y'}); + Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, defaultColor, {axis: 'x', inherit: 'y'}); }; // common to 'scatter', 'scatter3d', 'scattergeo' and 'scattergl' @@ -367,13 +365,10 @@ scatter.calc = function(gd, trace) { } // if no error bars, markers or text, or fill to y=0 remove x padding - else if( - (Plotly.ErrorBars===undefined || !trace.error_y.visible) && - ( - ['tonexty', 'tozeroy'].indexOf(trace.fill)!==-1 || - (!scatter.hasMarkers(trace) && !scatter.hasText(trace)) - ) - ) { + else if(!trace.error_y.visible && ( + ['tonexty', 'tozeroy'].indexOf(trace.fill)!==-1 || + (!scatter.hasMarkers(trace) && !scatter.hasText(trace)) + )) { xOptions.padded = false; xOptions.ppad = 0; } @@ -909,7 +904,7 @@ scatter.hoverPoints = function(pointData, xval, yval, hovermode) { if(di.tx) pointData.text = di.tx; else if(trace.text) pointData.text = trace.text; - if(Plotly.ErrorBars) Plotly.ErrorBars.hoverInfo(di, trace, pointData); + Plotly.ErrorBars.hoverInfo(di, trace, pointData); return [pointData]; }; diff --git a/src/traces/scatter3d/defaults.js b/src/traces/scatter3d/defaults.js index d50e371734c..a815a75d238 100644 --- a/src/traces/scatter3d/defaults.js +++ b/src/traces/scatter3d/defaults.js @@ -45,11 +45,9 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout } } - if(Plotly.ErrorBars) { - Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, defaultColor, {axis: 'z'}); - Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, defaultColor, {axis: 'y', inherit: 'z'}); - Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, defaultColor, {axis: 'x', inherit: 'z'}); - } + Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, defaultColor, {axis: 'z'}); + Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, defaultColor, {axis: 'y', inherit: 'z'}); + Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, defaultColor, {axis: 'x', inherit: 'z'}); }; function handleXYZDefaults(traceIn, traceOut, coerce) { diff --git a/src/traces/scattergl/defaults.js b/src/traces/scattergl/defaults.js index 52f46ab2e59..11a329f7e2b 100644 --- a/src/traces/scattergl/defaults.js +++ b/src/traces/scattergl/defaults.js @@ -33,8 +33,6 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout Scatter.fillColorDefaults(traceIn, traceOut, defaultColor, coerce); } - if(Plotly.ErrorBars) { - Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, defaultColor, {axis: 'y'}); - Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, defaultColor, {axis: 'x', inherit: 'y'}); - } + Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, defaultColor, {axis: 'y'}); + Plotly.ErrorBars.supplyDefaults(traceIn, traceOut, defaultColor, {axis: 'x', inherit: 'y'}); };