8000 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
adjust default colorbar title font to use bigger font
  • Loading branch information
archmoj committed May 3, 2021
commit e6a389d870fabf3490dbffffbe4f8e364bbe67d0
9 changes: 7 additions & 2 deletions src/components/colorbar/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,19 @@ module.exports = function colorbarDefaults(containerIn, containerOut, layout) {

handleTickValueDefaults(colorbarIn, colorbarOut, coerce, 'linear');

var opts = {outerTicks: false, font: layout.font};
var font = layout.font;
var opts = {outerTicks: false, font: font};
if(ticklabelposition.indexOf('inside') !== -1) {
opts.bgColor = 'black'; // could we instead use the average of colors in the scale?
}
handleTickLabelDefaults(colorbarIn, colorbarOut, coerce, 'linear', opts);
handleTickMarkDefaults(colorbarIn, colorbarOut, coerce, 'linear', opts);

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

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

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

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'}};
var layout = {_dfltTitle: {colorbar: 'cb'}, font: {size: 12}};

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'}};
var layout = {_dfltTitle: {colorbar: 'cb'}, font: {size: 12}};

var traceIn, traceOut;

Expand Down
0