8000 Fix race condition in animation resolution by rreusser · Pull Request #1108 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Fix race condition in animation resolution #1108

10000 New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 10, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into fix-layout-animation
Conflicts:
	src/plots/plots.js
	test/jasmine/tests/animate_test.js
  • Loading branch information
rreusser committed Nov 9, 2016
commit 133b9d65c8bbe9b8671e2f1e816df0e97f4f35b2
28 changes: 27 additions & 1 deletion test/jasmine/tests/animate_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ describe('Test animate API', function() {
});
});

describe('layout animation', function() {
describe('Animate API details', function() {
'use strict';

var gd;
Expand Down Expand Up @@ -667,4 +667,30 @@ describe('layout animation', function() {
}, dur);
});
});

it('does not fail if strings are not used', function(done) {
Plotly.addFrames(gd, [{name: 8, data: [{x: [8, 7, 6]}]}]).then(function() {
// Verify it was added as a string name:
expect(gd._transitionData._frameHash['8']).not.toBeUndefined();

// Transition using a number:
return Plotly.animate(gd, [8], {transition: {duration: 0}, frame: {duration: 0}});
}).then(function() {
// Confirm the result:
expect(gd.data[0].x).toEqual([8, 7, 6]);
}).catch(fail).then(done);
});

it('ignores null and undefined frames', function(done) {
var cnt = 0;
gd.on('plotly_animatingframe', function() {cnt++;});

Plotly.animate(gd, ['frame0', null, undefined], {transition: {duration: 0}, frame: {duration: 0}}).then(function() {
// Check only one animating was fired:
expect(cnt).toEqual(1);

// Check unused frames did not affect the current frame:
expect(gd._fullLayout._currentFrame).toEqual('frame0');
}).catch(fail).then(done);
});
});
You are viewing a condensed version of this merge commit. You can view the full changes here.
0