Skip to content

Commit 4d4913f

Browse files
committed
restore correct behavior for constraint-type contourcarpet
1 parent 6dc80c5 commit 4d4913f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/traces/contour/style_defaults.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ var Lib = require('../../lib');
1414

1515

1616
module.exports = function handleStyleDefaults(traceIn, traceOut, coerce, layout, opts) {
17+
if(!opts) opts = {};
1718
var coloring = coerce('contours.coloring');
1819

1920
var showLines;
2021
var lineColor = '';
2122
if(coloring === 'fill') showLines = coerce('contours.showlines');
2223

2324
if(showLines !== false) {
24-
if(coloring !== 'lines') lineColor = coerce('line.color', '#000');
25-
coerce('line.width', 0.5);
25+
if(coloring !== 'lines') lineColor = coerce('line.color', opts.defaultColor || '#000');
26+
coerce('line.width', opts.defaultWidth === undefined ? 0.5 : opts.defaultWidth);
2627
coerce('line.dash');
2728
}
2829

@@ -45,7 +46,7 @@ module.exports = function handleStyleDefaults(traceIn, traceOut, coerce, layout,
4546
coerce('contours.labelformat');
4647
}
4748

48-
if(!opts || opts.hasHover !== false) {
49+
if(opts.hasHover !== false) {
4950
coerce('zhoverformat');
5051
// Needed for formatting of hoverlabel if format is not explicitly specified
5152
traceOut._separators = layout.separators;

src/traces/contourcarpet/defaults.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
8080
// If there's a fill color, use it at full opacity for the line color
8181
var lineDfltColor = traceOut.fillcolor ? addOpacity(traceOut.fillcolor, 1) : defaultColor;
8282

83-
handleStyleDefaults(traceIn, traceOut, coerce, layout, lineDfltColor, 2);
83+
handleStyleDefaults(traceIn, traceOut, coerce, layout, {
84+
hasHover: false,
85+
defaultColor: lineDfltColor,
86+
defaultWidth: 2
87+
});
8488

8589
if(contours.operation === '=') {
8690
coerce('line.color', defaultColor);

0 commit comments

Comments
 (0)