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

Fix colorbar templating for "non-root" colorscales #4470

Merged
merged 4 commits into from
Jan 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/colorscale/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ module.exports = function colorScaleDefaults(parentContIn, parentContOut, layout
if(prefix && inTrace) showScaleDflt = hasColorbar(containerIn);

var showScale = coerce(prefix + 'showscale', showScaleDflt);
if(showScale) colorbarDefaults(containerIn, containerOut, layout);
if(showScale) {
if(prefix && template) containerOut._template = template;
colorbarDefaults(containerIn, containerOut, layout);
}
}
};
Binary file modified test/image/baselines/marker_colorscale_template.png
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.
Binary file modified test/image/baselines/treemap_coffee.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions test/image/compare_pixels_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ if(allMock || argv.filter) {
}

var FLAKY_LIST = [
'treemap_coffee',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

You can pick 0175108 to fix that.

'treemap_textposition',
'treemap_with-without_values_template',
'trace_metatext',
Expand Down
41 changes: 41 additions & 0 deletions test/image/mocks/parcats_colorscale_template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"data": [
{
"type": "parcats",
"line": {
"color": [ 0, 1, 1, 0, 1 ],
"showscale": true
},
"dimensions": [
{
"label": "Hair",
"values": [ "Black", "Black", "Black", "Brown", "Brown", "Brown", "Red", "Brown" ]
},
{
"label": "Eye",
"values": [ "Brown", "Brown", "Brown", "Brown", "Brown", "Blue", "Blue", "Blue" ]
},
{
"label": "Sex",
"values": [ "Female", "Female", "Female", "Male", "Female", "Male", "Male", "Male" ]
}
]
}
],
"layout": {
"template": {
"data": {
"parcats": [
{
"line": {
"colorscale": [[0, "red"], [1, "blue"]],
"colorbar": {
"ypad": 100
}
}
}
]
}
}
}
}