Skip to content

Commit ab7d9c6

Browse files
committed
bring handleTypeDefaults api on-par
... with other sub-supply-defaults routines
1 parent 9039a8e commit ab7d9c6

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

src/plots/cartesian/layout_defaults.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
157157
axLayoutOut._annIndices = [];
158158
axLayoutOut._shapeIndices = [];
159159

160-
handleTypeDefaults(axLayoutIn, axLayoutOut, coerce, traces, axName);
160+
// set up some private properties
161+
axLayoutOut._name = axName;
162+
var id = axLayoutOut._id = name2id(axName);
161163

162164
var overlayableAxes = getOverlayableAxes(axLetter, axName);
163165

@@ -173,6 +175,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
173175
cheateronly: axLetter === 'x' && xaCheater[axName] && !xaNonCheater[axName]
174176
};
175177

178+
handleTypeDefaults(axLayoutIn, axLayoutOut, coerce, defaultOptions);
176179
handleAxisDefaults(axLayoutIn, axLayoutOut, coerce, defaultOptions, layoutOut);
177180

178181
var spikecolor = coerce2('spikecolor'),

src/plots/cartesian/type_defaults.js

+3-10
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,20 @@
1111

1212
var Registry = require('../../registry');
1313
var autoType = require('./axis_autotype');
14-
var name2id = require('./axis_ids').name2id;
1514

1615
/*
1716
* data: the plot data to use in choosing auto type
1817
* name: axis object name (ie 'xaxis') if one should be stored
1918
*/
20-
module.exports = function handleTypeDefaults(containerIn, containerOut, coerce, data, name) {
21-
// set up some private properties
22-
if(name) {
23-
containerOut._name = name;
24-
containerOut._id = name2id(name);
25-
}
19+
module.exports = function handleTypeDefaults(containerIn, containerOut, coerce, options) {
2620

2721
var axType = coerce('type');
2822
if(axType === '-') {
29-
setAutoType(containerOut, data);
23+
setAutoType(containerOut, options.data);
3024

3125
if(containerOut.type === '-') {
3226
containerOut.type = 'linear';
33-
}
34-
else {
27+
} else {
3528
// copy autoType back to input axis
3629
// note that if this object didn't exist
3730
// in the input layout, we have to put it in

src/plots/gl3d/layout/axis_defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, options) {
3939
containerOut._id = axName[0] + options.scene;
4040
containerOut._name = axName;
4141

42-
handleTypeDefaults(containerIn, containerOut, coerce, options.data);
42+
handleTypeDefaults(containerIn, containerOut, coerce, options);
4343

4444
handleAxisDefaults(
4545
containerIn,

0 commit comments

Comments
 (0)