Skip to content

Commit 8a0f60a

Browse files
committed
improve descriptions
1 parent 332a0dd commit 8a0f60a

File tree

4 files changed

+110
-58
lines changed

4 files changed

+110
-58
lines changed

src/components/shapes/attributes.js

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ var shapeLabelTexttemplateVars = require('./label_texttemplate');
1313

1414
module.exports = templatedArray('shape', {
1515
visible: extendFlat({}, basePlotAttributes.visible, {
16-
editType: 'calc+arraydraw'
16+
editType: 'calc+arraydraw',
17+
description: [
18+
'Determines whether or not this shape is visible.',
19+
'If *legendonly*, the shape is not drawn,',
20+
'but can appear as a legend item',
21+
'(provided that the legend itself is visible).'
22+
].join(' ')
1723
}),
1824

1925
showlegend: {
@@ -27,11 +33,22 @@ module.exports = templatedArray('shape', {
2733
},
2834

2935
legend: extendFlat({}, basePlotAttributes.legend, {
30-
editType: 'calc+arraydraw'
36+
editType: 'calc+arraydraw',
37+
description: [
38+
'Sets the reference to a legend to show this shape in.',
39+
'References to these legends are *legend*, *legend2*, *legend3*, etc.',
40+
'Settings for these legends are set in the layout, under',
41+
'`layout.legend`, `layout.legend2`, etc.'
42+
].join(' ')
3143
}),
3244

3345
legendgroup: extendFlat({}, basePlotAttributes.legendgroup, {
34-
editType: 'calc+arraydraw'
46+
editType: 'calc+arraydraw',
47+
description: [
48+
'Sets the legend group for this shape.',
49+
'Traces and shapes part of the same legend group hide/show at the same time',
50+
'when toggling legend items.'
51+
].join(' ')
3552
}),
3653

3754
legendgrouptitle: {
@@ -48,11 +65,20 @@ module.exports = templatedArray('shape', {
4865
},
4966

5067
legendrank: extendFlat({}, basePlotAttributes.legendrank, {
51-
editType: 'calc+arraydraw'
68+
editType: 'calc+arraydraw',
69+
description: [
70+
'Sets the legend rank for this shape.',
71+
'Items and groups with smaller ranks are presented on top/left side while',
72+
'with *reversed* `legend.traceorder` they are on bottom/right side.',
73+
'The default legendrank is 1000,',
74+
'so that you can use ranks less than 1000 to place certain items before all unranked items,',
75+
'and ranks greater than 1000 to go after all unranked items.'
76+
].join(' ')
5277
}),
5378

5479
legendwidth: extendFlat({}, basePlotAttributes.legendwidth, {
55-
editType: 'calc+arraydraw'
80+
editType: 'calc+arraydraw',
81+
description: 'Sets the width (in px or fraction) of the legend for this shape.',
5682
}),
5783

5884
type: {

src/components/shapes/draw_newshape/attributes.js

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ var shapeLabelTexttemplateVars = require('../label_texttemplate');
1111
module.exports = {
1212
newshape: {
1313
visible: extendFlat({}, basePlotAttributes.visible, {
14-
editType: 'none'
14+
editType: 'none',
15+
description: [
16+
'Determines whether or not new shape is visible.',
17+
'If *legendonly*, the shape is not drawn,',
18+
'but can appear as a legend item',
19+
'(provided that the legend itself is visible).'
20+
].join(' ')
1521
}),
1622

1723
showlegend: {
@@ -25,11 +31,22 @@ module.exports = {
2531
},
2632

2733
legend: extendFlat({}, basePlotAttributes.legend, {
28-
editType: 'none'
34+
editType: 'none',
35+
description: [
36+
'Sets the reference to a legend to show new shape in.',
37+
'References to these legends are *legend*, *legend2*, *legend3*, etc.',
38+
'Settings for these legends are set in the layout, under',
39+
'`layout.legend`, `layout.legend2`, etc.'
40+
].join(' ')
2941
}),
3042

3143
legendgroup: extendFlat({}, basePlotAttributes.legendgroup, {
32-
editType: 'none'
44+
editType: 'none',
45+
description: [
46+
'Sets the legend group for new shape.',
47+
'Traces and shapes part of the same legend group hide/show at the same time',
48+
'when toggling legend items.'
49+
].join(' ')
3350
}),
3451

3552
legendgrouptitle: {
@@ -46,11 +63,20 @@ module.exports = {
4663
},
4764

4865
legendrank: extendFlat({}, basePlotAttributes.legendrank, {
49-
editType: 'none'
66+
editType: 'none',
67+
description: [
68+
'Sets the legend rank for new shape.',
69+
'Items and groups with smaller ranks are presented on top/left side while',
70+
'with *reversed* `legend.traceorder` they are on bottom/right side.',
71+
'The default legendrank is 1000,',
72+
'so that you can use ranks less than 1000 to place certain items before all unranked items,',
73+
'and ranks greater than 1000 to go after all unranked items.'
74+
].join(' ')
5075
}),
5176

5277
legendwidth: extendFlat({}, basePlotAttributes.legendwidth, {
53-
editType: 'none'
78+
editType: 'none',
79+
description: 'Sets the width (in px or fraction) of the legend for new shape.',
5480
}),
5581

5682
line: {

src/plots/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = {
5050
editType: 'style',
5151
description: [
5252
'Sets the legend group for this trace.',
53-
'Traces part of the same legend group hide/show at the same time',
53+
'Traces and shapes part of the same legend group hide/show at the same time',
5454
'when toggling legend items.'
5555
].join(' ')
5656
},

0 commit comments

Comments
 (0)