Skip to content

Commit cd32fe4

Browse files
committed
do not apply line --> marker color defaulting on scatter3d plots
1 parent a161fa7 commit cd32fe4

8 files changed

+7
-6
lines changed

src/traces/scatter/marker_defaults.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ var subTypes = require('./subtypes');
1919
// common to 'scatter', 'scatter3d', 'scattergeo' and 'scattergl'
2020
module.exports = function markerDefaults(traceIn, traceOut, defaultColor, layout, coerce) {
2121
var isBubble = subTypes.isBubble(traceIn),
22+
isScatter3d = traceIn.type === 'scatter3d',
2223
lineColor = (traceIn.line || {}).color,
2324
lineColorscale = (traceIn.line || {}).colorscale,
2425
defaultColorscale,
2526
defaultMLC;
2627

27-
if(lineColor) defaultColor = lineColor;
28-
if(lineColorscale) defaultColorscale = lineColorscale;
28+
if(!isScatter3d && lineColor) defaultColor = lineColor;
29+
if(!isScatter3d && lineColorscale) defaultColorscale = lineColorscale;
2930

3031
coerce('marker.symbol');
3132
coerce('marker.opacity', isBubble ? 0.7 : 1);
@@ -42,7 +43,7 @@ module.exports = function markerDefaults(traceIn, traceOut, defaultColor, layout
4243
// if there's a line with a different color than the marker, use
4344
// that line color as the default marker line color
4445
// mostly this is for transparent markers to behave nicely
45-
if(lineColor && (traceOut.marker.color !== lineColor)) {
46+
if(!isScatter3d && lineColor && (traceOut.marker.color !== lineColor)) {
4647
defaultMLC = lineColor;
4748
}
4849
else if(isBubble) defaultMLC = Color.background;
124 Bytes
Loading
Loading
Loading
Loading

test/image/mocks/gl3d_scatter-color-array-with-default-marker.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"type":"scatter3d"
2323
}],
2424
"layout": {
25-
"title": "Markers should default to line color, partly to evade Z fighting",
25+
"title": "Markers should not default to line color, partly to evade Z fighting",
2626
"height":758,
2727
"width":1310
2828
}

test/image/mocks/gl3d_scatter-color-mono-with-default-marker.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"type":"scatter3d"
1212
}],
1313
"layout": {
14-
"title": "Specific color chosen for the line should transfer to markers to evade Z fighting",
14+
"title": "Specific color chosen for the line should not transfer to markers",
1515
"height":758,
1616
"width":1310
1717
}

test/image/mocks/gl3d_scatter-color-palette-with-default-marker.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"type":"scatter3d"
1616
}],
1717
"layout": {
18-
"title": "Markers should default to line color, partly to evade Z fighting",
18+
"title": "Markers should not default to line color",
1919
"height":758,
2020
"width":1310
2121
}

0 commit comments

Comments
 (0)