10000 New defaults for colorbar.title.font and legend.title.font to depend on colorbar.tickfont and legend.font and increase their sizes by archmoj · Pull Request #5611 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

New defaults for colorbar.title.font and legend.title.font to depend on colorbar.tickfont and legend.font and increase their sizes #5611

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 13 commits into from
May 5, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
make colorscale title font depend on colorbar.tickfont not layout.font
  • Loading branch information
archmoj committed May 4, 2021
commit 1b2d978a6cc6507bea7cc4c9d3d56588eb6ebe97
6 changes: 4 additions & 2 deletions src/components/colorbar/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ module.exports = function colorbarDefaults(containerIn, containerOut, layout) {

coerce('title.text', layout._dfltTitle.colorbar);

var dfltTitleFont = Lib.extendFlat({}, font, {
size: Lib.bigFont(font.size)
var tickFont = colorbarOut.tickfont;
var dfltTitleFont = Lib.extendFlat({}, tickFont, {
color: font.color,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here the colorbar.title.font.color depends on layout.font not tickfont so that with inside ticklabels getting white, it renders outside using #444.

size: Lib.bigFont(tickFont.size)
});
Lib.coerceFont(coerce, 'title.font', dfltTitleFont);
coerce('title.side');
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/histogram2d_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Test histogram2d', function() {

function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
layout._dfltTitle = {colorbar: 'cb'};
layout.font = {size: 12};
layout.font = {color: '#444'};

return supplyDefaultsRaw(traceIn, traceOut, defaultColor, layout);
}
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/mesh3d_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('Test mesh3d', function() {

describe('supplyDefaults', function() {
var defaultColor = '#444';
var layout = {_dfltTitle: {colorbar: 'cb'}, font: {size: 12}};
var layout = {_dfltTitle: {colorbar: 'cb'}, font: {color: '#444'}};

var traceIn, traceOut;

Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/surface_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('Test surface', function() {

describe('supplyDefaults', function() {
var defaultColor = '#444';
var layout = {_dfltTitle: {colorbar: 'cb'}, font: {size: 12}};
var layout = {_dfltTitle: {colorbar: 'cb'}, font: {color: '#444'}};

var traceIn, traceOut;

Expand Down
0