diff --git a/src/plots/layout_attributes.js b/src/plots/layout_attributes.js index c6884a2f121..30a6fadb291 100644 --- a/src/plots/layout_attributes.js +++ b/src/plots/layout_attributes.js @@ -84,7 +84,9 @@ module.exports = { ].join(' ') }, y: { - valType: 'any', + valType: 'number', + min: 0, + max: 1, dflt: 'auto', role: 'style', editType: 'layoutstyle', diff --git a/src/plots/plots.js b/src/plots/plots.js index 9d7cc9f887f..0fd72fd7341 100644 --- a/src/plots/plots.js +++ b/src/plots/plots.js @@ -1315,19 +1315,6 @@ plots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut, formatObj) { return Lib.coerce(layoutIn, layoutOut, plots.layoutAttributes, attr, dflt); } - // Special treatment for title.y that can be 'auto' - // or a number between 0 and 1. - function coerceTitleY() { - if(layoutIn.title && isNumeric(layoutIn.title.y)) { - var propOut = Lib.nestedProperty(layoutOut, 'title.y'); - var opts = Lib.nestedProperty(plots.layoutAttributes, 'title.y').get(); - - Lib.valObjectMeta.number.coerceFunction(layoutIn.title.y, propOut, 'auto', opts); - } else { - coerce('title.y'); - } - } - var template = layoutIn.template; if(Lib.isPlainObject(template)) { layoutOut.template = template; @@ -1348,7 +1335,7 @@ plots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut, formatObj) { coerce('title.xref'); coerce('title.yref'); coerce('title.x'); - coerceTitleY(); + coerce('title.y'); coerce('title.xanchor'); coerce('title.yanchor'); coerce('title.pad.t');