@@ -12,7 +12,9 @@ function averageColors(colorscale) {
1212 return color ;
1313}
1414
15- module . exports = function fillColorDefaults ( traceIn , traceOut , defaultColor , coerce ) {
15+ module . exports = function fillColorDefaults ( traceIn , traceOut , defaultColor , coerce , opts ) {
16+ if ( ! opts ) opts = { } ;
17+
1618 var inheritColorFromMarker = false ;
1719
1820 if ( traceOut . marker ) {
@@ -28,18 +30,20 @@ module.exports = function fillColorDefaults(traceIn, traceOut, defaultColor, coe
2830 }
2931
3032 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+ }
4347 }
4448 }
4549
0 commit comments