Skip to content

Commit e3bcf7c

Browse files
committed
Let '' be the default carpet axes title [882]
- Reason: having no default at all for `title.text` would lead to a non-existing `title` container (through a call to `relinkPrivateKeys` deep down the stack) eventually and as consequence would require to safeguard access to `[ab]axis.title.text` by checking `[abaxis.title]` is defined before.
1 parent ef9e078 commit e3bcf7c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/traces/carpet/axis_attributes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module.exports = {
3636
title: {
3737
text: {
3838
valType: 'string',
39+
dflt: '',
3940
role: 'info',
4041
editType: 'calc',
4142
description: [

src/traces/carpet/axis_defaults.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, options)
203203
// but no, we *actually* want to coerce this.
204204
coerce('tickmode');
205205

206+
if(!containerOut.title.text) {
207+
delete containerOut.title.font;
208+
delete containerOut.title.offset;
209+
}
210+
206211
return containerOut;
207212
};
208213

0 commit comments

Comments
 (0)