@@ -7,16 +7,12 @@ var overrideAll = require('../../plot_api/edit_types').overrideAll;
77
88
99module . 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+ } ,
2016 thicknessmode : {
2117 valType : 'enumerated' ,
2218 values : [ 'fraction' , 'pixels' ] ,
@@ -61,21 +57,23 @@ module.exports = overrideAll({
6157 } ,
6258 x : {
6359 valType : 'number' ,
64- dflt : 1.02 ,
6560 min : - 2 ,
6661 max : 3 ,
6762 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*.'
6966 ] . join ( ' ' )
7067 } ,
7168 xanchor : {
7269 valType : 'enumerated' ,
7370 values : [ 'left' , 'center' , 'right' ] ,
74- dflt : 'left' ,
7571 description : [
7672 'Sets this color bar\'s horizontal position anchor.' ,
7773 '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*.'
7977 ] . join ( ' ' )
8078 } ,
8179 xpad : {
@@ -86,21 +84,23 @@ module.exports = overrideAll({
8684 } ,
8785 y : {
8886 valType : 'number' ,
89- dflt : 0.5 ,
9087 min : - 2 ,
9188 max : 3 ,
9289 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*.'
9493 ] . join ( ' ' )
9594 } ,
9695 yanchor : {
9796 valType : 'enumerated' ,
9897 values : [ 'top' , 'middle' , 'bottom' ] ,
99- dflt : 'middle' ,
10098 description : [
10199 'Sets this color bar\'s vertical position anchor' ,
102100 '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*.'
104104 ] . join ( ' ' )
105105 } ,
106106 ypad : {
@@ -143,18 +143,26 @@ module.exports = overrideAll({
143143 'In other cases the default is *hide past div*.'
144144 ] . join ( ' ' )
145145 } ) ,
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
146149 ticklabelposition : {
147150 valType : 'enumerated' ,
148151 values : [
149152 'outside' , 'inside' ,
150153 'outside top' , 'inside top' ,
154+ 'outside left' , 'inside left' ,
155+ 'outside right' , 'inside right' ,
151156 'outside bottom' , 'inside bottom'
152157 ] ,
153158 dflt : 'outside' ,
154159 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*.'
156163 ] . join ( ' ' )
157164 } ,
165+
158166 ticklen : axesAttrs . ticklen ,
159167 tickwidth : axesAttrs . tickwidth ,
160168 tickcolor : axesAttrs . tickcolor ,
@@ -193,10 +201,11 @@ module.exports = overrideAll({
193201 side : {
194202 valType : 'enumerated' ,
195203 values : [ 'right' , 'top' , 'bottom' ] ,
196- dflt : 'top' ,
197204 description : [
198205 'Determines the location of color bar\'s title' ,
199206 'with respect to the color bar.' ,
207+ 'Defaults to *top* when `orientation` if *v* and ' ,
208+ 'defaults to *right* when `orientation` if *h*.' ,
200209 'Note that the title\'s location used to be set' ,
201210 'by the now deprecated `titleside` attribute.'
202211 ] . join ( ' ' )
0 commit comments