Skip to content

Commit

Permalink
rm check for Plotly.ErrorBars (rm sub-bundles for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
etpinard committed Nov 12, 2015
1 parent ad49e57 commit 9d2568d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 31 deletions.
8 changes: 3 additions & 5 deletions src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down Expand Up @@ -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');
}
Expand Down
8 changes: 3 additions & 5 deletions src/traces/bars/bars.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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];
};
19 changes: 7 additions & 12 deletions src/traces/scatter/scatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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];
};
8 changes: 3 additions & 5 deletions src/traces/scatter3d/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 2 additions & 4 deletions src/traces/scattergl/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'});
};

1 comment on commit 9d2568d

@etpinard
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An artifact from the subbundle era. We don't need these checks anymore

Please sign in to comment.