@@ -12,7 +12,9 @@ function averageColors(colorscale) {
12
12
return color ;
13
13
}
14
14
15
- module . exports = function fillColorDefaults ( traceIn , traceOut , defaultColor , coerce ) {
15
+ module . exports = function fillColorDefaults ( traceIn , traceOut , defaultColor , coerce , opts ) {
16
+ if ( ! opts ) opts = { } ;
17
+
16
18
var inheritColorFromMarker = false ;
17
19
18
20
if ( traceOut . marker ) {
@@ -28,18 +30,20 @@ module.exports = function fillColorDefaults(traceIn, traceOut, defaultColor, coe
28
30
}
29
31
30
32
var averageGradientColor ;
31
- var gradientOrientation = coerce ( 'fillgradient.type' ) ;
32
- if ( gradientOrientation !== 'none' ) {
33
- coerce ( 'fillgradient.start' ) ;
34
- coerce ( 'fillgradient.stop' ) ;
35
- var gradientColorscale = coerce ( 'fillgradient.colorscale' ) ;
36
-
37
- // if a fillgradient is specified, we use the average gradient color
38
- // to specify fillcolor after all other more specific candidates
39
- // are considered, but before the global default color.
40
- // fillcolor affects the background color of the hoverlabel in this case.
41
- if ( gradientColorscale ) {
42
- averageGradientColor = averageColors ( gradientColorscale ) ;
33
+ if ( opts . moduleHasFillgradient ) {
34
+ var gradientOrientation = coerce ( 'fillgradient.type' ) ;
35
+ if ( gradientOrientation !== 'none' ) {
36
+ coerce ( 'fillgradient.start' ) ;
37
+ coerce ( 'fillgradient.stop' ) ;
38
+ var gradientColorscale = coerce ( 'fillgradient.colorscale' ) ;
39
+
40
+ // if a fillgradient is specified, we use the average gradient color
41
+ // to specify fillcolor after all other more specific candidates
42
+ // are considered, but before the global default color.
43
+ // fillcolor affects the background color of the hoverlabel in this case.
44
+ if ( gradientColorscale ) {
45
+ averageGradientColor = averageColors ( gradientColorscale ) ;
46
+ }
43
47
}
44
48
}
45
49
0 commit comments