1
1
/**
2
- * Copyright 2012-2016, Plotly, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
2
+ * Copyright 2012-2016, Plotly, Inc.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
8
9
9
'use strict' ;
10
10
11
- var scatterAttrs = require ( '../../traces/scatter/attributes' ) ;
12
-
13
- var scatterMarkerAttrs = scatterAttrs . marker ;
14
-
15
11
module . exports = function makeColorScaleAttributes ( context ) {
16
12
return {
17
13
color : {
18
14
valType : 'color' ,
19
15
arrayOk : true ,
20
16
role : 'style' ,
21
17
description : [
22
- 'Sets the marker color. It accepts either a specific color' ,
23
- 'or an array of values that are mapped to the colorscale' ,
24
- 'relative to the max and min values of the array or relative to' ,
25
- '`cmin` and `cmax` if set.'
26
- ] . join ( ' ' )
18
+ 'Sets the ' , context , ' color. It accepts either a specific color',
19
+ ' or an array of values that are mapped to the colorscale' ,
20
+ ' relative to the max and min values of the array or relative to' ,
21
+ ' `cmin` and `cmax` if set.'
22
+ ] . join ( '' )
27
23
} ,
28
24
colorscale : {
29
25
valType : 'colorscale' ,
30
26
role : 'style' ,
31
27
description : [
32
28
'Sets the colorscale and only has an effect' ,
33
- 'if `marker .color` is set to a numerical array.' ,
34
- 'The colorscale must be an array containing' ,
35
- 'arrays mapping a normalized value to an' ,
36
- 'rgb, rgba, hex, hsl, hsv, or named color string.' ,
37
- 'At minimum, a mapping for the lowest (0) and highest (1)' ,
38
- 'values are required. For example,' ,
39
- '`[[0, \'rgb(0,0,255)\', [1, \'rgb(255,0,0)\']]`.' ,
40
- 'To control the bounds of the colorscale in color space,' ,
41
- 'use `marker .cmin` and `marker .cmax`.'
42
- ] . join ( ' ' )
29
+ ' if `' , context , ' .color` is set to a numerical array.',
30
+ ' The colorscale must be an array containing' ,
31
+ ' arrays mapping a normalized value to an' ,
32
+ ' rgb, rgba, hex, hsl, hsv, or named color string.' ,
33
+ ' At minimum, a mapping for the lowest (0) and highest (1)' ,
34
+ ' values are required. For example,' ,
35
+ ' `[[0, \'rgb(0,0,255)\', [1, \'rgb(255,0,0)\']]`.' ,
36
+ ' To control the bounds of the colorscale in color space,' ,
37
+ ' use `' , context , ' .cmin` and `' , context , ' .cmax`.'
38
+ ] . join ( '' )
43
39
} ,
44
40
cauto : {
45
41
valType : 'boolean' ,
46
42
dflt : true ,
47
43
role : 'style' ,
48
44
description : [
49
- 'Has an effect only if `marker .color` is set to a numerical array.' ,
50
- 'Determines the whether or not the color domain is computed' ,
51
- 'automatically.'
52
- ] . join ( ' ' )
45
+ 'Has an effect only if `' , context , ' .color` is set to a numerical array.',
46
+ ' Determines the whether or not the color domain is computed' ,
47
+ ' automatically.'
48
+ ] . join ( '' )
53
49
} ,
54
-
55
50
cmax : {
56
51
valType : 'number' ,
57
52
dflt : null ,
58
53
role : 'info' ,
59
54
description : [
60
- 'Has an effect only if `marker .color` is set to a numerical array.' ,
61
- 'Sets the upper bound of the color domain.' ,
62
- 'Value should be associated to the `marker .color` array index,' ,
63
- 'and if set, `marker .cmin` must be set as well.'
64
- ] . join ( ' ' )
55
+ 'Has an effect only if `' , context , ' .color` is set to a numerical array.',
56
+ ' Sets the upper bound of the color domain.' ,
57
+ ' Value should be associated to the `' , context , ' .color` array index,',
58
+ ' and if set, `' , context , ' .cmin` must be set as well.'
59
+ ] . join ( '' )
65
60
} ,
66
61
cmin : {
67
62
valType : 'number' ,
68
63
dflt : null ,
69
64
role : 'info' ,
70
65
description : [
71
- 'Has an effect only if `marker .color` is set to a numerical array.' ,
72
- 'Sets the lower bound of the color domain.' ,
73
- 'Value should be associated to the `marker .color` array index,' ,
74
- 'and if set, `marker .cmax` must be set as well.'
75
- ] . join ( ' ' )
66
+ 'Has an effect only if `' , context , ' .color` is set to a numerical array.',
67
+ ' Sets the lower bound of the color domain.' ,
68
+ ' Value should be associated to the `' , context , ' .color` array index,',
69
+ ' and if set, `' , context , ' .cmax` must be set as well.'
70
+ ] . join ( '' )
76
71
} ,
77
72
autocolorscale : {
78
73
valType : 'boolean' ,
79
74
dflt : true ,
80
75
role : 'style' ,
81
76
description : [
82
- 'Has an effect only if `marker .color` is set to a numerical array.' ,
83
- 'Determines whether or not the colorscale is picked using' ,
84
- 'values inside `marker .color`.'
85
- ] . join ( ' ' )
77
+ 'Has an effect only if `' , context , ' .color` is set to a numerical array.',
78
+ ' Determines whether or not the colorscale is picked using' ,
79
+ ' values inside `' , context , ' .color`.'
80
+ ] . join ( '' )
86
81
} ,
87
82
reversescale : {
88
83
valType : 'boolean' ,
89
84
role : 'style' ,
90
85
dflt : false ,
91
86
description : [
92
- 'Has an effect only if `marker .color` is set to a numerical array.' ,
93
- 'Reverses the colorscale.'
94
- ] . join ( ' ' )
87
+ 'Has an effect only if `' , context , ' .color` is set to a numerical array.',
88
+ ' Reverses the colorscale.'
89
+ ] . join ( '' )
95
90
}
96
- }
97
- }
91
+ } ;
92
+ } ;
0 commit comments