8
8
9
9
'use strict' ;
10
10
11
+ var colorScaleAttributes = require ( './attributes' ) ;
12
+ var extendDeep = require ( '../../lib/extend' ) . extendDeep ;
13
+
11
14
module . exports = function makeColorScaleAttributes ( context ) {
12
15
return {
13
16
color : {
@@ -21,9 +24,7 @@ module.exports = function makeColorScaleAttributes(context) {
21
24
' `cmin` and `cmax` if set.'
22
25
] . join ( '' )
23
26
} ,
24
- colorscale : {
25
- valType : 'colorscale' ,
26
- role : 'style' ,
27
+ colorscale : extendDeep ( { } , colorScaleAttributes . colorscale , {
27
28
description : [
28
29
'Sets the colorscale and only has an effect' ,
29
30
' if `' , context , '.color` is set to a numerical array.' ,
@@ -36,57 +37,42 @@ module.exports = function makeColorScaleAttributes(context) {
36
37
' To control the bounds of the colorscale in color space,' ,
37
38
' use `' , context , '.cmin` and `' , context , '.cmax`.'
38
39
] . join ( '' )
39
- } ,
40
- cauto : {
41
- valType : 'boolean' ,
42
- dflt : true ,
43
- role : 'style' ,
40
+ } ) ,
41
+ cauto : extendDeep ( { } , colorScaleAttributes . zauto , {
44
42
description : [
45
43
'Has an effect only if `' , context , '.color` is set to a numerical array.' ,
46
44
' Determines the whether or not the color domain is computed' ,
47
45
' automatically.'
48
46
] . join ( '' )
49
- } ,
50
- cmax : {
51
- valType : 'number' ,
52
- dflt : null ,
53
- role : 'info' ,
47
+ } ) ,
48
+ cmax : extendDeep ( { } , colorScaleAttributes . zmax , {
54
49
description : [
55
50
'Has an effect only if `' , context , '.color` is set to a numerical array.' ,
56
51
' Sets the upper bound of the color domain.' ,
57
52
' Value should be associated to the `' , context , '.color` array index,' ,
58
53
' and if set, `' , context , '.cmin` must be set as well.'
59
54
] . join ( '' )
60
- } ,
61
- cmin : {
62
- valType : 'number' ,
63
- dflt : null ,
64
- role : 'info' ,
55
+ } ) ,
56
+ cmin : extendDeep ( { } , colorScaleAttributes . zmin , {
65
57
description : [
66
58
'Has an effect only if `' , context , '.color` is set to a numerical array.' ,
67
59
' Sets the lower bound of the color domain.' ,
68
60
' Value should be associated to the `' , context , '.color` array index,' ,
69
61
' and if set, `' , context , '.cmax` must be set as well.'
70
62
] . join ( '' )
71
- } ,
72
- autocolorscale : {
73
- valType : 'boolean' ,
74
- dflt : true ,
75
- role : 'style' ,
63
+ } ) ,
64
+ autocolorscale : extendDeep ( { } , colorScaleAttributes . autocolorscale , {
76
65
description : [
77
66
'Has an effect only if `' , context , '.color` is set to a numerical array.' ,
78
67
' Determines whether or not the colorscale is picked using' ,
79
68
' values inside `' , context , '.color`.'
80
69
] . join ( '' )
81
- } ,
82
- reversescale : {
83
- valType : 'boolean' ,
84
- role : 'style' ,
85
- dflt : false ,
70
+ } ) ,
71
+ reversescale : extendDeep ( { } , colorScaleAttributes . reversescale , {
86
72
description : [
87
73
'Has an effect only if `' , context , '.color` is set to a numerical array.' ,
88
74
' Reverses the colorscale.'
89
75
] . join ( '' )
90
- }
76
+ } )
91
77
} ;
92
78
} ;
0 commit comments