@@ -1299,7 +1299,7 @@ exports.restyle = function restyle(gd, astr, val, _traces) {
12991299 var flags = specs . flags ;
13001300
13011301 // clear calcdata and/or axis types if required so they get regenerated
1302- if ( flags . clearCalc ) gd . calcdata = undefined ;
1302+ if ( flags . calc ) gd . calcdata = undefined ;
13031303 if ( flags . clearAxisTypes ) helpers . clearAxisTypes ( gd , traces , { } ) ;
13041304
13051305 // fill in redraw sequence
@@ -1597,21 +1597,7 @@ function _restyle(gd, aobj, traces) {
15971597 }
15981598 }
15991599
1600- // do we need to force a recalc?
1601- var autorangeOn = false ;
1602- var axList = Axes . list ( gd ) ;
1603- for ( i = 0 ; i < axList . length ; i ++ ) {
1604- if ( axList [ i ] . autorange ) {
1605- autorangeOn = true ;
1606- break ;
1607- }
1608- }
1609-
1610- // combine a few flags together;
1611- if ( flags . calc || ( flags . calcIfAutorange && autorangeOn ) ) {
1612- flags . clearCalc = true ;
1613- }
1614- if ( flags . calc || flags . plot || flags . calcIfAutorange ) {
1600+ if ( flags . calc || flags . plot ) {
16151601 flags . fullReplot = true ;
16161602 }
16171603
@@ -1956,37 +1942,21 @@ function _relayout(gd, aobj) {
19561942 var propStr = containerArrayMatch . property ;
19571943 var componentArray = Lib . nestedProperty ( layout , arrayStr ) ;
19581944 var obji = ( componentArray || [ ] ) [ i ] || { } ;
1959- var objToAutorange = obji ;
1960-
19611945 var updateValObject = valObject || { editType : 'calc' } ;
1962- var checkForAutorange = updateValObject . editType . indexOf ( 'calcIfAutorange' ) !== - 1 ;
19631946
1964- if ( i === '' ) {
1965- // replacing the entire array - too many possibilities, just recalc
1966- if ( checkForAutorange ) flags . calc = true ;
1967- else editTypes . update ( flags , updateValObject ) ;
1968- checkForAutorange = false ; // clear this, we're already doing a recalc
1969- }
1970- else if ( propStr === '' ) {
1947+ if ( propStr === '' ) {
19711948 // special handling of undoit if we're adding or removing an element
19721949 // ie 'annotations[2]' which can be {...} (add) or null (remove)
1973- objToAutorange = vi ;
19741950 if ( manageArrays . isAddVal ( vi ) ) {
19751951 undoit [ ai ] = null ;
1976- }
1977- else if ( manageArrays . isRemoveVal ( vi ) ) {
1952+ } else if ( manageArrays . isRemoveVal ( vi ) ) {
19781953 undoit [ ai ] = obji ;
1979- objToAutorange = obji ;
1954+ } else {
1955+ Lib . warn ( 'unrecognized full object value' , aobj ) ;
19801956 }
1981- else Lib . warn ( 'unrecognized full object value' , aobj ) ;
19821957 }
19831958
1984- if ( checkForAutorange && ( refAutorange ( gd , objToAutorange , 'x' ) || refAutorange ( gd , objToAutorange , 'y' ) ) ) {
1985- flags . calc = true ;
1986- }
1987- else {
1988- editTypes . update ( flags , updateValObject ) ;
1989- }
1959+ editTypes . update ( flags , updateValObject ) ;
19901960
19911961 // prepare the edits object we'll send to applyContainerArrayChanges
19921962 if ( ! arrayEdits [ arrayStr ] ) arrayEdits [ arrayStr ] = { } ;
@@ -2088,25 +2058,6 @@ function updateAutosize(gd) {
20882058 return ( fullLayout . width !== oldWidth ) || ( fullLayout . height !== oldHeight ) ;
20892059}
20902060
2091- // for editing annotations or shapes - is it on autoscaled axes?
2092- function refAutorange ( gd , obj , axLetter ) {
2093- if ( ! Lib . isPlainObject ( obj ) ) return false ;
2094- var axRef = obj [ axLetter + 'ref' ] || axLetter ,
2095- ax = Axes . getFromId ( gd , axRef ) ;
2096-
2097- if ( ! ax && axRef . charAt ( 0 ) === axLetter ) {
2098- // fall back on the primary axis in case we've referenced a
2099- // nonexistent axis (as we do above if axRef is missing).
2100- // This assumes the object defaults to data referenced, which
2101- // is the case for shapes and annotations but not for images.
2102- // The only thing this is used for is to determine whether to
2103- // do a full `recalc`, so the only ill effect of this error is
2104- // to waste some time.
2105- ax = Axes . getFromId ( gd , axLetter ) ;
2106- }
2107- return ( ax || { } ) . autorange ;
2108- }
2109-
21102061/**
21112062 * update: update trace and layout attributes of an existing plot
21122063 *
@@ -2145,7 +2096,7 @@ exports.update = function update(gd, traceUpdate, layoutUpdate, _traces) {
21452096 var relayoutFlags = relayoutSpecs . flags ;
21462097
21472098 // clear calcdata and/or axis types if required
2148- if ( restyleFlags . clearCalc || relayoutFlags . calc ) gd . calcdata = undefined ;
2099+ if ( restyleFlags . calc || relayoutFlags . calc ) gd . calcdata = undefined ;
21492100 if ( restyleFlags . clearAxisTypes ) helpers . clearAxisTypes ( gd , traces , layoutUpdate ) ;
21502101
21512102 // fill in redraw sequence
@@ -2392,14 +2343,10 @@ function diffData(gd, oldFullData, newFullData, immutable) {
23922343 if ( seenUIDs [ trace . uid ] ) continue ;
23932344 seenUIDs [ trace . uid ] = 1 ;
23942345
2395- diffOpts . autoranged = trace . xaxis ? (
2396- Axes . getFromId ( gd , trace . xaxis ) . autorange ||
2397- Axes . getFromId ( gd , trace . yaxis ) . autorange
2398- ) : false ;
23992346 getDiffFlags ( oldFullData [ i ] . _fullInput , trace , [ ] , diffOpts ) ;
24002347 }
24012348
2402- if ( flags . calc || flags . plot || flags . calcIfAutorange ) {
2349+ if ( flags . calc || flags . plot ) {
24032350 flags . fullReplot = true ;
24042351 }
24052352
@@ -2438,17 +2385,9 @@ function getDiffFlags(oldContainer, newContainer, outerparts, opts) {
24382385 var immutable = opts . immutable ;
24392386 var inArray = opts . inArray ;
24402387 var arrayIndex = opts . arrayIndex ;
2441- var gd = opts . gd ;
2442- var autoranged = opts . autoranged ;
24432388
24442389 function changed ( ) {
24452390 var editType = valObject . editType ;
2446- if ( editType . indexOf ( 'calcIfAutorange' ) !== - 1 && ( autoranged || ( autoranged === undefined && (
2447- refAutorange ( gd , newContainer , 'x' ) || refAutorange ( gd , newContainer , 'y' )
2448- ) ) ) ) {
2449- flags . calc = true ;
2450- return ;
2451- }
24522391 if ( inArray && editType . indexOf ( 'arraydraw' ) !== - 1 ) {
24532392 Lib . pushUnique ( flags . arrays [ inArray ] , arrayIndex ) ;
24542393 return ;
0 commit comments