@@ -16,12 +16,12 @@ var colorscaleDefaults = require('../../components/colorscale/defaults');
1616var subTypes = require ( './subtypes' ) ;
1717
1818
19- // common to 'scatter', 'scatter3d', 'scattergeo' and 'scattergl'
2019module . exports = function markerDefaults ( traceIn , traceOut , defaultColor , layout , coerce ) {
2120 var isBubble = subTypes . isBubble ( traceIn ) ,
22- lineColor = ! Array . isArray ( traceIn . line ) ? ( traceIn . line || { } ) . color : undefined ,
21+ lineColor = ( traceIn . line || { } ) . color ,
2322 defaultMLC ;
2423
24+ // marker.color inherit from line.color (even if line.color is an array)
2525 if ( lineColor ) defaultColor = lineColor ;
2626
2727 coerce ( 'marker.symbol' ) ;
@@ -30,25 +30,22 @@ module.exports = function markerDefaults(traceIn, traceOut, defaultColor, layout
3030
3131 coerce ( 'marker.color' , defaultColor ) ;
3232 if ( hasColorscale ( traceIn , 'marker' ) ) {
33- colorscaleDefaults (
34- traceIn , traceOut , layout , coerce , { prefix : 'marker.' , cLetter : 'c' }
35- ) ;
33+ colorscaleDefaults ( traceIn , traceOut , layout , coerce , { prefix : 'marker.' , cLetter : 'c' } ) ;
3634 }
3735
3836 // if there's a line with a different color than the marker, use
3937 // that line color as the default marker line color
38+ // (except when it's an array)
4039 // mostly this is for transparent markers to behave nicely
41- if ( lineColor && ( traceOut . marker . color !== lineColor ) ) {
40+ if ( lineColor && ! Array . isArray ( lineColor ) && ( traceOut . marker . color !== lineColor ) ) {
4241 defaultMLC = lineColor ;
4342 }
4443 else if ( isBubble ) defaultMLC = Color . background ;
4544 else defaultMLC = Color . defaultLine ;
4645
4746 coerce ( 'marker.line.color' , defaultMLC ) ;
4847 if ( hasColorscale ( traceIn , 'marker.line' ) ) {
49- colorscaleDefaults (
50- traceIn , traceOut , layout , coerce , { prefix : 'marker.line.' , cLetter : 'c' }
51- ) ;
48+ colorscaleDefaults ( traceIn , traceOut , layout , coerce , { prefix : 'marker.line.' , cLetter : 'c' } ) ;
5249 }
5350
5451 coerce ( 'marker.line.width' , isBubble ? 1 : 0 ) ;
0 commit comments