File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 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) {
19601960 } else {
19611961 fullLayout . _redrawFromAutoMarginCount = 1 ;
19621962 }
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+ }
19641976 }
19651977} ;
19661978
You can’t perform that action at this time.
0 commit comments