@@ -15,6 +15,9 @@ var PlotSchema = require('./plot_schema');
15
15
var Plots = require ( '../plots/plots' ) ;
16
16
17
17
var Axes = require ( '../plots/cartesian/axes' ) ;
18
+ var handleRangeDefaults = require ( '../plots/cartesian/range_defaults' ) ;
19
+
20
+ var cartesianLayoutAttributes = require ( '../plots/cartesian/layout_attributes' ) ;
18
21
var Drawing = require ( '../components/drawing' ) ;
19
22
var Color = require ( '../components/color' ) ;
20
23
var initInteractions = require ( '../plots/cartesian/graph_interact' ) . initInteractions ;
@@ -1838,26 +1841,19 @@ function axRangeSupplyDefaultsByPass(gd, flags, specs) {
1838
1841
if ( k !== 'axrange' && flags [ k ] ) return false ;
1839
1842
}
1840
1843
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
+
1841
1851
for ( var axId in specs . rangesAltered ) {
1842
1852
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 ] ;
1846
1855
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 ) ;
1861
1857
1862
1858
if ( axOut . _matchGroup ) {
1863
1859
for ( var axId2 in axOut . _matchGroup ) {
0 commit comments