10
10
11
11
var colorScaleAttributes = require ( './attributes' ) ;
12
12
var extendDeep = require ( '../../lib/extend' ) . extendDeep ;
13
+ var palettes = require ( './scales.js' ) ;
13
14
14
15
module . exports = function makeColorScaleAttributes ( context ) {
15
16
return {
@@ -37,15 +38,15 @@ module.exports = function makeColorScaleAttributes(context) {
37
38
' To control the bounds of the colorscale in color space,' ,
38
39
' use `' , context , '.cmin` and `' , context , '.cmax`.' ,
39
40
' Alternatively, `colorscale` may be a palette name string' ,
40
- ' such as `"Viridis"` or `"Greens"`. '
41
- ] . join ( '' )
41
+ ' of the following list: '
42
+ ] . join ( '' ) . concat ( Object . keys ( palettes ) . join ( ', ' ) )
42
43
} ) ,
43
44
cauto : extendDeep ( { } , colorScaleAttributes . zauto , {
44
45
description : [
45
46
'Has an effect only if `' , context , '.color` is set to a numerical array' ,
46
47
' and `cmin`, `cmax` are set by the user. In this case,' ,
47
- ' it controls whether the first/last colors in `colorscale` correspond to' ,
48
- ' the lowest/highest values in `color` (`cauto: true`), or the `cmin`/`cmax`' ,
48
+ ' it controls whether the range of colors in `colorscale` is mapped to' ,
49
+ ' the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax`' ,
49
50
' values (`cauto: false`).' ,
50
51
' Defaults to `false` when `cmin`, `cmax` are set by the user.'
51
52
] . join ( '' )
@@ -69,16 +70,18 @@ module.exports = function makeColorScaleAttributes(context) {
69
70
autocolorscale : extendDeep ( { } , colorScaleAttributes . autocolorscale , {
70
71
description : [
71
72
'Has an effect only if `' , context , '.color` is set to a numerical array.' ,
72
- ' Determines whether the colorscale is the default palette (`autocolorscale: true`)' ,
73
- ' or the palette determined by `' , context , '.colorscale`.'
73
+ ' Determines whether the colorscale is a default palette (`autocolorscale: true`)' ,
74
+ ' or the palette determined by `' , context , '.colorscale`.' ,
75
+ ' In case `colorscale` is unspecified or `autocolorscale` is true, the default ' ,
76
+ ' palette will be chosen according to whether numbers in the `color` array are' ,
77
+ ' all positive, all negative or mixed.'
74
78
] . join ( '' )
75
79
} ) ,
76
80
reversescale : extendDeep ( { } , colorScaleAttributes . reversescale , {
77
81
description : [
78
82
'Has an effect only if `' , context , '.color` is set to a numerical array.' ,
79
- ' Reverses the color mapping if true (`cmin` or lowest `color` value will' ,
80
- ' correspond to the last color and `cmax` or highest `color` value will' ,
81
- ' correspond to the first color).'
83
+ ' Reverses the color mapping if true (`cmin` will correspond to the last color' ,
84
+ ' in the array and `cmax` will correspond to the first color).'
82
85
] . join ( '' )
83
86
} )
84
87
} ;
0 commit comments