@@ -35,16 +35,20 @@ module.exports = {
35
35
'Specifies the shape type to be drawn.' ,
36
36
37
37
'If *line*, a line is drawn from (`x0`,`y0`) to (`x1`,`y1`)' ,
38
+ 'with respect to the axes\' sizing mode.' ,
38
39
39
40
'If *circle*, a circle is drawn from' ,
40
41
'((`x0`+`x1`)/2, (`y0`+`y1`)/2))' ,
41
42
'with radius' ,
42
43
'(|(`x0`+`x1`)/2 - `x0`|, |(`y0`+`y1`)/2 -`y0`)|)' ,
44
+ 'with respect to the axes\' sizing mode.' ,
43
45
44
46
'If *rect*, a rectangle is drawn linking' ,
45
47
'(`x0`,`y0`), (`x1`,`y0`), (`x1`,`y1`), (`x0`,`y1`), (`x0`,`y0`)' ,
48
+ 'with respect to the axes\' sizing mode.' ,
46
49
47
- 'If *path*, draw a custom SVG path using `path`.'
50
+ 'If *path*, draw a custom SVG path using `path`.' ,
51
+ 'with respect to the axes\' sizing mode.'
48
52
] . join ( ' ' )
49
53
} ,
50
54
@@ -61,7 +65,7 @@ module.exports = {
61
65
description : [
62
66
'Sets the shape\'s x coordinate axis.' ,
63
67
'If set to an x axis id (e.g. *x* or *x2*), the `x` position' ,
64
- 'refers to an x coordinate' ,
68
+ 'refers to an x coordinate. ' ,
65
69
'If set to *paper*, the `x` position refers to the distance from' ,
66
70
'the left side of the plotting area in normalized coordinates' ,
67
71
'where *0* (*1*) corresponds to the left (right) side.' ,
@@ -71,13 +75,43 @@ module.exports = {
71
75
'the date to unix time in milliseconds.'
72
76
] . join ( ' ' )
73
77
} ) ,
78
+ xsizemode : {
79
+ valType : 'enumerated' ,
80
+ values : [ 'scaled' , 'pixel' ] ,
81
+ dflt : 'scaled' ,
82
+ role : 'info' ,
83
+ editType : 'calcIfAutorange+arraydraw' ,
84
+ description : [
85
+ 'Sets the shapes\'s sizing mode along the x axis.' ,
86
+ 'If set to *scaled*, `x0`, `x1` and x coordinates within `path` refer to' ,
87
+ 'data values on the x axis or a fraction of the plot area\'s width' ,
88
+ '(`xref` set to *paper*).' ,
89
+ 'If set to *pixel*, `xanchor` specifies the x position in terms' ,
90
+ 'of data or plot fraction but `x0`, `x1` and x coordinates within `path`' ,
91
+ 'are pixels relative to `xanchor`. This way, the shape can have' ,
92
+ 'a fixed width while maintaining a position relative to data or' ,
93
+ 'plot fraction.'
94
+ ] . join ( ' ' )
95
+ } ,
96
+ xanchor : {
97
+ valType : 'any' ,
98
+ role : 'info' ,
99
+ editType : 'calcIfAutorange+arraydraw' ,
100
+ description : [
101
+ 'Only relevant in conjunction with `xsizemode` set to *pixel*.' ,
102
+ 'Specifies the anchor point on the x axis to which `x0`, `x1`' ,
103
+ 'and x coordinates within `path` are relative to.' ,
104
+ 'E.g. useful to attach a pixel sized shape to a certain data value.' ,
105
+ 'No effect when `xsizemode` not set to *pixel*.'
106
+ ] . join ( ' ' )
107
+ } ,
74
108
x0 : {
75
109
valType : 'any' ,
76
110
role : 'info' ,
77
111
editType : 'calcIfAutorange+arraydraw' ,
78
112
description : [
79
113
'Sets the shape\'s starting x position.' ,
80
- 'See `type` for more info.'
114
+ 'See `type` and `xsizemode` for more info.'
81
115
] . join ( ' ' )
82
116
} ,
83
117
x1 : {
@@ -86,7 +120,7 @@ module.exports = {
86
120
editType : 'calcIfAutorange+arraydraw' ,
87
121
description : [
88
122
'Sets the shape\'s end x position.' ,
89
- 'See `type` for more info.'
123
+ 'See `type` and `xsizemode` for more info.'
90
124
] . join ( ' ' )
91
125
} ,
92
126
@@ -100,13 +134,43 @@ module.exports = {
100
134
'where *0* (*1*) corresponds to the bottom (top).'
101
135
] . join ( ' ' )
102
136
} ) ,
137
+ ysizemode : {
138
+ valType : 'enumerated' ,
139
+ values : [ 'scaled' , 'pixel' ] ,
140
+ dflt : 'scaled' ,
141
+ role : 'info' ,
142
+ editType : 'calcIfAutorange+arraydraw' ,
143
+ description : [
144
+ 'Sets the shapes\'s sizing mode along the y axis.' ,
145
+ 'If set to *scaled*, `y0`, `y1` and y coordinates within `path` refer to' ,
146
+ 'data values on the y axis or a fraction of the plot area\'s height' ,
147
+ '(`yref` set to *paper*).' ,
148
+ 'If set to *pixel*, `yanchor` specifies the y position in terms' ,
149
+ 'of data or plot fraction but `y0`, `y1` and y coordinates within `path`' ,
150
+ 'are pixels relative to `yanchor`. This way, the shape can have' ,
151
+ 'a fixed height while maintaining a position relative to data or' ,
152
+ 'plot fraction.'
153
+ ] . join ( ' ' )
154
+ } ,
155
+ yanchor : {
156
+ valType : 'any' ,
157
+ role : 'info' ,
158
+ editType : 'calcIfAutorange+arraydraw' ,
159
+ description : [
160
+ 'Only relevant in conjunction with `ysizemode` set to *pixel*.' ,
161
+ 'Specifies the anchor point on the y axis to which `y0`, `y1`' ,
162
+ 'and y coordinates within `path` are relative to.' ,
163
+ 'E.g. useful to attach a pixel sized shape to a certain data value.' ,
164
+ 'No effect when `ysizemode` not set to *pixel*.'
165
+ ] . join ( ' ' )
166
+ } ,
103
167
y0 : {
104
168
valType : 'any' ,
105
169
role : 'info' ,
106
170
editType : 'calcIfAutorange+arraydraw' ,
107
171
description : [
108
172
'Sets the shape\'s starting y position.' ,
109
- 'See `type` for more info.'
173
+ 'See `type` and `ysizemode` for more info.'
110
174
] . join ( ' ' )
111
175
} ,
112
176
y1 : {
@@ -115,7 +179,7 @@ module.exports = {
115
179
editType : 'calcIfAutorange+arraydraw' ,
116
180
description : [
117
181
'Sets the shape\'s end y position.' ,
118
- 'See `type` for more info.'
182
+ 'See `type` and `ysizemode` for more info.'
119
183
] . join ( ' ' )
120
184
} ,
121
185
@@ -124,8 +188,11 @@ module.exports = {
124
188
role : 'info' ,
125
189
editType : 'calcIfAutorange+arraydraw' ,
126
190
description : [
127
- 'For `type` *path* - a valid SVG path but with the pixel values' ,
128
- 'replaced by data values. There are a few restrictions / quirks' ,
191
+ 'For `type` *path* - a valid SVG path with the pixel values' ,
192
+ 'replaced by data values in `xsizemode`/`ysizemode` being *scaled*' ,
193
+ 'and taken unmodified as pixels relative to `xanchor` and `yanchor`' ,
194
+ 'in case of *pixel* size mode.' ,
195
+ 'There are a few restrictions / quirks' ,
129
196
'only absolute instructions, not relative. So the allowed segments' ,
130
197
'are: M, L, H, V, Q, C, T, S, and Z' ,
131
198
'arcs (A) are not allowed because radius rx and ry are relative.' ,
0 commit comments