Skip to content

Commit 11b3421

Browse files
committed
better docstrings for xanchor and yanchor
1 parent feb2f38 commit 11b3421

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

src/components/shapes/attributes.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,29 @@ module.exports = templatedArray('shape', {
263263
values: ['auto', 'left', 'center', 'right'],
264264
dflt: 'auto',
265265
editType: 'calc+arraydraw',
266-
description: 'Sets the text box\'s horizontal position anchor.',
266+
description: [
267+
'Sets the label\'s horizontal position anchor',
268+
'This anchor binds the specified `label.textposition` to the *left*, *center*',
269+
'or *right* of the label text.',
270+
'For example, if `label.textposition` is set to *top right* and',
271+
'`xanchor` to *right* then the right-most portion of the',
272+
'label text lines up with the right-most edge of the',
273+
'shape.',
274+
].join(' '),
267275
},
268276
yanchor: {
269277
valType: 'enumerated',
270278
values: ['top', 'middle', 'bottom'],
271279
editType: 'calc+arraydraw',
272-
description: 'Sets the text box\'s vertical position anchor.',
280+
description: [
281+
'Sets the label\'s vertical position anchor',
282+
'This anchor binds the specified `label.textposition` to the *top*, *middle*',
283+
'or *bottom* of the label text.',
284+
'For example, if `label.textposition` is set to *top right* and',
285+
'`yanchor` to *top* then the top-most portion of the',
286+
'label text lines up with the top-most edge of the',
287+
'shape.',
288+
].join(' ')
273289
},
274290
padding: {
275291
valType: 'number',

src/components/shapes/draw_newshape/attributes.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,29 @@ module.exports = {
116116
values: ['auto', 'left', 'center', 'right'],
117117
dflt: 'auto',
118118
editType: 'none',
119-
description: 'Sets the text box\'s horizontal position anchor.',
119+
description: [
120+
'Sets the label\'s horizontal position anchor',
121+
'This anchor binds the specified `label.textposition` to the *left*, *center*',
122+
'or *right* of the label text.',
123+
'For example, if `label.textposition` is set to *top right* and',
124+
'`xanchor` to *right* then the right-most portion of the',
125+
'label text lines up with the right-most edge of the',
126+
'shape.',
127+
].join(' '),
120128
},
121129
yanchor: {
122130
valType: 'enumerated',
123131
values: ['top', 'middle', 'bottom'],
124132
editType: 'none',
125-
description: 'Sets the text box\'s vertical position anchor.',
133+
description: [
134+
'Sets the label\'s vertical position anchor',
135+
'This anchor binds the specified `label.textposition` to the *top*, *middle*',
136+
'or *bottom* of the label text.',
137+
'For example, if `label.textposition` is set to *top right* and',
138+
'`yanchor` to *top* then the top-most portion of the',
139+
'label text lines up with the top-most edge of the',
140+
'shape.',
141+
].join(' ')
126142
},
127143
padding: {
128144
valType: 'number',

0 commit comments

Comments
 (0)