Skip to content

Commit afb6ce6

Browse files
committed
Add failing test for sort + animate
1 parent 6b7c9d7 commit afb6ce6

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/jasmine/tests/animate_test.js

+32
Original file line numberDiff line numberDiff line change
@@ -768,4 +768,36 @@ describe('animating scatter traces', function() {
768768
expect(trace.style('opacity')).toEqual('0.1');
769769
}).catch(fail).then(done);
770770
});
771+
772+
it('computes calcdata correctly when transforms are present', function (done) {
773+
var isChecked = false;
774+
775+
Plotly.plot(gd, {
776+
data: [{
777+
x: [1, 2, 3],
778+
y: [1, 2, 3],
779+
mode: 'markers',
780+
transforms: [{
781+
type: 'sort',
782+
target: [1, 3, 2]
783+
}]
784+
}],
785+
frames: [
786+
{name: 'frame1', data: [{y: [1, 2, 3]}]},
787+
{name: 'frame2', data: [{y: [3, 1, 2]}]}
788+
]
789+
}).then(function () {;
790+
return Plotly.animate(gd, ['frame2'], {frame: {duration: 200, redraw: false}});
791+
}).then(function () {
792+
expect(isChecked).toBe(true);
793+
}).catch(fail).then(done);
794+
795+
gd.on('plotly_animating', function () {
796+
setTimeout(function () {
797+
isChecked = true;
798+
console.log('gd.calcdata[0][0].y:', gd.calcdata[0][0].y);
799+
expect(gd.calcdata[0][0].y).toEqual(3);
800+
}, 100);
801+
})
802+
});
771803
});

0 commit comments

Comments
 (0)