Skip to content

Commit f49ae5e

Browse files
committed
massive commit to lock in editType and impliedEdits and clean up restyle/relayout
1 parent 658e5cb commit f49ae5e

File tree

79 files changed

+1470
-889
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1470
-889
lines changed

src/components/annotations/attributes.js

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
var ARROWPATHS = require('./arrow_paths');
1212
var fontAttrs = require('../../plots/font_attributes');
1313
var cartesianConstants = require('../../plots/cartesian/constants');
14-
var extendFlat = require('../../lib/extend').extendFlat;
1514

1615

1716
module.exports = {
@@ -21,6 +20,7 @@ module.exports = {
2120
valType: 'boolean',
2221
role: 'info',
2322
dflt: true,
23+
editType: 'docalcAutorange',
2424
description: [
2525
'Determines whether or not this annotation is visible.'
2626
].join(' ')
@@ -29,6 +29,7 @@ module.exports = {
2929
text: {
3030
valType: 'string',
3131
role: 'info',
32+
editType: 'docalcAutorange',
3233
description: [
3334
'Sets the text associated with this annotation.',
3435
'Plotly uses a subset of HTML tags to do things like',
@@ -41,19 +42,23 @@ module.exports = {
4142
valType: 'angle',
4243
dflt: 0,
4344
role: 'style',
45+
editType: 'docalcAutorange',
4446
description: [
4547
'Sets the angle at which the `text` is drawn',
4648
'with respect to the horizontal.'
4749
].join(' ')
4850
},
49-
font: extendFlat({}, fontAttrs, {
51+
font: fontAttrs({
52+
editType: 'docalcAutorange',
53+
colorEditType: 'doarraydraw',
5054
description: 'Sets the annotation text font.'
5155
}),
5256
width: {
5357
valType: 'number',
5458
min: 1,
5559
dflt: null,
5660
role: 'style',
61+
editType: 'docalcAutorange',
5762
description: [
5863
'Sets an explicit width for the text box. null (default) lets the',
5964
'text set the box width. Wider text will be clipped.',
@@ -65,6 +70,7 @@ module.exports = {
6570
min: 1,
6671
dflt: null,
6772
role: 'style',
73+
editType: 'docalcAutorange',
6874
description: [
6975
'Sets an explicit height for the text box. null (default) lets the',
7076
'text set the box height. Taller text will be clipped.'
@@ -76,13 +82,15 @@ module.exports = {
7682
max: 1,
7783
dflt: 1,
7884
role: 'style',
85+
editType: 'doarraydraw',
7986
description: 'Sets the opacity of the annotation (text + arrow).'
8087
},
8188
align: {
8289
valType: 'enumerated',
8390
values: ['left', 'center', 'right'],
8491
dflt: 'center',
8592
role: 'style',
93+
editType: 'doarraydraw',
8694
description: [
8795
'Sets the horizontal alignment of the `text` within the box.',
8896
'Has an effect only if `text` spans more two or more lines',
@@ -95,6 +103,7 @@ module.exports = {
95103
values: ['top', 'middle', 'bottom'],
96104
dflt: 'middle',
97105
role: 'style',
106+
editType: 'doarraydraw',
98107
description: [
99108
'Sets the vertical alignment of the `text` within the box.',
100109
'Has an effect only if an explicit height is set to override',
@@ -105,12 +114,14 @@ module.exports = {
105114
valType: 'color',
106115
dflt: 'rgba(0,0,0,0)',
107116
role: 'style',
117+
editType: 'doarraydraw',
108118
description: 'Sets the background color of the annotation.'
109119
},
110120
bordercolor: {
111121
valType: 'color',
112122
dflt: 'rgba(0,0,0,0)',
113123
role: 'style',
124+
editType: 'doarraydraw',
114125
description: [
115126
'Sets the color of the border enclosing the annotation `text`.'
116127
].join(' ')
@@ -120,6 +131,7 @@ module.exports = {
120131
min: 0,
121132
dflt: 1,
122133
role: 'style',
134+
editType: 'docalcAutorange',
123135
description: [
124136
'Sets the padding (in px) between the `text`',
125137
'and the enclosing border.'
@@ -130,6 +142,7 @@ module.exports = {
130142
min: 0,
131143
dflt: 1,
132144
role: 'style',
145+
editType: 'docalcAutorange',
133146
description: [
134147
'Sets the width (in px) of the border enclosing',
135148
'the annotation `text`.'
@@ -140,6 +153,7 @@ module.exports = {
140153
valType: 'boolean',
141154
dflt: true,
142155
role: 'style',
156+
editType: 'docalcAutorange',
143157
description: [
144158
'Determines whether or not the annotation is drawn with an arrow.',
145159
'If *true*, `text` is placed near the arrow\'s tail.',
@@ -149,6 +163,7 @@ module.exports = {
149163
arrowcolor: {
150164
valType: 'color',
151165
role: 'style',
166+
editType: 'doarraydraw',
152167
description: 'Sets the color of the annotation arrow.'
153168
},
154169
arrowhead: {
@@ -157,13 +172,15 @@ module.exports = {
157172
max: ARROWPATHS.length,
158173
dflt: 1,
159174
role: 'style',
175+
editType: 'doarraydraw',
160176
description: 'Sets the annotation arrow head style.'
161177
},
162178
arrowsize: {
163179
valType: 'number',
164180
min: 0.3,
165181
dflt: 1,
166182
role: 'style',
183+
editType: 'docalcAutorange',
167184
description: [
168185
'Sets the size of the annotation arrow head, relative to `arrowwidth`.',
169186
'A value of 1 (default) gives a head about 3x as wide as the line.'
@@ -173,13 +190,15 @@ module.exports = {
173190
valType: 'number',
174191
min: 0.1,
175192
role: 'style',
193+
editType: 'docalcAutorange',
176194
description: 'Sets the width (in px) of annotation arrow line.'
177195
},
178196
standoff: {
179197
valType: 'number',
180198
min: 0,
181199
dflt: 0,
182200
role: 'style',
201+
editType: 'docalcAutorange',
183202
description: [
184203
'Sets a distance, in pixels, to move the arrowhead away from the',
185204
'position it is pointing at, for example to point at the edge of',
@@ -191,6 +210,7 @@ module.exports = {
191210
ax: {
192211
valType: 'any',
193212
role: 'info',
213+
editType: 'docalcAutorange',
194214
description: [
195215
'Sets the x component of the arrow tail about the arrow head.',
196216
'If `axref` is `pixel`, a positive (negative) ',
@@ -203,6 +223,7 @@ module.exports = {
203223
ay: {
204224
valType: 'any',
205225
role: 'info',
226+
editType: 'docalcAutorange',
206227
description: [
207228
'Sets the y component of the arrow tail about the arrow head.',
208229
'If `ayref` is `pixel`, a positive (negative) ',
@@ -220,6 +241,7 @@ module.exports = {
220241
cartesianConstants.idRegex.x.toString()
221242
],
222243
role: 'info',
244+
editType: 'docalc',
223245
description: [
224246
'Indicates in what terms the tail of the annotation (ax,ay) ',
225247
'is specified. If `pixel`, `ax` is a relative offset in pixels ',
@@ -237,6 +259,7 @@ module.exports = {
237259
cartesianConstants.idRegex.y.toString()
238260
],
239261
role: 'info',
262+
editType: 'docalc',
240263
description: [
241264
'Indicates in what terms the tail of the annotation (ax,ay) ',
242265
'is specified. If `pixel`, `ay` is a relative offset in pixels ',
@@ -254,6 +277,7 @@ module.exports = {
254277
cartesianConstants.idRegex.x.toString()
255278
],
256279
role: 'info',
280+
editType: 'docalc',
257281
description: [
258282
'Sets the annotation\'s x coordinate axis.',
259283
'If set to an x axis id (e.g. *x* or *x2*), the `x` position',
@@ -266,6 +290,7 @@ module.exports = {
266290
x: {
267291
valType: 'any',
268292
role: 'info',
293+
editType: 'docalcAutorange',
269294
description: [
270295
'Sets the annotation\'s x position.',
271296
'If the axis `type` is *log*, then you must take the',
@@ -283,6 +308,7 @@ module.exports = {
283308
values: ['auto', 'left', 'center', 'right'],
284309
dflt: 'auto',
285310
role: 'info',
311+
editType: 'docalcAutorange',
286312
description: [
287313
'Sets the text box\'s horizontal position anchor',
288314
'This anchor binds the `x` position to the *left*, *center*',
@@ -301,6 +327,7 @@ module.exports = {
301327
valType: 'number',
302328
dflt: 0,
303329
role: 'style',
330+
editType: 'docalcAutorange',
304331
description: [
305332
'Shifts the position of the whole annotation and arrow to the',
306333
'right (positive) or left (negative) by this many pixels.'
@@ -313,6 +340,7 @@ module.exports = {
313340
cartesianConstants.idRegex.y.toString()
314341
],
315342
role: 'info',
343+
editType: 'docalc',
316344
description: [
317345
'Sets the annotation\'s y coordinate axis.',
318346
'If set to an y axis id (e.g. *y* or *y2*), the `y` position',
@@ -325,6 +353,7 @@ module.exports = {
325353
y: {
326354
valType: 'any',
327355
role: 'info',
356+
editType: 'docalcAutorange',
328357
description: [
329358
'Sets the annotation\'s y position.',
330359
'If the axis `type` is *log*, then you must take the',
@@ -342,6 +371,7 @@ module.exports = {
342371
values: ['auto', 'top', 'middle', 'bottom'],
343372
dflt: 'auto',
344373
role: 'info',
374+
editType: 'docalcAutorange',
345375
description: [
346376
'Sets the text box\'s vertical position anchor',
347377
'This anchor binds the `y` position to the *top*, *middle*',
@@ -360,6 +390,7 @@ module.exports = {
360390
valType: 'number',
361391
dflt: 0,
362392
role: 'style',
393+
editType: 'docalcAutorange',
363394
description: [
364395
'Shifts the position of the whole annotation and arrow up',
365396
'(positive) or down (negative) by this many pixels.'
@@ -370,6 +401,7 @@ module.exports = {
370401
values: [false, 'onoff', 'onout'],
371402
dflt: false,
372403
role: 'style',
404+
editType: 'doarraydraw',
373405
description: [
374406
'Makes this annotation respond to clicks on the plot.',
375407
'If you click a data point that exactly matches the `x` and `y`',
@@ -388,6 +420,7 @@ module.exports = {
388420
xclick: {
389421
valType: 'any',
390422
role: 'info',
423+
editType: 'doarraydraw',
391424
description: [
392425
'Toggle this annotation when clicking a data point whose `x` value',
393426
'is `xclick` rather than the annotation\'s `x` value.'
@@ -396,6 +429,7 @@ module.exports = {
396429
yclick: {
397430
valType: 'any',
398431
role: 'info',
432+
editType: 'doarraydraw',
399433
description: [
400434
'Toggle this annotation when clicking a data point whose `y` value',
401435
'is `yclick` rather than the annotation\'s `y` value.'
@@ -404,6 +438,7 @@ module.exports = {
404438
hovertext: {
405439
valType: 'string',
406440
role: 'info',
441+
editType: 'doarraydraw',
407442
description: [
408443
'Sets text to appear when hovering over this annotation.',
409444
'If omitted or blank, no hover label will appear.'
@@ -413,6 +448,7 @@ module.exports = {
413448
bgcolor: {
414449
valType: 'color',
415450
role: 'style',
451+
editType: 'doarraydraw',
416452
description: [
417453
'Sets the background color of the hover label.',
418454
'By default uses the annotation\'s `bgcolor` made opaque,',
@@ -422,23 +458,27 @@ module.exports = {
422458
bordercolor: {
423459
valType: 'color',
424460
role: 'style',
461+
editType: 'doarraydraw',
425462
description: [
426463
'Sets the border color of the hover label.',
427464
'By default uses either dark grey or white, for maximum',
428465
'contrast with `hoverlabel.bgcolor`.'
429466
].join(' ')
430467
},
431-
font: extendFlat({}, fontAttrs, {
468+
font: fontAttrs({
469+
editType: 'doarraydraw',
432470
description: [
433471
'Sets the hover label text font.',
434472
'By default uses the global hover font and size,',
435473
'with color from `hoverlabel.bordercolor`.'
436474
].join(' ')
437-
})
475+
}),
476+
editType: 'doarraydraw'
438477
},
439478
captureevents: {
440479
valType: 'boolean',
441480
role: 'info',
481+
editType: 'doarraydraw',
442482
description: [
443483
'Determines whether the annotation text box captures mouse move',
444484
'and click events, or allows those events to pass through to data',
@@ -448,11 +488,13 @@ module.exports = {
448488
'you must explicitly enable `captureevents`.'
449489
].join(' ')
450490
},
491+
editType: 'docalc',
451492

452493
_deprecated: {
453494
ref: {
454495
valType: 'string',
455496
role: 'info',
497+
editType: 'docalc',
456498
description: [
457499
'Obsolete. Set `xref` and `yref` separately instead.'
458500
].join(' ')

src/components/annotations3d/attributes.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
'use strict';
1111

1212
var annAtts = require('../annotations/attributes');
13+
var overrideAll = require('../../plot_api/edit_types').overrideAll;
1314

14-
module.exports = {
15+
module.exports = overrideAll({
1516
_isLinkedToArray: 'annotation',
1617

1718
visible: annAtts.visible,
@@ -76,7 +77,7 @@ module.exports = {
7677
standoff: annAtts.standoff,
7778
hovertext: annAtts.hovertext,
7879
hoverlabel: annAtts.hoverlabel,
79-
captureevents: annAtts.captureevents
80+
captureevents: annAtts.captureevents,
8081

8182
// maybes later?
8283
// clicktoshow: annAtts.clicktoshow,
@@ -89,4 +90,4 @@ module.exports = {
8990
// xref: 'x'
9091
// yref: 'y
9192
// zref: 'z'
92-
};
93+
}, 'docalc', true);

src/components/calendars/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var attributes = {
2020
valType: 'enumerated',
2121
values: Object.keys(calendars.calendars),
2222
role: 'info',
23+
editType: 'docalc',
2324
dflt: 'gregorian'
2425
};
2526

0 commit comments

Comments
 (0)