@@ -1796,6 +1796,25 @@ describe('Test axes', function() {
1796
1796
'input range, ' + msg + ': ' + ax . range ) ;
1797
1797
}
1798
1798
1799
+ it ( 'can change _inputDomain on call to react when template is present' , function ( done ) {
1800
+ Plotly . newPlot ( gd ,
1801
+ [ { z : [ [ 0 , 1 ] , [ 2 , 3 ] ] , type : 'heatmap' } ] ,
1802
+ { template : { } , xaxis : { domain : [ 0 , 1 ] , scaleanchor : 'y' } }
1803
+ ) . then ( function ( ) {
1804
+ assertRangeDomain ( 'xaxis' , [ - 1.451851851851852 , 2.4518518518518517 ] , [ 0 , 1 ] , [ 0 , 1 ] ) ;
1805
+ } )
1806
+ . then ( function ( ) {
1807
+ return Plotly . react ( gd ,
1808
+ [ { z : [ [ 0 , 1 ] , [ 2 , 3 ] ] , type : 'heatmap' } ] ,
1809
+ { template : { } , xaxis : { domain : [ 0.1 , 0.9 ] } }
1810
+ ) ;
1811
+ } )
1812
+ . then ( function ( ) {
1813
+ assertRangeDomain ( 'xaxis' , [ - 0.5 , 1.5 ] , [ 0.1 , 0.9 ] , [ 0.1 , 0.9 ] ) ;
1814
+ } )
1815
+ . then ( done , done . fail ) ;
1816
+ } ) ;
1817
+
1799
1818
it ( 'can change per-axis constrain:domain/range and constraintoward' , function ( done ) {
1800
1819
Plotly . newPlot ( gd ,
1801
1820
// start with a heatmap as it has no padding so calculations are easy
0 commit comments