@@ -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,41 @@ module.exports = {
71
75
'the date to unix time in milliseconds.'
72
76
] . join ( ' ' )
73
77
} ) ,
78
+ xsizemode : {
79
+ valType : 'enumerated' ,
80
+ values : [ 'data' , 'pixel' ] ,
81
+ dflt : 'data' ,
82
+ role : 'info' ,
83
+ editType : 'calcIfAutorange+arraydraw' ,
84
+ description : [
85
+ 'Sets the shapes\'s sizing mode along the x axis.' ,
86
+ 'If set to *data*, `x0`, `x1` and x coordinates within `path` refer to' ,
87
+ 'data values on the x axis.' ,
88
+ 'If set to *pixel*, `xanchor` specifies the x position in terms' ,
89
+ 'of data but `x0`, `x1` and x coordinates within `path`' ,
90
+ 'are pixels relative to `xanchor`. This way, the shape can have' ,
91
+ 'a fixed width while maintaining a position relative to data.'
92
+ ] . join ( ' ' )
93
+ } ,
94
+ xanchor : {
95
+ valType : 'any' ,
96
+ role : 'info' ,
97
+ editType : 'calcIfAutorange+arraydraw' ,
98
+ description : [
99
+ 'Only relevant in conjunction with `xsizemode` set to *pixel*.' ,
100
+ 'Specifies the anchor point on the x axis to which `x0`, `x1`' ,
101
+ 'and x coordinates within `path` are relative to.' ,
102
+ 'E.g. useful to attach a pixel sized shape to a certain data value.' ,
103
+ 'No effect when `xsizemode` not set to *pixel*.'
104
+ ] . join ( ' ' )
105
+ } ,
74
106
x0 : {
75
107
valType : 'any' ,
76
108
role : 'info' ,
77
109
editType : 'calcIfAutorange+arraydraw' ,
78
110
description : [
79
111
'Sets the shape\'s starting x position.' ,
80
- 'See `type` for more info.'
112
+ 'See `type` and `xsizemode` for more info.'
81
113
] . join ( ' ' )
82
114
} ,
83
115
x1 : {
@@ -86,7 +118,7 @@ module.exports = {
86
118
editType : 'calcIfAutorange+arraydraw' ,
87
119
description : [
88
120
'Sets the shape\'s end x position.' ,
89
- 'See `type` for more info.'
121
+ 'See `type` and `xsizemode` for more info.'
90
122
] . join ( ' ' )
91
123
} ,
92
124
@@ -100,13 +132,41 @@ module.exports = {
100
132
'where *0* (*1*) corresponds to the bottom (top).'
101
133
] . join ( ' ' )
102
134
} ) ,
135
+ ysizemode : {
136
+ valType : 'enumerated' ,
137
+ values : [ 'data' , 'pixel' ] ,
138
+ dflt : 'data' ,
139
+ role : 'info' ,
140
+ editType : 'calcIfAutorange+arraydraw' ,
141
+ description : [
142
+ 'Sets the shapes\'s sizing mode along the y axis.' ,
143
+ 'If set to *data*, `y0`, `y1` and y coordinates within `path` refer to' ,
144
+ 'data values on the y axis.' ,
145
+ 'If set to *pixel*, `yanchor` specifies the y position in terms' ,
146
+ 'of data but `y0`, `y1` and y coordinates within `path`' ,
147
+ 'are pixels relative to `yanchor`. This way, the shape can have' ,
148
+ 'a fixed height while maintaining a position relative to data.'
149
+ ] . join ( ' ' )
150
+ } ,
151
+ yanchor : {
152
+ valType : 'any' ,
153
+ role : 'info' ,
154
+ editType : 'calcIfAutorange+arraydraw' ,
155
+ description : [
156
+ 'Only relevant in conjunction with `ysizemode` set to *pixel*.' ,
157
+ 'Specifies the anchor point on the y axis to which `y0`, `y1`' ,
158
+ 'and y coordinates within `path` are relative to.' ,
159
+ 'E.g. useful to attach a pixel sized shape to a certain data value.' ,
160
+ 'No effect when `ysizemode` not set to *pixel*.'
161
+ ] . join ( ' ' )
162
+ } ,
103
163
y0 : {
104
164
valType : 'any' ,
105
165
role : 'info' ,
106
166
editType : 'calcIfAutorange+arraydraw' ,
107
167
description : [
108
168
'Sets the shape\'s starting y position.' ,
109
- 'See `type` for more info.'
169
+ 'See `type` and `ysizemode` for more info.'
110
170
] . join ( ' ' )
111
171
} ,
112
172
y1 : {
@@ -115,7 +175,7 @@ module.exports = {
115
175
editType : 'calcIfAutorange+arraydraw' ,
116
176
description : [
117
177
'Sets the shape\'s end y position.' ,
118
- 'See `type` for more info.'
178
+ 'See `type` and `ysizemode` for more info.'
119
179
] . join ( ' ' )
120
180
} ,
121
181
@@ -124,8 +184,11 @@ module.exports = {
124
184
role : 'info' ,
125
185
editType : 'calcIfAutorange+arraydraw' ,
126
186
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' ,
187
+ 'For `type` *path* - a valid SVG path with the pixel values' ,
188
+ 'replaced by data values in `xsizemode`/`ysizemode` being *data*' ,
189
+ 'and taken unmodified as pixels relative to `xanchor` and `yanchor`' ,
190
+ 'in case of *pixel* size mode.' ,
191
+ 'There are a few restrictions / quirks' ,
129
192
'only absolute instructions, not relative. So the allowed segments' ,
130
193
'are: M, L, H, V, Q, C, T, S, and Z' ,
131
194
'arcs (A) are not allowed because radius rx and ry are relative.' ,
0 commit comments