File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1960,7 +1960,19 @@ plots.doAutoMargin = function(gd) {
1960
1960
} else {
1961
1961
fullLayout . _redrawFromAutoMarginCount = 1 ;
1962
1962
}
1963
- return Registry . call ( 'plot' , gd ) ;
1963
+
1964
+ // Always allow at least one redraw and give each margin-push
1965
+ // call 3 loops to converge. Of course, for most cases this way too many,
1966
+ // but let's keep things on the safe side until we fix our
1967
+ // auto-margin pipeline problems:
1968
+ // https://github.com/plotly/plotly.js/issues/2704
1969
+ var maxNumberOfRedraws = 3 * ( 1 + Object . keys ( pushMarginIds ) . length ) ;
1970
+
1971
+ if ( fullLayout . _redrawFromAutoMarginCount < maxNumberOfRedraws ) {
1972
+ return Registry . call ( 'plot' , gd ) ;
1973
+ } else {
1974
+ Lib . warn ( 'Too many auto-margin redraws.' ) ;
1975
+ }
1964
1976
}
1965
1977
} ;
1966
1978
You can’t perform that action at this time.
0 commit comments