11
11
var ARROWPATHS = require ( './arrow_paths' ) ;
12
12
var fontAttrs = require ( '../../plots/font_attributes' ) ;
13
13
var cartesianConstants = require ( '../../plots/cartesian/constants' ) ;
14
- var extendFlat = require ( '../../lib/extend' ) . extendFlat ;
15
14
16
15
17
16
module . exports = {
@@ -21,6 +20,7 @@ module.exports = {
21
20
valType : 'boolean' ,
22
21
role : 'info' ,
23
22
dflt : true ,
23
+ editType : 'calcIfAutorange' ,
24
24
description : [
25
25
'Determines whether or not this annotation is visible.'
26
26
] . join ( ' ' )
@@ -29,6 +29,7 @@ module.exports = {
29
29
text : {
30
30
valType : 'string' ,
31
31
role : 'info' ,
32
+ editType : 'calcIfAutorange' ,
32
33
description : [
33
34
'Sets the text associated with this annotation.' ,
34
35
'Plotly uses a subset of HTML tags to do things like' ,
@@ -41,19 +42,23 @@ module.exports = {
41
42
valType : 'angle' ,
42
43
dflt : 0 ,
43
44
role : 'style' ,
45
+ editType : 'calcIfAutorange' ,
44
46
description : [
45
47
'Sets the angle at which the `text` is drawn' ,
46
48
'with respect to the horizontal.'
47
49
] . join ( ' ' )
48
50
} ,
49
- font : extendFlat ( { } , fontAttrs , {
51
+ font : fontAttrs ( {
52
+ editType : 'calcIfAutorange' ,
53
+ colorEditType : 'arraydraw' ,
50
54
description : 'Sets the annotation text font.'
51
55
} ) ,
52
56
width : {
53
57
valType : 'number' ,
54
58
min : 1 ,
55
59
dflt : null ,
56
60
role : 'style' ,
61
+ editType : 'calcIfAutorange' ,
57
62
description : [
58
63
'Sets an explicit width for the text box. null (default) lets the' ,
59
64
'text set the box width. Wider text will be clipped.' ,
@@ -65,6 +70,7 @@ module.exports = {
65
70
min : 1 ,
66
71
dflt : null ,
67
72
role : 'style' ,
73
+ editType : 'calcIfAutorange' ,
68
74
description : [
69
75
'Sets an explicit height for the text box. null (default) lets the' ,
70
76
'text set the box height. Taller text will be clipped.'
@@ -76,13 +82,15 @@ module.exports = {
76
82
max : 1 ,
77
83
dflt : 1 ,
78
84
role : 'style' ,
85
+ editType : 'arraydraw' ,
79
86
description : 'Sets the opacity of the annotation (text + arrow).'
80
87
} ,
81
88
align : {
82
89
valType : 'enumerated' ,
83
90
values : [ 'left' , 'center' , 'right' ] ,
84
91
dflt : 'center' ,
85
92
role : 'style' ,
93
+ editType : 'arraydraw' ,
86
94
description : [
87
95
'Sets the horizontal alignment of the `text` within the box.' ,
88
96
'Has an effect only if `text` spans more two or more lines' ,
@@ -95,6 +103,7 @@ module.exports = {
95
103
values : [ 'top' , 'middle' , 'bottom' ] ,
96
104
dflt : 'middle' ,
97
105
role : 'style' ,
106
+ editType : 'arraydraw' ,
98
107
description : [
99
108
'Sets the vertical alignment of the `text` within the box.' ,
100
109
'Has an effect only if an explicit height is set to override' ,
@@ -105,12 +114,14 @@ module.exports = {
105
114
valType : 'color' ,
106
115
dflt : 'rgba(0,0,0,0)' ,
107
116
role : 'style' ,
117
+ editType : 'arraydraw' ,
108
118
description : 'Sets the background color of the annotation.'
109
119
} ,
110
120
bordercolor : {
111
121
valType : 'color' ,
112
122
dflt : 'rgba(0,0,0,0)' ,
113
123
role : 'style' ,
124
+ editType : 'arraydraw' ,
114
125
description : [
115
126
'Sets the color of the border enclosing the annotation `text`.'
116
127
] . join ( ' ' )
@@ -120,6 +131,7 @@ module.exports = {
120
131
min : 0 ,
121
132
dflt : 1 ,
122
133
role : 'style' ,
134
+ editType : 'calcIfAutorange' ,
123
135
description : [
124
136
'Sets the padding (in px) between the `text`' ,
125
137
'and the enclosing border.'
@@ -130,6 +142,7 @@ module.exports = {
130
142
min : 0 ,
131
143
dflt : 1 ,
132
144
role : 'style' ,
145
+ editType : 'calcIfAutorange' ,
133
146
description : [
134
147
'Sets the width (in px) of the border enclosing' ,
135
148
'the annotation `text`.'
@@ -140,6 +153,7 @@ module.exports = {
140
153
valType : 'boolean' ,
141
154
dflt : true ,
142
155
role : 'style' ,
156
+ editType : 'calcIfAutorange' ,
143
157
description : [
144
158
'Determines whether or not the annotation is drawn with an arrow.' ,
145
159
'If *true*, `text` is placed near the arrow\'s tail.' ,
@@ -149,6 +163,7 @@ module.exports = {
149
163
arrowcolor : {
150
164
valType : 'color' ,
151
165
role : 'style' ,
166
+ editType : 'arraydraw' ,
152
167
description : 'Sets the color of the annotation arrow.'
153
168
} ,
154
169
arrowhead : {
@@ -157,26 +172,33 @@ module.exports = {
157
172
max : ARROWPATHS . length ,
158
173
dflt : 1 ,
159
174
role : 'style' ,
175
+ editType : 'arraydraw' ,
160
176
description : 'Sets the annotation arrow head style.'
161
177
} ,
162
178
arrowsize : {
163
179
valType : 'number' ,
164
180
min : 0.3 ,
165
181
dflt : 1 ,
166
182
role : 'style' ,
167
- description : 'Sets the size (in px) of annotation arrow head.'
183
+ editType : 'calcIfAutorange' ,
184
+ description : [
185
+ 'Sets the size of the annotation arrow head, relative to `arrowwidth`.' ,
186
+ 'A value of 1 (default) gives a head about 3x as wide as the line.'
187
+ ] . join ( ' ' )
168
188
} ,
169
189
arrowwidth : {
170
190
valType : 'number' ,
171
191
min : 0.1 ,
172
192
role : 'style' ,
173
- description : 'Sets the width (in px) of annotation arrow.'
193
+ editType : 'calcIfAutorange' ,
194
+ description : 'Sets the width (in px) of annotation arrow line.'
174
195
} ,
175
196
standoff : {
176
197
valType : 'number' ,
177
198
min : 0 ,
178
199
dflt : 0 ,
179
200
role : 'style' ,
201
+ editType : 'calcIfAutorange' ,
180
202
description : [
181
203
'Sets a distance, in pixels, to move the arrowhead away from the' ,
182
204
'position it is pointing at, for example to point at the edge of' ,
@@ -188,6 +210,7 @@ module.exports = {
188
210
ax : {
189
211
valType : 'any' ,
190
212
role : 'info' ,
213
+ editType : 'calcIfAutorange' ,
191
214
description : [
192
215
'Sets the x component of the arrow tail about the arrow head.' ,
193
216
'If `axref` is `pixel`, a positive (negative) ' ,
@@ -200,6 +223,7 @@ module.exports = {
200
223
ay : {
201
224
valType : 'any' ,
202
225
role : 'info' ,
226
+ editType : 'calcIfAutorange' ,
203
227
description : [
204
228
'Sets the y component of the arrow tail about the arrow head.' ,
205
229
'If `ayref` is `pixel`, a positive (negative) ' ,
@@ -217,6 +241,7 @@ module.exports = {
217
241
cartesianConstants . idRegex . x . toString ( )
218
242
] ,
219
243
role : 'info' ,
244
+ editType : 'calc' ,
220
245
description : [
221
246
'Indicates in what terms the tail of the annotation (ax,ay) ' ,
222
247
'is specified. If `pixel`, `ax` is a relative offset in pixels ' ,
@@ -234,6 +259,7 @@ module.exports = {
234
259
cartesianConstants . idRegex . y . toString ( )
235
260
] ,
236
261
role : 'info' ,
262
+ editType : 'calc' ,
237
263
description : [
238
264
'Indicates in what terms the tail of the annotation (ax,ay) ' ,
239
265
'is specified. If `pixel`, `ay` is a relative offset in pixels ' ,
@@ -251,6 +277,7 @@ module.exports = {
251
277
cartesianConstants . idRegex . x . toString ( )
252
278
] ,
253
279
role : 'info' ,
280
+ editType : 'calc' ,
254
281
description : [
255
282
'Sets the annotation\'s x coordinate axis.' ,
256
283
'If set to an x axis id (e.g. *x* or *x2*), the `x` position' ,
@@ -263,6 +290,7 @@ module.exports = {
263
290
x : {
264
291
valType : 'any' ,
265
292
role : 'info' ,
293
+ editType : 'calcIfAutorange' ,
266
294
description : [
267
295
'Sets the annotation\'s x position.' ,
268
296
'If the axis `type` is *log*, then you must take the' ,
@@ -280,6 +308,7 @@ module.exports = {
280
308
values : [ 'auto' , 'left' , 'center' , 'right' ] ,
281
309
dflt : 'auto' ,
282
310
role : 'info' ,
311
+ editType : 'calcIfAutorange' ,
283
312
description : [
284
313
'Sets the text box\'s horizontal position anchor' ,
285
314
'This anchor binds the `x` position to the *left*, *center*' ,
@@ -298,6 +327,7 @@ module.exports = {
298
327
valType : 'number' ,
299
328
dflt : 0 ,
300
329
role : 'style' ,
330
+ editType : 'calcIfAutorange' ,
301
331
description : [
302
332
'Shifts the position of the whole annotation and arrow to the' ,
303
333
'right (positive) or left (negative) by this many pixels.'
@@ -310,6 +340,7 @@ module.exports = {
310
340
cartesianConstants . idRegex . y . toString ( )
311
341
] ,
312
342
role : 'info' ,
343
+ editType : 'calc' ,
313
344
description : [
314
345
'Sets the annotation\'s y coordinate axis.' ,
315
346
'If set to an y axis id (e.g. *y* or *y2*), the `y` position' ,
@@ -322,6 +353,7 @@ module.exports = {
322
353
y : {
323
354
valType : 'any' ,
324
355
role : 'info' ,
356
+ editType : 'calcIfAutorange' ,
325
357
description : [
326
358
'Sets the annotation\'s y position.' ,
327
359
'If the axis `type` is *log*, then you must take the' ,
@@ -339,6 +371,7 @@ module.exports = {
339
371
values : [ 'auto' , 'top' , 'middle' , 'bottom' ] ,
340
372
dflt : 'auto' ,
341
373
role : 'info' ,
374
+ editType : 'calcIfAutorange' ,
342
375
description : [
343
376
'Sets the text box\'s vertical position anchor' ,
344
377
'This anchor binds the `y` position to the *top*, *middle*' ,
@@ -357,6 +390,7 @@ module.exports = {
357
390
valType : 'number' ,
358
391
dflt : 0 ,
359
392
role : 'style' ,
393
+ editType : 'calcIfAutorange' ,
360
394
description : [
361
395
'Shifts the position of the whole annotation and arrow up' ,
362
396
'(positive) or down (negative) by this many pixels.'
@@ -367,6 +401,7 @@ module.exports = {
367
401
values : [ false , 'onoff' , 'onout' ] ,
368
402
dflt : false ,
369
403
role : 'style' ,
404
+ editType : 'arraydraw' ,
370
405
description : [
371
406
'Makes this annotation respond to clicks on the plot.' ,
372
407
'If you click a data point that exactly matches the `x` and `y`' ,
@@ -385,6 +420,7 @@ module.exports = {
385
420
xclick : {
386
421
valType : 'any' ,
387
422
role : 'info' ,
423
+ editType : 'arraydraw' ,
388
424
description : [
389
425
'Toggle this annotation when clicking a data point whose `x` value' ,
390
426
'is `xclick` rather than the annotation\'s `x` value.'
@@ -393,6 +429,7 @@ module.exports = {
393
429
yclick : {
394
430
valType : 'any' ,
395
431
role : 'info' ,
432
+ editType : 'arraydraw' ,
396
433
description : [
397
434
'Toggle this annotation when clicking a data point whose `y` value' ,
398
435
'is `yclick` rather than the annotation\'s `y` value.'
@@ -401,6 +438,7 @@ module.exports = {
401
438
hovertext : {
402
439
valType : 'string' ,
403
440
role : 'info' ,
441
+ editType : 'arraydraw' ,
404
442
description : [
405
443
'Sets text to appear when hovering over this annotation.' ,
406
444
'If omitted or blank, no hover label will appear.'
@@ -410,6 +448,7 @@ module.exports = {
410
448
bgcolor : {
411
449
valType : 'color' ,
412
450
role : 'style' ,
451
+ editType : 'arraydraw' ,
413
452
description : [
414
453
'Sets the background color of the hover label.' ,
415
454
'By default uses the annotation\'s `bgcolor` made opaque,' ,
@@ -419,23 +458,27 @@ module.exports = {
419
458
bordercolor : {
420
459
valType : 'color' ,
421
460
role : 'style' ,
461
+ editType : 'arraydraw' ,
422
462
description : [
423
463
'Sets the border color of the hover label.' ,
424
464
'By default uses either dark grey or white, for maximum' ,
425
465
'contrast with `hoverlabel.bgcolor`.'
426
466
] . join ( ' ' )
427
467
} ,
428
- font : extendFlat ( { } , fontAttrs , {
468
+ font : fontAttrs ( {
469
+ editType : 'arraydraw' ,
429
470
description : [
430
471
'Sets the hover label text font.' ,
431
472
'By default uses the global hover font and size,' ,
432
473
'with color from `hoverlabel.bordercolor`.'
433
474
] . join ( ' ' )
434
- } )
475
+ } ) ,
476
+ editType : 'arraydraw'
435
477
} ,
436
478
captureevents : {
437
479
valType : 'boolean' ,
438
480
role : 'info' ,
481
+ editType : 'arraydraw' ,
439
482
description : [
440
483
'Determines whether the annotation text box captures mouse move' ,
441
484
'and click events, or allows those events to pass through to data' ,
@@ -445,11 +488,13 @@ module.exports = {
445
488
'you must explicitly enable `captureevents`.'
446
489
] . join ( ' ' )
447
490
} ,
491
+ editType : 'calc' ,
448
492
449
493
_deprecated : {
450
494
ref : {
451
495
valType : 'string' ,
452
496
role : 'info' ,
497
+ editType : 'calc' ,
453
498
description : [
454
499
'Obsolete. Set `xref` and `yref` separately instead.'
455
500
] . join ( ' ' )
0 commit comments