Skip to content

Commit 1bc95d5

Browse files
committed
swap showdiagonal -> diagonal.visible & better 📚
1 parent bb11313 commit 1bc95d5

File tree

2 files changed

+43
-19
lines changed

2 files changed

+43
-19
lines changed

src/traces/splom/attributes.js

+39-18
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ function makeAxesValObject(axLetter) {
2323
editType: 'plot'
2424
},
2525
description: [
26-
'..'
26+
'Sets the list of ' + axLetter + ' axes',
27+
'corresponding to this splom trace.',
28+
'By default, a splom will match the first N ' + axLetter + 'axes',
29+
'where N is the number of input dimensions.'
2730
].join(' ')
2831
};
2932
}
@@ -37,31 +40,32 @@ module.exports = {
3740
role: 'info',
3841
dflt: true,
3942
editType: 'calc',
40-
description: ''
43+
description: [
44+
'Determines whether or not this dimension is show on the graph.',
45+
'Note that even visible false dimension contribute to the',
46+
'default grid generate by this splom trace.'
47+
].join(' ')
4148
},
4249
label: {
4350
valType: 'string',
4451
role: 'info',
4552
editType: 'calc',
46-
description: ''
53+
description: 'Sets the label corresponding to this splom dimension.'
4754
},
4855
values: {
4956
valType: 'data_array',
5057
role: 'info',
5158
editType: 'calc+clearAxisTypes',
52-
description: [
53-
''
54-
].join(' ')
59+
description: 'Sets the dimension values to be plotted.'
5560
},
5661

5762
// TODO should add an attribute to pin down x only vars and y only vars
5863
// like https://seaborn.pydata.org/generated/seaborn.pairplot.html
5964
// x_vars and y_vars
6065

61-
editType: 'calc+clearAxisTypes',
62-
description: [
63-
'..'
64-
].join(' ')
66+
// maybe more axis defaulting option e.g. `showgrid: false`
67+
68+
editType: 'calc+clearAxisTypes'
6569
},
6670

6771
mode: scatterGlAttrs.mode,
@@ -75,26 +79,43 @@ module.exports = {
7579
xaxes: makeAxesValObject('x'),
7680
yaxes: makeAxesValObject('y'),
7781

78-
showdiagonal: {
79-
valType: 'boolean',
80-
role: 'info',
81-
dflt: true,
82-
editType: 'plot',
83-
description: ''
82+
diagonal: {
83+
visible: {
84+
valType: 'boolean',
85+
role: 'info',
86+
dflt: true,
87+
editType: 'plot',
88+
description: [
89+
'Determines whether or not subplots on the diagonal are displayed.'
90+
].join(' ')
91+
},
92+
93+
// type: 'scattergl' | 'histogram' | 'box' | 'violin'
94+
// ...
95+
// more options
96+
97+
editType: 'plot'
8498
},
99+
85100
showupperhalf: {
86101
valType: 'boolean',
87102
role: 'info',
88103
dflt: true,
89104
editType: 'plot',
90-
description: ''
105+
description: [
106+
'Determines whether or not subplots on the upper half',
107+
'from the diagonal are displayed.'
108+
].join(' ')
91109
},
92110
showlowerhalf: {
93111
valType: 'boolean',
94112
role: 'info',
95113
dflt: true,
96114
editType: 'plot',
97-
description: ''
115+
description: [
116+
'Determines whether or not subplots on the lower half',
117+
'from the diagonal are displayed.'
118+
].join(' ')
98119
},
99120

100121
selected: scatterGlAttrs.selected,

src/traces/splom/defaults.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
5050
handleAxisDefaults(traceIn, traceOut, layout, coerce);
5151

5252
// TODO not implemented yet
53-
coerce('showdiagonal');
53+
coerce('diagonal.visible');
54+
// more to come
55+
56+
// TODO not implemented yet
5457
coerce('showupperhalf');
5558
coerce('showlowerhalf');
5659

0 commit comments

Comments
 (0)