1
1
'use strict' ;
2
2
3
+ var overrideAll = require ( '../../../plot_api/edit_types' ) . overrideAll ;
3
4
var basePlotAttributes = require ( '../../../plots/attributes' ) ;
4
5
var fontAttrs = require ( '../../../plots/font_attributes' ) ;
5
6
var dash = require ( '../../drawing/attributes' ) . dash ;
6
7
var extendFlat = require ( '../../../lib/extend' ) . extendFlat ;
7
8
var shapeTexttemplateAttrs = require ( '../../../plots/template_attributes' ) . shapeTexttemplateAttrs ;
8
9
var shapeLabelTexttemplateVars = require ( '../label_texttemplate' ) ;
9
10
10
-
11
- module . exports = {
11
+ module . exports = overrideAll ( {
12
12
newshape : {
13
13
visible : extendFlat ( { } , basePlotAttributes . visible , {
14
- editType : 'none' ,
15
14
description : [
16
15
'Determines whether or not new shape is visible.' ,
17
16
'If *legendonly*, the shape is not drawn,' ,
@@ -23,15 +22,13 @@ module.exports = {
23
22
showlegend : {
24
23
valType : 'boolean' ,
25
24
dflt : false ,
26
- editType : 'none' ,
27
25
description : [
28
26
'Determines whether or not new' ,
29
27
'shape is shown in the legend.'
30
28
] . join ( ' ' )
31
29
} ,
32
30
33
31
legend : extendFlat ( { } , basePlotAttributes . legend , {
34
- editType : 'none' ,
35
32
description : [
36
33
'Sets the reference to a legend to show new shape in.' ,
37
34
'References to these legends are *legend*, *legend2*, *legend3*, etc.' ,
@@ -41,7 +38,6 @@ module.exports = {
41
38
} ) ,
42
39
43
40
legendgroup : extendFlat ( { } , basePlotAttributes . legendgroup , {
44
- editType : 'none' ,
45
41
description : [
46
42
'Sets the legend group for new shape.' ,
47
43
'Traces and shapes part of the same legend group hide/show at the same time' ,
@@ -51,19 +47,15 @@ module.exports = {
51
47
52
48
legendgrouptitle : {
53
49
text : extendFlat ( { } , basePlotAttributes . legendgrouptitle . text , {
54
- editType : 'none'
55
50
} ) ,
56
51
font : fontAttrs ( {
57
- editType : 'none' ,
58
52
description : [
59
53
'Sets this legend group\'s title font.'
60
54
] . join ( ' ' ) ,
61
- } ) ,
62
- editType : 'none' ,
55
+ } )
63
56
} ,
64
57
65
58
legendrank : extendFlat ( { } , basePlotAttributes . legendrank , {
66
- editType : 'none' ,
67
59
description : [
68
60
'Sets the legend rank for new shape.' ,
69
61
'Items and groups with smaller ranks are presented on top/left side while' ,
@@ -75,14 +67,12 @@ module.exports = {
75
67
} ) ,
76
68
77
69
legendwidth : extendFlat ( { } , basePlotAttributes . legendwidth , {
78
- editType : 'none' ,
79
70
description : 'Sets the width (in px or fraction) of the legend for new shape.' ,
80
71
} ) ,
81
72
82
73
line : {
83
74
color : {
84
75
valType : 'color' ,
85
- editType : 'none' ,
86
76
description : [
87
77
'Sets the line color.' ,
88
78
'By default uses either dark grey or white' ,
@@ -93,19 +83,15 @@ module.exports = {
93
83
valType : 'number' ,
94
84
min : 0 ,
95
85
dflt : 4 ,
96
- editType : 'none' ,
97
86
description : 'Sets the line width (in px).'
98
87
} ,
99
88
dash : extendFlat ( { } , dash , {
100
89
dflt : 'solid' ,
101
- editType : 'none'
102
- } ) ,
103
- editType : 'none'
90
+ } )
104
91
} ,
105
92
fillcolor : {
106
93
valType : 'color' ,
107
94
dflt : 'rgba(0,0,0,0)' ,
108
- editType : 'none' ,
109
95
description : [
110
96
'Sets the color filling new shapes\' interior.' ,
111
97
'Please note that if using a fillcolor with alpha greater than half,' ,
@@ -117,7 +103,6 @@ module.exports = {
117
103
valType : 'enumerated' ,
118
104
values : [ 'evenodd' , 'nonzero' ] ,
119
105
dflt : 'evenodd' ,
120
- editType : 'none' ,
121
106
description : [
122
107
'Determines the path\'s interior.' ,
123
108
'For more info please visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule'
@@ -128,21 +113,18 @@ module.exports = {
128
113
min : 0 ,
129
114
max : 1 ,
130
115
dflt : 1 ,
131
- editType : 'none' ,
132
116
description : 'Sets the opacity of new shapes.'
133
117
} ,
134
118
layer : {
135
119
valType : 'enumerated' ,
136
120
values : [ 'below' , 'above' ] ,
137
121
dflt : 'above' ,
138
- editType : 'none' ,
139
122
description : 'Specifies whether new shapes are drawn below or above traces.'
140
123
} ,
141
124
drawdirection : {
142
125
valType : 'enumerated' ,
143
126
values : [ 'ortho' , 'horizontal' , 'vertical' , 'diagonal' ] ,
144
127
dflt : 'diagonal' ,
145
- editType : 'none' ,
146
128
description : [
147
129
'When `dragmode` is set to *drawrect*, *drawline* or *drawcircle*' ,
148
130
'this limits the drag to be horizontal, vertical or diagonal.' ,
@@ -156,12 +138,10 @@ module.exports = {
156
138
text : {
157
139
valType : 'string' ,
158
140
dflt : '' ,
159
- editType : 'none' ,
160
141
description : 'Sets the text to display with the new shape.'
161
142
} ,
162
- texttemplate : shapeTexttemplateAttrs ( { newshape : true , editType : 'none' } , { keys : Object . keys ( shapeLabelTexttemplateVars ) } ) ,
143
+ texttemplate : shapeTexttemplateAttrs ( { newshape : true } , { keys : Object . keys ( shapeLabelTexttemplateVars ) } ) ,
163
144
font : fontAttrs ( {
164
- editType : 'none' ,
165
145
description : 'Sets the new shape label text font.'
166
146
} ) ,
167
147
textposition : {
@@ -172,7 +152,6 @@ module.exports = {
172
152
'bottom left' , 'bottom center' , 'bottom right' ,
173
153
'start' , 'middle' , 'end' ,
174
154
] ,
175
- editType : 'none' ,
176
155
description : [
177
156
'Sets the position of the label text relative to the new shape.' ,
178
157
'Supported values for rectangles, circles and paths are' ,
@@ -186,7 +165,6 @@ module.exports = {
186
165
textangle : {
187
166
valType : 'angle' ,
188
167
dflt : 'auto' ,
189
- editType : 'none' ,
190
168
description : [
191
169
'Sets the angle at which the label text is drawn' ,
192
170
'with respect to the horizontal. For lines, angle *auto*' ,
@@ -198,7 +176,6 @@ module.exports = {
198
176
valType : 'enumerated' ,
199
177
values : [ 'auto' , 'left' , 'center' , 'right' ] ,
200
178
dflt : 'auto' ,
201
- editType : 'none' ,
202
179
description : [
203
180
'Sets the label\'s horizontal position anchor' ,
204
181
'This anchor binds the specified `textposition` to the *left*, *center*' ,
@@ -212,7 +189,6 @@ module.exports = {
212
189
yanchor : {
213
190
valType : 'enumerated' ,
214
191
values : [ 'top' , 'middle' , 'bottom' ] ,
215
- editType : 'none' ,
216
192
description : [
217
193
'Sets the label\'s vertical position anchor' ,
218
194
'This anchor binds the specified `textposition` to the *top*, *middle*' ,
@@ -227,29 +203,23 @@ module.exports = {
227
203
valType : 'number' ,
228
204
dflt : 3 ,
229
205
min : 0 ,
230
- editType : 'none' ,
231
206
description : 'Sets padding (in px) between edge of label and edge of new shape.'
232
- } ,
233
- editType : 'none'
234
- } ,
235
- editType : 'none'
207
+ }
208
+ }
236
209
} ,
237
210
238
211
activeshape : {
239
212
fillcolor : {
240
213
valType : 'color' ,
241
214
dflt : 'rgb(255,0,255)' ,
242
- editType : 'none' ,
243
215
description : 'Sets the color filling the active shape\' interior.'
244
216
} ,
245
217
opacity : {
246
218
valType : 'number' ,
247
219
min : 0 ,
248
220
max : 1 ,
249
221
dflt : 0.5 ,
250
- editType : 'none' ,
251
222
description : 'Sets the opacity of the active shape.'
252
- } ,
253
- editType : 'none'
223
+ }
254
224
}
255
- } ;
225
+ } , 'none' , 'from-root' ) ;
0 commit comments