@@ -7,16 +7,12 @@ var overrideAll = require('../../plot_api/edit_types').overrideAll;
7
7
8
8
9
9
module . exports = overrideAll ( {
10
- // TODO: only right is supported currently
11
- // orient: {
12
- // valType: 'enumerated',
13
- // values: ['left', 'right', 'top', 'bottom'],
14
- // dflt: 'right',
15
- // description: [
16
- // 'Determines which side are the labels on',
17
- // '(so left and right make vertical bars, etc.)'
18
- // ].join(' ')
19
- // },
10
+ orientation : {
11
+ valType : 'enumerated' ,
12
+ values : [ 'h' , 'v' ] ,
13
+ dflt : 'v' ,
14
+ description : 'Sets the orientation of the colorbar.'
15
+ } ,
20
16
thicknessmode : {
21
17
valType : 'enumerated' ,
22
18
values : [ 'fraction' , 'pixels' ] ,
@@ -61,21 +57,23 @@ module.exports = overrideAll({
61
57
} ,
62
58
x : {
63
59
valType : 'number' ,
64
- dflt : 1.02 ,
65
60
min : - 2 ,
66
61
max : 3 ,
67
62
description : [
68
- 'Sets the x position of the color bar (in plot fraction).'
63
+ 'Sets the x position of the color bar (in plot fraction).' ,
64
+ 'Defaults to 1.02 when `orientation` is *v* and' ,
65
+ '0.5 when `orientation` is *h*.'
69
66
] . join ( ' ' )
70
67
} ,
71
68
xanchor : {
72
69
valType : 'enumerated' ,
73
70
values : [ 'left' , 'center' , 'right' ] ,
74
- dflt : 'left' ,
75
71
description : [
76
72
'Sets this color bar\'s horizontal position anchor.' ,
77
73
'This anchor binds the `x` position to the *left*, *center*' ,
78
- 'or *right* of the color bar.'
74
+ 'or *right* of the color bar.' ,
75
+ 'Defaults to *left* when `orientation` is *v* and' ,
76
+ '*center* when `orientation` is *h*.'
79
77
] . join ( ' ' )
80
78
} ,
81
79
xpad : {
@@ -86,21 +84,23 @@ module.exports = overrideAll({
86
84
} ,
87
85
y : {
88
86
valType : 'number' ,
89
- dflt : 0.5 ,
90
87
min : - 2 ,
91
88
max : 3 ,
92
89
description : [
93
- 'Sets the y position of the color bar (in plot fraction).'
90
+ 'Sets the y position of the color bar (in plot fraction).' ,
91
+ 'Defaults to 0.5 when `orientation` is *v* and' ,
92
+ '1.02 when `orientation` is *h*.'
94
93
] . join ( ' ' )
95
94
} ,
96
95
yanchor : {
97
96
valType : 'enumerated' ,
98
97
values : [ 'top' , 'middle' , 'bottom' ] ,
99
- dflt : 'middle' ,
100
98
description : [
101
99
'Sets this color bar\'s vertical position anchor' ,
102
100
'This anchor binds the `y` position to the *top*, *middle*' ,
103
- 'or *bottom* of the color bar.'
101
+ 'or *bottom* of the color bar.' ,
102
+ 'Defaults to *middle* when `orientation` is *v* and' ,
103
+ '*bottom* when `orientation` is *h*.'
104
104
] . join ( ' ' )
105
105
} ,
106
106
ypad : {
@@ -143,18 +143,26 @@ module.exports = overrideAll({
143
143
'In other cases the default is *hide past div*.'
144
144
] . join ( ' ' )
145
145
} ) ,
146
+
147
+ // ticklabelposition: not used directly, as values depend on orientation
148
+ // left/right options are for x axes, and top/bottom options are for y axes
146
149
ticklabelposition : {
147
150
valType : 'enumerated' ,
148
151
values : [
149
152
'outside' , 'inside' ,
150
153
'outside top' , 'inside top' ,
154
+ 'outside left' , 'inside left' ,
155
+ 'outside right' , 'inside right' ,
151
156
'outside bottom' , 'inside bottom'
152
157
] ,
153
158
dflt : 'outside' ,
154
159
description : [
155
- 'Determines where tick labels are drawn.'
160
+ 'Determines where tick labels are drawn relative to the ticks.' ,
161
+ 'Left and right options are used when `orientation` is *h*,' ,
162
+ 'top and bottom when `orientation` is *v*.'
156
163
] . join ( ' ' )
157
164
} ,
165
+
158
166
ticklen : axesAttrs . ticklen ,
159
167
tickwidth : axesAttrs . tickwidth ,
160
168
tickcolor : axesAttrs . tickcolor ,
@@ -193,10 +201,11 @@ module.exports = overrideAll({
193
201
side : {
194
202
valType : 'enumerated' ,
195
203
values : [ 'right' , 'top' , 'bottom' ] ,
196
- dflt : 'top' ,
197
204
description : [
198
205
'Determines the location of color bar\'s title' ,
199
206
'with respect to the color bar.' ,
207
+ 'Defaults to *top* when `orientation` if *v* and ' ,
208
+ 'defaults to *right* when `orientation` if *h*.' ,
200
209
'Note that the title\'s location used to be set' ,
201
210
'by the now deprecated `titleside` attribute.'
202
211
] . join ( ' ' )
0 commit comments