Skip to content

Commit 1b2d978

Browse files
committed
make colorscale title font depend on colorbar.tickfont not layout.font
1 parent 4a3c68b commit 1b2d978

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

src/components/colorbar/defaults.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ module.exports = function colorbarDefaults(containerIn, containerOut, layout) {
5858

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

61-
var dfltTitleFont = Lib.extendFlat({}, font, {
62-
size: Lib.bigFont(font.size)
61+
var tickFont = colorbarOut.tickfont;
62+
var dfltTitleFont = Lib.extendFlat({}, tickFont, {
63+
color: font.color,
64+
size: Lib.bigFont(tickFont.size)
6365
});
6466
Lib.coerceFont(coerce, 'title.font', dfltTitleFont);
6567
coerce('title.side');

test/jasmine/tests/histogram2d_test.js

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

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

2323
return supplyDefaultsRaw(traceIn, traceOut, defaultColor, layout);
2424
}

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'}, font: {size: 12}};
13+
var layout = {_dfltTitle: {colorbar: 'cb'}, font: {color: '#444'}};
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'}, font: {size: 12}};
13+
var layout = {_dfltTitle: {colorbar: 'cb'}, font: {color: '#444'}};
1414

1515
var traceIn, traceOut;
1616

0 commit comments

Comments
 (0)