awesome animation framework now in with promises

This commit is contained in:
Peter Cottle 2012-12-19 12:31:01 -08:00
parent 39f6353f07
commit ebaae41a38
5 changed files with 271 additions and 53 deletions

View file

@ -175,10 +175,14 @@ var VisNode = VisBase.extend({
this.get('circle').stop().animate(attr.circle, s, e);
this.get('text').stop().animate(attr.text, s, e);
// animate the x attribute without bouncing so it looks like there's
// gravity in only one direction. Just a small animation polish
this.get('circle').animate(attr.circle.cx, s, 'easeInOut');
this.get('text').animate(attr.text.x, s, 'easeInOut');
if (easing == 'bounce' &&
attr.circle && attr.circle.cx !== undefined &&
attr.text && attr.text.x !== undefined ) {
// animate the x attribute without bouncing so it looks like there's
// gravity in only one direction. Just a small animation polish
this.get('circle').animate(attr.circle.cx, s, 'easeInOut');
this.get('text').animate(attr.text.x, s, 'easeInOut');
}
},
getScreenCoords: function() {
@ -271,7 +275,6 @@ var VisNode = VisBase.extend({
},
setOutgoingEdgesBirthPosition: function(parentCoords) {
_.each(this.get('outgoingEdges'), function(edge) {
var headPos = edge.get('head').getScreenCoords();
var path = edge.genSmoothBezierPathStringFromCoords(parentCoords, headPos);