-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
introduce group scatter attributes #6381
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 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a1f876a
introduce group scattermode attributes
archmoj fca1c11
drop scattergroupgap
archmoj f10b777
Merge remote-tracking branch 'origin/master' into group-scattermode
archmoj cc99d18
add group positioning options to scatter
archmoj 918068d
add mock using alignmentgroup and offsetgroup
archmoj e98f3c6
draft log for PR 6381
archmoj 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
'use strict'; | ||
|
||
|
||
module.exports = { | ||
scattermode: { | ||
valType: 'enumerated', | ||
values: ['group', 'overlay'], | ||
dflt: 'overlay', | ||
editType: 'calc', | ||
description: [ | ||
'Determines how scatter points at the same location coordinate', | ||
'are displayed on the graph.', | ||
'With *group*, the scatter points are plotted next to one another', | ||
'centered around the shared location.', | ||
'With *overlay*, the scatter points are plotted over one another,', | ||
'you might need to reduce *opacity* to see multiple scatter points.' | ||
].join(' ') | ||
}, | ||
scattergap: { | ||
valType: 'number', | ||
min: 0, | ||
max: 1, | ||
editType: 'calc', | ||
description: [ | ||
'Sets the gap (in plot fraction) between scatter points of', | ||
'adjacent location coordinates.', | ||
'Defaults to `bargap`.' | ||
].join(' ') | ||
}, | ||
scattergroupgap: { | ||
valType: 'number', | ||
min: 0, | ||
max: 1, | ||
dflt: 0, | ||
editType: 'calc', | ||
description: [ | ||
'Sets the gap (in plot fraction) between scatter points of', | ||
'the same location coordinate.' | ||
].join(' ') | ||
} | ||
}; |
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,18 @@ | ||
'use strict'; | ||
|
||
var Lib = require('../../lib'); | ||
|
||
var layoutAttributes = require('./layout_attributes'); | ||
|
||
module.exports = function(layoutIn, layoutOut) { | ||
function coerce(attr, dflt) { | ||
return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt); | ||
} | ||
|
||
var groupBarmode = layoutOut.barmode === 'group'; | ||
|
||
if(layoutOut.scattermode === 'group') { | ||
coerce('scattergap', groupBarmode ? layoutOut.bargap : 0.2); | ||
coerce('scattergroupgap'); | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,31 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"mode": "markers+lines+text", | ||
"texttemplate": "x:%{x}", | ||
"textposition": "bottom center", | ||
"textfont": { "size": 16 }, | ||
"y": [ | ||
1, | ||
3, | ||
2 | ||
] | ||
}, | ||
{ | ||
"mode": "markers+lines+text", | ||
"texttemplate": "x:%{x}", | ||
"textposition": "bottom center", | ||
"textfont": { "size": 16 }, | ||
"y": [ | ||
2, | ||
1, | ||
3 | ||
] | ||
} | ||
], | ||
"layout": { | ||
"width": 600, | ||
"height": 400, | ||
"scattermode": "group" | ||
} | ||
} |
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,35 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"x": [ | ||
"giraffes", | ||
"orangutans", | ||
"monkeys" | ||
], | ||
"y": [ | ||
20, | ||
14, | ||
23 | ||
], | ||
"name": "SF Zoo" | ||
}, | ||
{ | ||
"x": [ | ||
"giraffes", | ||
"orangutans", | ||
"monkeys" | ||
], | ||
"y": [ | ||
12, | ||
18, | ||
29 | ||
], | ||
"name": "LA Zoo" | ||
} | ||
], | ||
"layout": { | ||
"width": 600, | ||
"height": 400, | ||
"scattermode": "group" | ||
} | ||
} |
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
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.
Uh oh!
There was an error while loading. Please reload this page.