Skip to content

Commit fd121f4

Browse files
committed
don't count editType:'none' edits as "changes",
... but make sure to count traces deletion as a "non-animatable" change (to make data-mismatch test still passes).
1 parent 33a9530 commit fd121f4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/plot_api/plot_api.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2819,7 +2819,9 @@ exports.react = function(gd, data, layout, config) {
28192819
};
28202820

28212821
function diffData(gd, oldFullData, newFullData, immutable, transition, newDataRevision) {
2822-
if(!transition && oldFullData.length !== newFullData.length) {
2822+
var sameTraceLength = oldFullData.length === newFullData.length;
2823+
2824+
if(!transition && !sameTraceLength) {
28232825
return {
28242826
fullReplot: true,
28252827
calc: true
@@ -2864,7 +2866,7 @@ function diffData(gd, oldFullData, newFullData, immutable, transition, newDataRe
28642866
}
28652867

28662868
if(transition && flags.nChanges && flags.nChangesAnim) {
2867-
flags.anim = flags.nChanges === flags.nChangesAnim ? 'all' : 'some';
2869+
flags.anim = flags.nChanges === flags.nChangesAnim && sameTraceLength ? 'all' : 'some';
28682870
}
28692871

28702872
return flags;
@@ -2918,7 +2920,10 @@ function getDiffFlags(oldContainer, newContainer, outerparts, opts) {
29182920
return;
29192921
}
29202922
editTypes.update(flags, valObject);
2921-
flags.nChanges++;
2923+
2924+
if(editType !== 'none') {
2925+
flags.nChanges++;
2926+
}
29222927

29232928
// track animatable changes
29242929
if(opts.transition && valObject.anim) {

0 commit comments

Comments
 (0)