diff --git a/src/plots/plots.js b/src/plots/plots.js index 1b6f45321f8..f853c2c003e 100644 --- a/src/plots/plots.js +++ b/src/plots/plots.js @@ -1813,6 +1813,10 @@ plots.transition = function(gd, data, layout, traces, frameOpts, transitionOpts) // of essentially the whole supplyDefaults step, so that it seems sensible to just use // supplyDefaults even though it's heavier than would otherwise be desired for // transitions: + + // first delete calcdata so supplyDefaults knows a calc step is coming + delete gd.calcdata; + plots.supplyDefaults(gd); plots.doCalcdata(gd); diff --git a/test/jasmine/tests/animate_test.js b/test/jasmine/tests/animate_test.js index 53eb151c01c..bcb93fe4ca9 100644 --- a/test/jasmine/tests/animate_test.js +++ b/test/jasmine/tests/animate_test.js @@ -768,4 +768,26 @@ describe('animating scatter traces', function() { expect(trace.style('opacity')).toEqual('0.1'); }).catch(fail).then(done); }); + + it('computes calcdata correctly when transforms are present', function(done) { + Plotly.plot(gd, { + data: [{ + x: [1, 2, 3], + y: [1, 2, 3], + mode: 'markers', + transforms: [{ + type: 'sort', + target: [1, 3, 2] + }] + }], + frames: [ + {name: 'frame1', data: [{y: [1, 2, 3]}]}, + {name: 'frame2', data: [{y: [3, 1, 2]}]} + ] + }).then(function() { + return Plotly.animate(gd, ['frame2'], {frame: {duration: 200, redraw: false}}); + }).then(function() { + expect(gd.calcdata[0][0].y).toEqual(3); + }).catch(fail).then(done); + }); });