Skip to content
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

Multi-axis-type sploms #2899

Merged
merged 13 commits into from
Aug 15, 2018
Merged
Binary file added test/image/baselines/splom_multi-axis-type.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions test/image/mocks/splom_multi-axis-type.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"data": [
{
"type": "splom",
"opacity": 0.9,
"showupperhalf": false,
"diagonal": {"visible": false },
"dimensions": [
{
"label": "numeric",
"values": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
},
{
"label": "decimal",
"values": [-3.3, 2.2, -1.1, 0, 1.1, -2.2, 3.3, 4.4, -5, 6]
},
{
"label": "bool",
"values": [false, true, true, true, false, true, false, false, false, true]
},
{
"label": "0/1",
"values": [0, 1, 1, 1, 1, 1, 0, 0, 0, 0]
},
{
"label": "string",
"values": ["lyndon", "richard", "gerald", "jimmy", "ronald", "george", "bill", "georgeW", "barack", "donald"]
}
]
}
],
"layout": {
"hovermode": "closest",
"margin": {
"b": 80,
"l": 80,
"r": 30,
"t": 30
},
"yaxis2": {"type": "category"},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This here might be tricky to find for users as e.g. nothing indicates that yaxis2 corresponds to the boolean data array.

Perhaps we could include this in the trace dimensions[i] containers?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could include this in the trace dimensions[i] containers?

That's a great idea - dimension.type = 'category' to override the autotype for both axes. That would certainly reduce (though not eliminate) the chance of mismatches like #2899 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with dimensions[i].axis.type in 39b71bb

I'm thinking the extra container might make it cleaner if we add more "splom-generated-axis" settings e.g. I suspect some users would want to set dimensions[i].axis.showgrid: false

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha exactly my rationale in #2899 (comment) - I should read all your comments before making my own. Anyway, love it.

"yaxis3": {"type": "category"},
"xaxis3": {"type": "category"},
"xaxis4": {"type": "category"}
}
}