@@ -57,8 +57,8 @@ var numericNameWarningCountLimit = 5;
57
57
*
58
58
*/
59
59
function _doPlot ( gd , data , layout , config ) {
60
- const isForceRerender = window . isForceRerender
61
- window . isForceRerender = false ;
60
+ const isForceRerender = window [ `plotly- ${ gd . dataset . chartId } ` ] . isForceRerender
61
+ window [ `plotly- ${ gd . dataset . chartId } ` ] . isForceRerender = false ;
62
62
63
63
var frames ;
64
64
@@ -330,9 +330,10 @@ function _doPlot(gd, data, layout, config) {
330
330
331
331
subroutines . doAutoRangeAndConstraints ( gd ) ;
332
332
333
+ // !!! We don't need to save an initial range because we change it if we apply a detection time.
333
334
// store initial ranges *after* enforcing constraints, otherwise
334
335
// we will never look like we're at the initial ranges
335
- if ( graphWasEmpty ) Axes . saveRangeInitial ( gd ) ;
336
+ // if(graphWasEmpty) Axes.saveRangeInitial(gd);
336
337
337
338
// this one is different from shapes/annotations calcAutorange
338
339
// the others incorporate those components into ax._extremes,
@@ -365,7 +366,8 @@ function _doPlot(gd, data, layout, config) {
365
366
gd . _fullLayout . _insideTickLabelsUpdaterange = undefined ;
366
367
367
368
return relayout ( gd , insideTickLabelsUpdaterange ) . then ( function ( ) {
368
- Axes . saveRangeInitial ( gd , true ) ;
369
+ // !!! We don't need to save an initial range because we change it if we apply a detection time.
370
+ // Axes.saveRangeInitial(gd, true);
369
371
} ) ;
370
372
}
371
373
}
@@ -552,6 +554,8 @@ function redraw(gd) {
552
554
} ) ;
553
555
}
554
556
557
+ const generateId = ( ) => Math . random ( ) . toString ( 36 ) . substr ( 2 , 10 ) ;
558
+
555
559
/**
556
560
* Convenience function to make idempotent plot option obvious to users.
557
561
*
@@ -561,7 +565,9 @@ function redraw(gd) {
561
565
* @param {Object } config
562
566
*/
563
567
function newPlot ( gd , data , layout , config ) {
568
+ gd . dataset . chartId = generateId ( )
564
569
gd = Lib . getGraphDiv ( gd ) ;
570
+ window [ `plotly-${ gd . dataset . chartId } ` ] = { }
565
571
566
572
// remove gl contexts
567
573
Plots . cleanPlot ( [ ] , { } , gd . _fullData || [ ] , gd . _fullLayout || { } ) ;
@@ -2635,7 +2641,9 @@ function applyUIRevisions(data, layout, oldFullData, oldFullLayout) {
2635
2641
* object containing `data`, `layout`, `config`, and `frames` members
2636
2642
*
2637
2643
*/
2638
- function react ( gd , data , layout , config , isForce ) {
2644
+ function react ( gd , data , layout , config , isForce , xAxisRange ) {
2645
+ window [ `plotly-${ gd . dataset . chartId } ` ] . xAxisRange = xAxisRange ;
2646
+
2639
2647
var frames , plotDone ;
2640
2648
2641
2649
function addFrames ( ) { return exports . addFrames ( gd , frames ) ; }
@@ -2744,7 +2752,7 @@ function react(gd, data, layout, config, isForce) {
2744
2752
} ) ;
2745
2753
} else if ( isForce || restyleFlags . fullReplot || relayoutFlags . layoutReplot || configChanged ) {
2746
2754
gd . _fullLayout . _skipDefaults = true ;
2747
- window . isForceRerender = true
2755
+ window [ `plotly- ${ gd . dataset . chartId } ` ] . isForceRerender = true
2748
2756
seq . push ( exports . _doPlot ) ;
2749
2757
} else {
2750
2758
for ( var componentType in relayoutFlags . arrays ) {
0 commit comments