-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Adding box plots drawn on std-deviation instead of quartiles #6698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
7241716
First push
28raining fe3d2d0
Adding draftlog
28raining 923df18
Create sizemode after fb in pull 6698
28raining b0868e5
Fix failing translate string
28raining 3e1319e
Updating schema
28raining 0e9d5a6
generate correct baseline. Use .replace to keep var in translated string
28raining 29c813f
re-add whiskers to violin plots
28raining 6ea8d6d
Update src/traces/box/plot.js
28raining c3f9ea7
reverting jasmine test
28raining d7e2f1b
Merge branch 'dev-box-sigma-boxes' of https://github.com/28raining/pl…
28raining 4e4b486
Change whisker default if sizemode=='sd'
28raining b3812f8
add showwhiskers to candlestick
28raining 505a14e
if sizemode === quartiles, don't use boxmean
28raining 3a3b46c
Update description for whisker default behavior
28raining 44e1355
roll back candelstick and violin changes
28raining edfa543
simplify sizemode usage
28raining a48f2ce
fix lint
28raining 66dcba7
update schema
28raining 013f4d3
roll back violin further
28raining 1668fe9
rolled back contributing
28raining f84e93f
selectively coerce sdmultiple
28raining File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Add [1-6]-sigma (std deviations) box plots as an alternative to quartiles [[#6697](https://github.com/plotly/plotly.js/issues/6697)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,7 +218,30 @@ module.exports = { | |
'right (left) for vertical boxes and above (below) for horizontal boxes' | ||
].join(' ') | ||
}, | ||
|
||
sdmultiple: { | ||
valType: 'number', | ||
min: 0, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't the minimum be one instead of zero? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what if you want 0.5σ? Might be weird but I don't see a reason to prohibit it. |
||
editType: 'calc', | ||
dflt: 1, | ||
description: [ | ||
'Scales the box size when sizemode=sd', | ||
'Allowing boxes to be drawn across any stddev range', | ||
'For example 1-stddev, 3-stddev, 5-stddev', | ||
].join(' ') | ||
}, | ||
sizemode: { | ||
valType: 'enumerated', | ||
values: ['quartiles', 'sd'], | ||
editType: 'calc', | ||
dflt: 'quartiles', | ||
description: [ | ||
'Sets the upper and lower bound for the boxes', | ||
'quartiles means box is drawn between Q1 and Q3', | ||
'SD means the box is drawn between Mean +- Standard Deviation', | ||
'Argument sdmultiple (default 1) to scale the box size', | ||
'So it could be drawn 1-stddev, 3-stddev etc', | ||
].join(' ') | ||
}, | ||
boxmean: { | ||
valType: 'enumerated', | ||
values: [true, 'sd', false], | ||
|
@@ -378,6 +401,15 @@ module.exports = { | |
].join(' ') | ||
}, | ||
|
||
showwhiskers: { | ||
valType: 'boolean', | ||
dflt: true, | ||
editType: 'calc', | ||
description: [ | ||
'Determines whether or not whiskers are visible' | ||
28raining marked this conversation as resolved.
Show resolved
Hide resolved
|
||
].join(' ') | ||
}, | ||
|
||
offsetgroup: barAttrs.offsetgroup, | ||
alignmentgroup: barAttrs.alignmentgroup, | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
{ | ||
28raining marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"data": [ | ||
{ | ||
"y": [ | ||
0.4995, 0.3786, 0.5188, 0.4505, 0.5805, 0.5539, 0.7341, 0.3303, 0.6202, 0.4754, 0.4814, 0.6103, 0.5157, 0.3841, 0.6166, 0.4917, 0.5646, 0.4532, 0.5983, | ||
0.5079, 0.5227, 0.5483, 0.3081, 0.5172, 0.4127, 0.3871, 0.4703, 0.5331, 0.4573, 0.6187, 0.5718, 0.4474, 0.5349, 0.4614, 0.3096, 0.4411, 0.7143, 0.5956, | ||
0.5171, 0.5515, 0.4234, 0.4589, 0.4289, 0.417, 0.4229, 0.5039, 0.4726, 0.5382, 0.261, 0.5326, 0.4472, 0.54, 0.4998, 0.5513, 0.3891, 0.4821, 0.5006, | ||
0.4362, 0.4184, 0.3632, 0.5182, 0.5229, 0.5493, 0.507, 0.4528, 0.4836, 0.5009, 0.49, 0.5757, 0.5408, 0.4246, 0.511, 0.5216, 0.3817, 0.4471, 0.4935, | ||
0.5668, 0.3187, 0.3633, 0.5964, 0.637, 0.4701, 0.4292, 0.4921, 0.439, 0.5846, 0.4502, 0.44, 0.3057, 0.4756, 0.4867, 0.502, 0.438, 0.6819, 0.2607, | ||
0.5233, 0.3291, 0.5555, 0.5397, 0.5068 | ||
], | ||
"line": { | ||
"color": "#1c9099" | ||
}, | ||
"type": "box", | ||
"boxpoints": "all", | ||
"pointpos": 0, | ||
"name": "1-sigma", | ||
"sizemode": "sd", | ||
"showwhiskers": false | ||
}, | ||
{ | ||
"y": [ | ||
0.4995, 0.3786, 0.5188, 0.4505, 0.5805, 0.5539, 0.7341, 0.3303, 0.6202, 0.4754, 0.4814, 0.6103, 0.5157, 0.3841, 0.6166, 0.4917, 0.5646, 0.4532, 0.5983, | ||
0.5079, 0.5227, 0.5483, 0.3081, 0.5172, 0.4127, 0.3871, 0.4703, 0.5331, 0.4573, 0.6187, 0.5718, 0.4474, 0.5349, 0.4614, 0.3096, 0.4411, 0.7143, 0.5956, | ||
0.5171, 0.5515, 0.4234, 0.4589, 0.4289, 0.417, 0.4229, 0.5039, 0.4726, 0.5382, 0.261, 0.5326, 0.4472, 0.54, 0.4998, 0.5513, 0.3891, 0.4821, 0.5006, | ||
0.4362, 0.4184, 0.3632, 0.5182, 0.5229, 0.5493, 0.507, 0.4528, 0.4836, 0.5009, 0.49, 0.5757, 0.5408, 0.4246, 0.511, 0.5216, 0.3817, 0.4471, 0.4935, | ||
0.5668, 0.3187, 0.3633, 0.5964, 0.637, 0.4701, 0.4292, 0.4921, 0.439, 0.5846, 0.4502, 0.44, 0.3057, 0.4756, 0.4867, 0.502, 0.438, 0.6819, 0.2607, | ||
0.5233, 0.3291, 0.5555, 0.5397, 0.5068 | ||
], | ||
"line": { | ||
"color": "#1c9099" | ||
}, | ||
"boxpoints": "all", | ||
"pointpos": 0, | ||
"type": "box", | ||
"name": "2-sigma", | ||
"sdmultiple" : 2, | ||
"sizemode": "sd", | ||
"showwhiskers": false | ||
}, | ||
{ | ||
"y": [ | ||
0.4995, 0.3786, 0.5188, 0.4505, 0.5805, 0.5539, 0.7341, 0.3303, 0.6202, 0.4754, 0.4814, 0.6103, 0.5157, 0.3841, 0.6166, 0.4917, 0.5646, 0.4532, 0.5983, | ||
0.5079, 0.5227, 0.5483, 0.3081, 0.5172, 0.4127, 0.3871, 0.4703, 0.5331, 0.4573, 0.6187, 0.5718, 0.4474, 0.5349, 0.4614, 0.3096, 0.4411, 0.7143, 0.5956, | ||
0.5171, 0.5515, 0.4234, 0.4589, 0.4289, 0.417, 0.4229, 0.5039, 0.4726, 0.5382, 0.261, 0.5326, 0.4472, 0.54, 0.4998, 0.5513, 0.3891, 0.4821, 0.5006, | ||
0.4362, 0.4184, 0.3632, 0.5182, 0.5229, 0.5493, 0.507, 0.4528, 0.4836, 0.5009, 0.49, 0.5757, 0.5408, 0.4246, 0.511, 0.5216, 0.3817, 0.4471, 0.4935, | ||
0.5668, 0.3187, 0.3633, 0.5964, 0.637, 0.4701, 0.4292, 0.4921, 0.439, 0.5846, 0.4502, 0.44, 0.3057, 0.4756, 0.4867, 0.502, 0.438, 0.6819, 0.2607, | ||
0.5233, 0.3291, 0.5555, 0.5397, 0.5068 | ||
], | ||
"line": { | ||
"color": "#1c9099" | ||
}, | ||
"type": "box", | ||
"boxpoints": "all", | ||
"pointpos": 0, | ||
"name": "3-sigma", | ||
"sdmultiple" : 3, | ||
"sizemode": "sd", | ||
"showwhiskers": false | ||
}, | ||
{ | ||
"y": [ | ||
0.4995, 0.3786, 0.5188, 0.4505, 0.5805, 0.5539, 0.7341, 0.3303, 0.6202, 0.4754, 0.4814, 0.6103, 0.5157, 0.3841, 0.6166, 0.4917, 0.5646, 0.4532, 0.5983, | ||
0.5079, 0.5227, 0.5483, 0.3081, 0.5172, 0.4127, 0.3871, 0.4703, 0.5331, 0.4573, 0.6187, 0.5718, 0.4474, 0.5349, 0.4614, 0.3096, 0.4411, 0.7143, 0.5956, | ||
0.5171, 0.5515, 0.4234, 0.4589, 0.4289, 0.417, 0.4229, 0.5039, 0.4726, 0.5382, 0.261, 0.5326, 0.4472, 0.54, 0.4998, 0.5513, 0.3891, 0.4821, 0.5006, | ||
0.4362, 0.4184, 0.3632, 0.5182, 0.5229, 0.5493, 0.507, 0.4528, 0.4836, 0.5009, 0.49, 0.5757, 0.5408, 0.4246, 0.511, 0.5216, 0.3817, 0.4471, 0.4935, | ||
0.5668, 0.3187, 0.3633, 0.5964, 0.637, 0.4701, 0.4292, 0.4921, 0.439, 0.5846, 0.4502, 0.44, 0.3057, 0.4756, 0.4867, 0.502, 0.438, 0.6819, 0.2607, | ||
0.5233, 0.3291, 0.5555, 0.5397, 0.5068 | ||
], | ||
"line": { | ||
"color": "#1c9099" | ||
}, | ||
"type": "box", | ||
"boxpoints": "all", | ||
"pointpos": 0, | ||
"name": "1-sigma + whiskers", | ||
"sizemode": "sd", | ||
"showwhiskers": true | ||
}, | ||
{ | ||
"y": [ | ||
0.4995, 0.3786, 0.5188, 0.4505, 0.5805, 0.5539, 0.7341, 0.3303, 0.6202, 0.4754, 0.4814, 0.6103, 0.5157, 0.3841, 0.6166, 0.4917, 0.5646, 0.4532, 0.5983, | ||
0.5079, 0.5227, 0.5483, 0.3081, 0.5172, 0.4127, 0.3871, 0.4703, 0.5331, 0.4573, 0.6187, 0.5718, 0.4474, 0.5349, 0.4614, 0.3096, 0.4411, 0.7143, 0.5956, | ||
0.5171, 0.5515, 0.4234, 0.4589, 0.4289, 0.417, 0.4229, 0.5039, 0.4726, 0.5382, 0.261, 0.5326, 0.4472, 0.54, 0.4998, 0.5513, 0.3891, 0.4821, 0.5006, | ||
0.4362, 0.4184, 0.3632, 0.5182, 0.5229, 0.5493, 0.507, 0.4528, 0.4836, 0.5009, 0.49, 0.5757, 0.5408, 0.4246, 0.511, 0.5216, 0.3817, 0.4471, 0.4935, | ||
0.5668, 0.3187, 0.3633, 0.5964, 0.637, 0.4701, 0.4292, 0.4921, 0.439, 0.5846, 0.4502, 0.44, 0.3057, 0.4756, 0.4867, 0.502, 0.438, 0.6819, 0.2607, | ||
0.5233, 0.3291, 0.5555, 0.5397, 0.5068 | ||
], | ||
"line": { | ||
"color": "#1c9099" | ||
}, | ||
"boxpoints": "all", | ||
"pointpos": 0, | ||
"type": "box", | ||
"name": "3-sigma + whiskers", | ||
"sdmultiple" : 3, | ||
"sizemode": "sd", | ||
"showwhiskers": true | ||
}, | ||
{ | ||
"y": [ | ||
0.4995, 0.3786, 0.5188, 0.4505, 0.5805, 0.5539, 0.7341, 0.3303, 0.6202, 0.4754, 0.4814, 0.6103, 0.5157, 0.3841, 0.6166, 0.4917, 0.5646, 0.4532, 0.5983, | ||
0.5079, 0.5227, 0.5483, 0.3081, 0.5172, 0.4127, 0.3871, 0.4703, 0.5331, 0.4573, 0.6187, 0.5718, 0.4474, 0.5349, 0.4614, 0.3096, 0.4411, 0.7143, 0.5956, | ||
0.5171, 0.5515, 0.4234, 0.4589, 0.4289, 0.417, 0.4229, 0.5039, 0.4726, 0.5382, 0.261, 0.5326, 0.4472, 0.54, 0.4998, 0.5513, 0.3891, 0.4821, 0.5006, | ||
0.4362, 0.4184, 0.3632, 0.5182, 0.5229, 0.5493, 0.507, 0.4528, 0.4836, 0.5009, 0.49, 0.5757, 0.5408, 0.4246, 0.511, 0.5216, 0.3817, 0.4471, 0.4935, | ||
0.5668, 0.3187, 0.3633, 0.5964, 0.637, 0.4701, 0.4292, 0.4921, 0.439, 0.5846, 0.4502, 0.44, 0.3057, 0.4756, 0.4867, 0.502, 0.438, 0.6819, 0.2607, | ||
0.5233, 0.3291, 0.5555, 0.5397, 0.5068 | ||
], | ||
"line": { | ||
"color": "#1c9099" | ||
}, | ||
"boxpoints": "all", | ||
"pointpos": 0, | ||
"type": "box", | ||
"name": "diamond 1-sigma", | ||
"boxmean": "sd", | ||
"showwhiskers": false | ||
}, | ||
{ | ||
"y": [ | ||
0.4995, 0.3786, 0.5188, 0.4505, 0.5805, 0.5539, 0.7341, 0.3303, 0.6202, 0.4754, 0.4814, 0.6103, 0.5157, 0.3841, 0.6166, 0.4917, 0.5646, 0.4532, 0.5983, | ||
0.5079, 0.5227, 0.5483, 0.3081, 0.5172, 0.4127, 0.3871, 0.4703, 0.5331, 0.4573, 0.6187, 0.5718, 0.4474, 0.5349, 0.4614, 0.3096, 0.4411, 0.7143, 0.5956, | ||
0.5171, 0.5515, 0.4234, 0.4589, 0.4289, 0.417, 0.4229, 0.5039, 0.4726, 0.5382, 0.261, 0.5326, 0.4472, 0.54, 0.4998, 0.5513, 0.3891, 0.4821, 0.5006, | ||
0.4362, 0.4184, 0.3632, 0.5182, 0.5229, 0.5493, 0.507, 0.4528, 0.4836, 0.5009, 0.49, 0.5757, 0.5408, 0.4246, 0.511, 0.5216, 0.3817, 0.4471, 0.4935, | ||
0.5668, 0.3187, 0.3633, 0.5964, 0.637, 0.4701, 0.4292, 0.4921, 0.439, 0.5846, 0.4502, 0.44, 0.3057, 0.4756, 0.4867, 0.502, 0.438, 0.6819, 0.2607, | ||
0.5233, 0.3291, 0.5555, 0.5397, 0.5068 | ||
], | ||
"line": { | ||
"color": "#1c9099" | ||
}, | ||
"boxpoints": "all", | ||
"pointpos": 0, | ||
"type": "box", | ||
"name": "diamond 3-sigma", | ||
"sdmultiple" : 3, | ||
"boxmean": "sd", | ||
"showwhiskers": false | ||
} | ||
], | ||
"layout": { | ||
"showlegend": false, | ||
"yaxis": { | ||
"title": { "text": "Random Variable" }, | ||
"type": "linear", | ||
"range":[-0.2, 1.2] | ||
}, | ||
"title": { "text": "Box plots drawn on std deviation instead of quartiles" }, | ||
"xaxis": { | ||
"type": "category" | ||
}, | ||
"height": 598, | ||
"width": 1080, | ||
"autosize": true | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In several cases adding new image tests are not necessary.
So this step should be optional and it could be part of
Step 6
.You may revert changes in
CONTRIBUTING.md
and possibly submit a separate PR to suggest improvements as well.Thank you!