Skip to content

Commit

Permalink
Reverse coerce logic for carpet axes titles [882]
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoestl committed Nov 29, 2018
1 parent e3bcf7c commit 2b26746
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/traces/carpet/axis_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, options)
// inherit from global font color in case that was provided.
var dfltFontColor = (dfltColor === containerIn.color) ? dfltColor : font.color;

coerce('title.text');
Lib.coerceFont(coerce, 'title.font', {
family: font.family,
size: Math.round(font.size * 1.2),
color: dfltFontColor
});

coerce('title.offset');
var title = coerce('title.text');
if(title) {
Lib.coerceFont(coerce, 'title.font', {
family: font.family,
size: Math.round(font.size * 1.2),
color: dfltFontColor
});
coerce('title.offset');
}

coerce('tickangle');

Expand Down Expand Up @@ -203,11 +204,6 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, options)
// but no, we *actually* want to coerce this.
coerce('tickmode');

if(!containerOut.title.text) {
delete containerOut.title.font;
delete containerOut.title.offset;
}

return containerOut;
};

Expand Down

0 comments on commit 2b26746

Please sign in to comment.