Skip to content

Commit 2494c4e

Browse files
committed
use containerOut._template for axis template
1 parent e350dd0 commit 2494c4e

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

src/plots/cartesian/axis_defaults.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
5151

5252
var visible = coerce('visible', !options.visibleDflt);
5353

54-
var axType = containerOut.type || options.axTemplate.type || '-';
54+
var axTemplate = containerOut._template || {};
55+
var axType = containerOut.type || axTemplate.type || '-';
5556

5657
if(axType === 'date') {
5758
var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleDefaults');
@@ -125,8 +126,7 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
125126
}
126127

127128
if(axType === 'date') {
128-
var fromTemplate = (options.axTemplate || {}).rangebreaks;
129-
var rangebreaks = containerIn.rangebreaks || fromTemplate;
129+
var rangebreaks = containerIn.rangebreaks || axTemplate.rangebreaks;
130130

131131
if(Array.isArray(rangebreaks) && rangebreaks.length) {
132132
handleArrayContainerDefaults(containerIn, containerOut, {

src/plots/cartesian/layout_defaults.js

-12
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
230230
axHasImage[axName]
231231
));
232232

233-
var axTemplate;
234-
if(Lib.isPlainObject(layoutOut._template)) {
235-
axTemplate = layoutOut._template[axLayoutOut._name];
236-
}
237-
238233
var defaultOptions = {
239-
axTemplate: axTemplate || {},
240234
letter: axLetter,
241235
font: layoutOut.font,
242236
outerTicks: outerTicks[axName],
@@ -301,13 +295,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
301295
axLayoutOut = Template.newContainer(layoutOut, axName, axLetter + 'axis');
302296
newAxLayoutOut();
303297

304-
var axTemplate2;
305-
if(Lib.isPlainObject(layoutOut._template)) {
306-
axTemplate2 = layoutOut._template[axLayoutOut._name];
307-
}
308-
309298
var defaultOptions2 = {
310-
axTemplate: axTemplate2 || {},
311299
letter: axLetter,
312300
font: layoutOut.font,
313301
outerTicks: outerTicks[axName],

src/plots/cartesian/tick_label_defaults.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ function handleOtherDefaults(containerIn, containerOut, coerce, axType, options)
5959

6060
if(axType !== 'category') {
6161
var tickFormat = coerce('tickformat');
62-
var fromTemplate = (options.axTemplate || {}).tickformatstops;
63-
var tickformatStops = containerIn.tickformatstops || fromTemplate;
62+
63+
var axTemplate = containerOut._template || {};
64+
var tickformatStops = containerIn.tickformatstops || axTemplate.tickformatstops;
6465

6566
if(Array.isArray(tickformatStops) && tickformatStops.length) {
6667
handleArrayContainerDefaults(containerIn, containerOut, {

0 commit comments

Comments
 (0)