@@ -15,6 +15,9 @@ var PlotSchema = require('./plot_schema');
1515var Plots = require ( '../plots/plots' ) ;
1616
1717var Axes = require ( '../plots/cartesian/axes' ) ;
18+ var handleRangeDefaults = require ( '../plots/cartesian/range_defaults' ) ;
19+
20+ var cartesianLayoutAttributes = require ( '../plots/cartesian/layout_attributes' ) ;
1821var Drawing = require ( '../components/drawing' ) ;
1922var Color = require ( '../components/color' ) ;
2023var initInteractions = require ( '../plots/cartesian/graph_interact' ) . initInteractions ;
@@ -1838,26 +1841,19 @@ function axRangeSupplyDefaultsByPass(gd, flags, specs) {
18381841 if ( k !== 'axrange' && flags [ k ] ) return false ;
18391842 }
18401843
1844+ var axIn , axOut ;
1845+ var coerce = function ( attr , dflt ) {
1846+ return Lib . coerce ( axIn , axOut , cartesianLayoutAttributes , attr , dflt ) ;
1847+ } ;
1848+
1849+ var options = { } ; // passing empty options for now!
1850+
18411851 for ( var axId in specs . rangesAltered ) {
18421852 var axName = Axes . id2name ( axId ) ;
1843- var axIn = gd . layout [ axName ] ;
1844- var axOut = fullLayout [ axName ] ;
1845- axOut . autorange = axIn . autorange ;
1853+ axIn = gd . layout [ axName ] ;
1854+ axOut = fullLayout [ axName ] ;
18461855
1847- var r0 = axOut . _rangeInitial0 ;
1848- var r1 = axOut . _rangeInitial1 ;
1849- // partial range needs supplyDefaults
1850- if (
1851- ( r0 === undefined && r1 !== undefined ) ||
1852- ( r0 !== undefined && r1 === undefined )
1853- ) {
1854- return false ;
1855- }
1856-
1857- if ( axIn . range ) {
1858- axOut . range = axIn . range . slice ( ) ;
1859- }
1860- axOut . cleanRange ( ) ;
1856+ handleRangeDefaults ( axIn , axOut , coerce , options ) ;
18611857
18621858 if ( axOut . _matchGroup ) {
18631859 for ( var axId2 in axOut . _matchGroup ) {
0 commit comments