@@ -12,70 +12,65 @@ var subTypes = require('./subtypes');
1212 * gradient: caller supports gradients
1313 * noSelect: caller does not support selected/unselected attribute containers
1414 */
15- module . exports = function markerDefaults ( traceIn , traceOut , defaultColor , layout , coerce , opts ) {
15+ module . exports = function markerDefaults ( traceIn , traceOut , defaultColor , layout , coerce , opts = { } ) {
1616 var isBubble = subTypes . isBubble ( traceIn ) ;
1717 var lineColor = ( traceIn . line || { } ) . color ;
1818 var defaultMLC ;
1919
20- opts = opts || { } ;
21-
2220 // marker.color inherit from line.color (even if line.color is an array)
23- if ( lineColor ) defaultColor = lineColor ;
21+ if ( lineColor ) defaultColor = lineColor ;
2422
2523 coerce ( 'marker.symbol' ) ;
2624 coerce ( 'marker.opacity' , isBubble ? 0.7 : 1 ) ;
2725 coerce ( 'marker.size' ) ;
28- if ( ! opts . noAngle ) {
26+ if ( ! opts . noAngle ) {
2927 coerce ( 'marker.angle' ) ;
30- if ( ! opts . noAngleRef ) {
31- coerce ( 'marker.angleref' ) ;
32- }
33-
34- if ( ! opts . noStandOff ) {
35- coerce ( 'marker.standoff' ) ;
36- }
28+ if ( ! opts . noAngleRef ) coerce ( 'marker.angleref' ) ;
29+ if ( ! opts . noStandOff ) coerce ( 'marker.standoff' ) ;
3730 }
3831
3932 coerce ( 'marker.color' , defaultColor ) ;
40- if ( hasColorscale ( traceIn , 'marker' ) ) {
41- colorscaleDefaults ( traceIn , traceOut , layout , coerce , { prefix : 'marker.' , cLetter : 'c' } ) ;
33+ if ( hasColorscale ( traceIn , 'marker' ) ) {
34+ colorscaleDefaults ( traceIn , traceOut , layout , coerce , { prefix : 'marker.' , cLetter : 'c' } ) ;
4235 }
4336
44- if ( ! opts . noSelect ) {
37+ if ( ! opts . noSelect ) {
4538 coerce ( 'selected.marker.color' ) ;
4639 coerce ( 'unselected.marker.color' ) ;
4740 coerce ( 'selected.marker.size' ) ;
4841 coerce ( 'unselected.marker.size' ) ;
4942 }
5043
51- if ( ! opts . noLine ) {
44+ if ( ! opts . noLine ) {
5245 // if there's a line with a different color than the marker, use
5346 // that line color as the default marker line color
5447 // (except when it's an array)
5548 // mostly this is for transparent markers to behave nicely
56- if ( lineColor && ! Array . isArray ( lineColor ) && ( traceOut . marker . color !== lineColor ) ) {
49+ if ( lineColor && ! Array . isArray ( lineColor ) && traceOut . marker . color !== lineColor ) {
5750 defaultMLC = lineColor ;
58- } else if ( isBubble ) defaultMLC = Color . background ;
59- else defaultMLC = Color . defaultLine ;
51+ } else if ( isBubble ) {
52+ defaultMLC = Color . background ;
53+ } else {
54+ defaultMLC = Color . defaultLine ;
55+ }
6056
6157 coerce ( 'marker.line.color' , defaultMLC ) ;
62- if ( hasColorscale ( traceIn , 'marker.line' ) ) {
63- colorscaleDefaults ( traceIn , traceOut , layout , coerce , { prefix : 'marker.line.' , cLetter : 'c' } ) ;
58+ if ( hasColorscale ( traceIn , 'marker.line' ) ) {
59+ colorscaleDefaults ( traceIn , traceOut , layout , coerce , { prefix : 'marker.line.' , cLetter : 'c' } ) ;
6460 }
6561
6662 coerce ( 'marker.line.width' , isBubble ? 1 : 0 ) ;
63+ if ( ! opts . noLineDash ) coerce ( 'marker.line.dash' ) ;
6764 }
6865
69- if ( isBubble ) {
66+ if ( isBubble ) {
7067 coerce ( 'marker.sizeref' ) ;
7168 coerce ( 'marker.sizemin' ) ;
7269 coerce ( 'marker.sizemode' ) ;
7370 }
7471
75- if ( opts . gradient ) {
72+ if ( opts . gradient ) {
7673 var gradientType = coerce ( 'marker.gradient.type' ) ;
77- if ( gradientType !== 'none' ) {
78- coerce ( 'marker.gradient.color' ) ;
79- }
74+ if ( gradientType !== 'none' ) coerce ( 'marker.gradient.color' ) ;
8075 }
8176} ;
0 commit comments