Skip to content

Commit 8489819

Browse files
committed
Add more detail to attribute descriptions
1 parent 81aab22 commit 8489819

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

src/components/shapes/attributes.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ module.exports = templatedArray('shape', {
120120
description: [
121121
"Sets the shape's x coordinate axis.",
122122
axisPlaceableObjs.axisRefDescription('x', 'left', 'right'),
123-
'If an array of axis IDs is provided, each `x` value will refer to the corresponding axis',
124-
'(e.g., [\'x\', \'x2\'] for a rectangle means `x0` uses the `x` axis and `x1` uses the `x2` axis).',
123+
'If an array of axis IDs is provided, each `x` value will refer to the corresponding axis,',
124+
'e.g., [\'x\', \'x2\'] for a rectangle, line, or circle means `x0` uses the `x` axis and `x1` uses the `x2` axis.',
125+
'Path shapes using an array should have one entry for each x coordinate in the string.',
125126
].join(' ')
126127
}),
127128
xsizemode: {
@@ -138,7 +139,8 @@ module.exports = templatedArray('shape', {
138139
'of data or plot fraction but `x0`, `x1` and x coordinates within `path`',
139140
'are pixels relative to `xanchor`. This way, the shape can have',
140141
'a fixed width while maintaining a position relative to data or',
141-
'plot fraction.'
142+
'plot fraction.',
143+
'Note: *pixel* mode is not supported when `xref` is an array.'
142144
].join(' ')
143145
},
144146
xanchor: {
@@ -191,8 +193,9 @@ module.exports = templatedArray('shape', {
191193
description: [
192194
"Sets the shape's y coordinate axis.",
193195
axisPlaceableObjs.axisRefDescription('y', 'bottom', 'top'),
194-
'If an array of axis IDs is provided, each `y` value will refer to the corresponding axis',
195-
'(e.g., [\'y\', \'y2\'] for a rectangle means `y0` uses the `y` axis and `y1` uses the `y2` axis).',
196+
'If an array of axis IDs is provided, each `y` value will refer to the corresponding axis,',
197+
'e.g., [\'y\', \'y2\'] for a rectangle, line, or circle means `y0` uses the `y` axis and `y1` uses the `y2` axis.',
198+
'Path shapes using an array should have one entry for each y coordinate in the string.',
196199
].join(' ')
197200
}),
198201
ysizemode: {
@@ -209,7 +212,8 @@ module.exports = templatedArray('shape', {
209212
'of data or plot fraction but `y0`, `y1` and y coordinates within `path`',
210213
'are pixels relative to `yanchor`. This way, the shape can have',
211214
'a fixed height while maintaining a position relative to data or',
212-
'plot fraction.'
215+
'plot fraction.',
216+
'Note: *pixel* mode is not supported when `yref` is an array.'
213217
].join(' ')
214218
},
215219
yanchor: {

test/plot-schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9899,7 +9899,7 @@
98999899
},
99009900
"xref": {
99019901
"arrayOk": true,
9902-
"description": "Sets the shape's x coordinate axis. If set to a x axis id (e.g. *x* or *x2*), the `x` position refers to a x coordinate. If set to *paper*, the `x` position refers to the distance from the left of the plotting area in normalized coordinates where *0* (*1*) corresponds to the left (right). If set to a x axis ID followed by *domain* (separated by a space), the position behaves like for *paper*, but refers to the distance in fractions of the domain length from the left of the domain of that axis: e.g., *x2 domain* refers to the domain of the second x axis and a x position of 0.5 refers to the point between the left and the right of the domain of the second x axis. If an array of axis IDs is provided, each `x` value will refer to the corresponding axis (e.g., ['x', 'x2'] for a rectangle means `x0` uses the `x` axis and `x1` uses the `x2` axis).",
9902+
"description": "Sets the shape's x coordinate axis. If set to a x axis id (e.g. *x* or *x2*), the `x` position refers to a x coordinate. If set to *paper*, the `x` position refers to the distance from the left of the plotting area in normalized coordinates where *0* (*1*) corresponds to the left (right). If set to a x axis ID followed by *domain* (separated by a space), the position behaves like for *paper*, but refers to the distance in fractions of the domain length from the left of the domain of that axis: e.g., *x2 domain* refers to the domain of the second x axis and a x position of 0.5 refers to the point between the left and the right of the domain of the second x axis. If an array of axis IDs is provided, each `x` value will refer to the corresponding axis, e.g., ['x', 'x2'] for a rectangle, line, or circle means `x0` uses the `x` axis and `x1` uses the `x2` axis. Path shapes using an array should have one entry for each x coordinate in the string.",
99039903
"editType": "calc",
99049904
"valType": "enumerated",
99059905
"values": [
@@ -9913,7 +9913,7 @@
99139913
"valType": "string"
99149914
},
99159915
"xsizemode": {
9916-
"description": "Sets the shapes's sizing mode along the x axis. If set to *scaled*, `x0`, `x1` and x coordinates within `path` refer to data values on the x axis or a fraction of the plot area's width (`xref` set to *paper*). If set to *pixel*, `xanchor` specifies the x position in terms of data or plot fraction but `x0`, `x1` and x coordinates within `path` are pixels relative to `xanchor`. This way, the shape can have a fixed width while maintaining a position relative to data or plot fraction.",
9916+
"description": "Sets the shapes's sizing mode along the x axis. If set to *scaled*, `x0`, `x1` and x coordinates within `path` refer to data values on the x axis or a fraction of the plot area's width (`xref` set to *paper*). If set to *pixel*, `xanchor` specifies the x position in terms of data or plot fraction but `x0`, `x1` and x coordinates within `path` are pixels relative to `xanchor`. This way, the shape can have a fixed width while maintaining a position relative to data or plot fraction. Note: *pixel* mode is not supported when `xref` is an array.",
99179917
"dflt": "scaled",
99189918
"editType": "calc+arraydraw",
99199919
"valType": "enumerated",
@@ -9955,7 +9955,7 @@
99559955
},
99569956
"yref": {
99579957
"arrayOk": true,
9958-
"description": "Sets the shape's y coordinate axis. If set to a y axis id (e.g. *y* or *y2*), the `y` position refers to a y coordinate. If set to *paper*, the `y` position refers to the distance from the bottom of the plotting area in normalized coordinates where *0* (*1*) corresponds to the bottom (top). If set to a y axis ID followed by *domain* (separated by a space), the position behaves like for *paper*, but refers to the distance in fractions of the domain length from the bottom of the domain of that axis: e.g., *y2 domain* refers to the domain of the second y axis and a y position of 0.5 refers to the point between the bottom and the top of the domain of the second y axis. If an array of axis IDs is provided, each `y` value will refer to the corresponding axis (e.g., ['y', 'y2'] for a rectangle means `y0` uses the `y` axis and `y1` uses the `y2` axis).",
9958+
"description": "Sets the shape's y coordinate axis. If set to a y axis id (e.g. *y* or *y2*), the `y` position refers to a y coordinate. If set to *paper*, the `y` position refers to the distance from the bottom of the plotting area in normalized coordinates where *0* (*1*) corresponds to the bottom (top). If set to a y axis ID followed by *domain* (separated by a space), the position behaves like for *paper*, but refers to the distance in fractions of the domain length from the bottom of the domain of that axis: e.g., *y2 domain* refers to the domain of the second y axis and a y position of 0.5 refers to the point between the bottom and the top of the domain of the second y axis. If an array of axis IDs is provided, each `y` value will refer to the corresponding axis, e.g., ['y', 'y2'] for a rectangle, line, or circle means `y0` uses the `y` axis and `y1` uses the `y2` axis. Path shapes using an array should have one entry for each y coordinate in the string.",
99599959
"editType": "calc",
99609960
"valType": "enumerated",
99619961
"values": [
@@ -9969,7 +9969,7 @@
99699969
"valType": "string"
99709970
},
99719971
"ysizemode": {
9972-
"description": "Sets the shapes's sizing mode along the y axis. If set to *scaled*, `y0`, `y1` and y coordinates within `path` refer to data values on the y axis or a fraction of the plot area's height (`yref` set to *paper*). If set to *pixel*, `yanchor` specifies the y position in terms of data or plot fraction but `y0`, `y1` and y coordinates within `path` are pixels relative to `yanchor`. This way, the shape can have a fixed height while maintaining a position relative to data or plot fraction.",
9972+
"description": "Sets the shapes's sizing mode along the y axis. If set to *scaled*, `y0`, `y1` and y coordinates within `path` refer to data values on the y axis or a fraction of the plot area's height (`yref` set to *paper*). If set to *pixel*, `yanchor` specifies the y position in terms of data or plot fraction but `y0`, `y1` and y coordinates within `path` are pixels relative to `yanchor`. This way, the shape can have a fixed height while maintaining a position relative to data or plot fraction. Note: *pixel* mode is not supported when `yref` is an array.",
99739973
"dflt": "scaled",
99749974
"editType": "calc+arraydraw",
99759975
"valType": "enumerated",

0 commit comments

Comments
 (0)