Skip to content

Commit 9a4a121

Browse files
committed
Merge branch 'add-text-to-shapes' of https://github.com/plotly/plotly.js into add-text-to-shapes
2 parents 3f9727a + 8cec651 commit 9a4a121

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

src/components/shapes/draw_newshape/attributes.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
var fontAttrs = require('../../../plots/font_attributes');
4-
var annAttrs = require('../../annotations/attributes');
54
var dash = require('../../drawing/attributes').dash;
65
var extendFlat = require('../../../lib/extend').extendFlat;
76

@@ -102,25 +101,35 @@ module.exports = {
102101
},
103102
textangle: {
104103
valType: 'angle',
105-
editType: 'calc+arraydraw',
104+
editType: 'none',
106105
description: [
107106
'Sets the angle at which the label text is drawn',
108107
'with respect to the horizontal. For lines, the default textangle is `auto`,',
109108
'which displays the text at the same angle as the line. For all other shapes,',
110109
'the default textangle is 0 (horizontal).'
111110
].join(' ')
112111
},
113-
xanchor: extendFlat({}, annAttrs.xanchor, {
112+
xanchor: {
113+
valType: 'enumerated',
114+
values: ['auto', 'left', 'center', 'right'],
115+
dflt: 'auto',
116+
editType: 'none',
114117
description: 'Sets the text box\'s horizontal position anchor.',
115-
}),
116-
yanchor: extendFlat({}, annAttrs.yanchor, {
118+
},
119+
yanchor: {
120+
valType: 'enumerated',
121+
values: ['auto', 'top', 'middle', 'bottom'],
122+
dflt: 'auto',
123+
editType: 'none',
117124
description: 'Sets the text box\'s vertical position anchor.',
118-
}),
125+
},
119126
padding: {
120127
valType: 'number',
121128
dflt: 3,
129+
editType: 'none',
122130
description: 'Sets padding between edge of label and xanchor / yanchor.'
123131
},
132+
editType: 'none'
124133
},
125134
editType: 'none'
126135
},

test/plot-schema.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3574,6 +3574,7 @@
35743574
]
35753575
},
35763576
"label": {
3577+
"editType": "none",
35773578
"font": {
35783579
"color": {
35793580
"editType": "calc+arraydraw",
@@ -3598,6 +3599,7 @@
35983599
"padding": {
35993600
"description": "Sets padding between edge of label and xanchor / yanchor.",
36003601
"dflt": 3,
3602+
"editType": "none",
36013603
"valType": "number"
36023604
},
36033605
"role": "object",
@@ -3608,7 +3610,7 @@
36083610
},
36093611
"textangle": {
36103612
"description": "Sets the angle at which the label text is drawn with respect to the horizontal. For lines, the default textangle is `auto`, which displays the text at the same angle as the line. For all other shapes, the default textangle is 0 (horizontal).",
3611-
"editType": "calc+arraydraw",
3613+
"editType": "none",
36123614
"valType": "angle"
36133615
},
36143616
"textposition": {
@@ -3632,7 +3634,7 @@
36323634
"xanchor": {
36333635
"description": "Sets the text box's horizontal position anchor.",
36343636
"dflt": "auto",
3635-
"editType": "calc+arraydraw",
3637+
"editType": "none",
36363638
"valType": "enumerated",
36373639
"values": [
36383640
"auto",
@@ -3644,7 +3646,7 @@
36443646
"yanchor": {
36453647
"description": "Sets the text box's vertical position anchor.",
36463648
"dflt": "auto",
3647-
"editType": "calc+arraydraw",
3649+
"editType": "none",
36483650
"valType": "enumerated",
36493651
"values": [
36503652
"auto",

0 commit comments

Comments
 (0)