Skip to content

Commit e6a389d

Browse files
committed
adjust default colorbar title font to use bigger font
1 parent b08caf7 commit e6a389d

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

src/components/colorbar/defaults.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,19 @@ module.exports = function colorbarDefaults(containerIn, containerOut, layout) {
4848

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

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

5859
coerce('title.text', layout._dfltTitle.colorbar);
59-
Lib.coerceFont(coerce, 'title.font', layout.font);
60+
61+
var dfltTitleFont = Lib.extendFlat({}, font, {
62+
size: Lib.bigFont(font.size)
63+
});
64+
Lib.coerceFont(coerce, 'title.font', dfltTitleFont);
6065
coerce('title.side');
6166
};

test/jasmine/tests/histogram2d_test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ describe('Test histogram2d', function() {
1818

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

2223
return supplyDefaultsRaw(traceIn, traceOut, defaultColor, layout);
2324
}

test/jasmine/tests/mesh3d_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('Test mesh3d', function() {
1010

1111
describe('supplyDefaults', function() {
1212
var defaultColor = '#444';
13-
var layout = {_dfltTitle: {colorbar: 'cb'}};
13+
var layout = {_dfltTitle: {colorbar: 'cb'}, font: {size: 12}};
1414

1515
var traceIn, traceOut;
1616

test/jasmine/tests/surface_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('Test surface', function() {
1010

1111
describe('supplyDefaults', function() {
1212
var defaultColor = '#444';
13-
var layout = {_dfltTitle: {colorbar: 'cb'}};
13+
var layout = {_dfltTitle: {colorbar: 'cb'}, font: {size: 12}};
1414

1515
var traceIn, traceOut;
1616

0 commit comments

Comments
 (0)