Skip to content

Commit 5045067

Browse files
committed
split axesAttrs inheritence for title.text and title.font
... so that we can add other `title.*` to cartesian axes w/o breaking other subplots
1 parent 47fcc1e commit 5045067

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

src/plots/gl3d/layout/axis_attributes.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ module.exports = overrideAll({
7171
color: axesAttrs.color,
7272
categoryorder: axesAttrs.categoryorder,
7373
categoryarray: axesAttrs.categoryarray,
74-
title: axesAttrs.title,
74+
title: {
75+
text: axesAttrs.title.text,
76+
font: axesAttrs.title.font
77+
},
7578
type: extendFlat({}, axesAttrs.type, {
7679
values: ['-', 'linear', 'log', 'date', 'category']
7780
}),

src/plots/polar/layout_attributes.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,17 @@ var radialAxisAttrs = {
114114
},
115115

116116

117-
title: overrideAll(axesAttrs.title, 'plot', 'from-root'),
118-
// might need a 'titleside' and even 'titledirection' down the road
117+
title: {
118+
// radial title is not gui-editable at the moment,
119+
// so it needs dflt: '', similar to carpet axes.
120+
text: extendFlat({}, axesAttrs.title.text, {editType: 'plot', dflt: ''}),
121+
font: extendFlat({}, axesAttrs.title.font, {editType: 'plot'}),
122+
123+
// TODO
124+
// - might need a 'titleside' and even 'titledirection' down the road
125+
126+
editType: 'plot'
127+
},
119128

120129
hoverformat: axesAttrs.hoverformat,
121130

@@ -138,9 +147,6 @@ var radialAxisAttrs = {
138147
}
139148
};
140149

141-
// radial title is not gui-editable, so it needs dflt: '', similar to carpet axes.
142-
radialAxisAttrs.title.text.dflt = '';
143-
144150
extendFlat(
145151
radialAxisAttrs,
146152

src/plots/ternary/layout_attributes.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ var overrideAll = require('../../plot_api/edit_types').overrideAll;
1616
var extendFlat = require('../../lib/extend').extendFlat;
1717

1818
var ternaryAxesAttrs = {
19-
title: axesAttrs.title,
19+
title: {
20+
text: axesAttrs.title.text,
21+
font: axesAttrs.title.font
22+
},
2023
color: axesAttrs.color,
2124
// ticks
2225
tickmode: axesAttrs.tickmode,

0 commit comments

Comments
 (0)