Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 14bded3

Browse files
committed
fill violin attribute descriptions + fix typo in comment
1 parent e625c44 commit 14bded3

File tree

2 files changed

+47
-13
lines changed

2 files changed

+47
-13
lines changed

src/lib/geometry2d.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ exports.findPointOnPath = function findPointOnPath(path, val, coord, opts) {
214214
var iterationLimit = opts.iterationLimit || 30;
215215

216216
// if path starts at a val greater than the path tail (like on vertical violins),
217-
// we must flip the sign of the compute diff.
217+
// we must flip the sign of the computed diff.
218218
var mul = path.getPointAtLength(0)[coord] > path.getPointAtLength(pathLength)[coord] ? -1 : 1;
219219

220220
var i = 0;

src/traces/violin/attributes.js

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,33 @@ module.exports = {
118118
},
119119
fillcolor: boxAttrs.fillcolor,
120120

121-
// TODO update description
122-
points: boxAttrs.boxpoints,
123-
jitter: boxAttrs.jitter,
124-
pointpos: boxAttrs.pointpos,
121+
points: extendFlat({}, boxAttrs.boxpoints, {
122+
description: [
123+
'If *outliers*, only the sample points lying outside the whiskers',
124+
'are shown',
125+
'If *suspectedoutliers*, the outlier points are shown and',
126+
'points either less than 4*Q1-3*Q3 or greater than 4*Q3-3*Q1',
127+
'are highlighted (see `outliercolor`)',
128+
'If *all*, all sample points are shown',
129+
'If *false*, only the violins are shown with no sample points'
130+
].join(' ')
131+
}),
132+
jitter: extendFlat({}, boxAttrs.jitter, {
133+
description: [
134+
'Sets the amount of jitter in the sample points drawn.',
135+
'If *0*, the sample points align along the distribution axis.',
136+
'If *1*, the sample points are drawn in a random jitter of width',
137+
'equal to the width of the violins.'
138+
].join(' ')
139+
}),
140+
pointpos: extendFlat({}, boxAttrs.pointpos, {
141+
description: [
142+
'Sets the position of the sample points in relation to the violins.',
143+
'If *0*, the sample points are places over the center of the violins.',
144+
'Positive (negative) values correspond to positions to the',
145+
'right (left) for vertical violins and above (below) for horizontal violins.'
146+
].join(' ')
147+
}),
125148
marker: boxAttrs.marker,
126149
text: boxAttrs.text,
127150

@@ -130,7 +153,9 @@ module.exports = {
130153
dflt: false,
131154
role: 'info',
132155
editType: 'plot',
133-
description: '.'
156+
description: [
157+
'Determines if an miniature box plot is drawn inside the violins. '
158+
].join(' ')
134159
},
135160
innerboxwidth: {
136161
valType: 'number',
@@ -139,47 +164,56 @@ module.exports = {
139164
dflt: 0.25,
140165
role: 'info',
141166
editType: 'plot',
142-
description: '...'
167+
description: [
168+
'Sets the width of the inner box plots relative to',
169+
'the violins\' width.',
170+
'For example, with 1, the inner box plots are as wide as the violins.'
171+
].join(' ')
143172
},
144173
innerboxlinecolor: {
145174
valType: 'color',
146175
role: 'style',
147176
editType: 'style',
148-
description: ''
177+
description: 'Sets the inner box plot bounding line color.'
149178
},
150179
innerboxfillcolor: {
151180
valType: 'color',
152181
role: 'style',
153182
editType: 'style',
154-
description: ''
183+
description: 'Sets the inner box plot fill color.'
155184
},
156185
innerboxlinewidth: {
157186
valType: 'number',
158187
min: 0,
159188
role: 'style',
160189
editType: 'style',
161-
description: ''
190+
description: 'Sets the inner box plot bounding line width.'
162191
},
163192

164193
showmeanline: {
165194
valType: 'boolean',
166195
dflt: false,
167196
role: 'info',
168197
editType: 'plot',
169-
description: 'Toggle'
198+
description: [
199+
'Determines if a line corresponding to the sample\'s mean is shown',
200+
'inside the violins.',
201+
'If `showinnerbox` is turned on, the mean line is drawn inside the inner box.',
202+
'Otherwise, the mean line is drawn from one side of the violin to other.'
203+
].join(' ')
170204
},
171205
meanlinecolor: {
172206
valType: 'color',
173207
role: 'style',
174208
editType: 'style',
175-
description: ''
209+
description: 'Sets the mean line color.'
176210
},
177211
meanlinewidth: {
178212
valType: 'number',
179213
min: 0,
180214
role: 'style',
181215
editType: 'style',
182-
description: ''
216+
description: 'Sets the mean line width.'
183217
},
184218

185219
side: {

0 commit comments

Comments
 (0)