Skip to content

Commit 2f5eae1

Browse files
committed
clean up some deleted code and overcomplicated logic
1 parent 59af6a2 commit 2f5eae1

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

src/traces/contour/constraint_value_defaults.js

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
'use strict';
1111

12-
// var constraintMapping = require('./constraint_mapping');
1312
var isNumeric = require('fast-isnumeric');
1413
var COMPARISON_OPS2 = require('../../constants/filter_ops').COMPARISON_OPS2;
1514

src/traces/contour/defaults.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ var handleConstraintDefaults = require('./constraint_defaults');
1717
var handleContoursDefaults = require('./contours_defaults');
1818
var handleStyleDefaults = require('./style_defaults');
1919
var attributes = require('./attributes');
20-
var plotAttributes = require('../../plots/attributes');
2120

2221

2322
module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
@@ -39,10 +38,8 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
3938
var isConstraint = (coerce('contours.type') === 'constraint');
4039
coerce('connectgaps', hasColumns(traceOut));
4140

42-
// Override the trace-level showlegend default with a default that takes
43-
// into account whether this is a constraint or level contours:
44-
if(isConstraint) Lib.coerce(traceIn, traceOut, plotAttributes, 'showlegend');
45-
else delete traceOut.showlegend;
41+
// trace-level showlegend has already been set, but is only allowed if this is a constraint
42+
if(!isConstraint) delete traceOut.showlegend;
4643

4744
if(isConstraint) {
4845
handleConstraintDefaults(traceIn, traceOut, coerce, layout, defaultColor);

src/traces/contour/style_defaults.js

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
'use strict';
1111

1212
var colorscaleDefaults = require('../../components/colorscale/defaults');
13-
// var Lib = require('../../lib');
1413
var handleLabelDefaults = require('./label_defaults');
1514

1615

src/traces/contourcarpet/defaults.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ var attributes = require('./attributes');
1616
var handleConstraintDefaults = require('../contour/constraint_defaults');
1717
var handleContoursDefaults = require('../contour/contours_defaults');
1818
var handleStyleDefaults = require('../contour/style_defaults');
19-
var plotAttributes = require('../../plots/attributes');
2019

2120
module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
2221
function coerce(attr, dflt) {
@@ -59,10 +58,8 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
5958
// Unimplemented:
6059
// coerce('connectgaps', hasColumns(traceOut));
6160

62-
// Override the trace-level showlegend default with a default that takes
63-
// into account whether this is a constraint or level contours:
64-
if(isConstraint) Lib.coerce(traceIn, traceOut, plotAttributes, 'showlegend');
65-
else delete traceOut.showlegend;
61+
// trace-level showlegend has already been set, but is only allowed if this is a constraint
62+
if(!isConstraint) delete traceOut.showlegend;
6663

6764
if(isConstraint) {
6865
handleConstraintDefaults(traceIn, traceOut, coerce, layout, defaultColor, {hasHover: false});

0 commit comments

Comments
 (0)