Permalink
Browse files

Allow `ease` to pass additional arguments.

  • Loading branch information...
1 parent 937529e commit 4fcff607ab031bc3df0a1863435796b8515cfe5e @mbostock mbostock committed Mar 17, 2011
Showing with 6 additions and 6 deletions.
  1. +2 −2 d3.js
  2. +2 −2 d3.min.js
  3. +1 −1 src/core/core.js
  4. +1 −1 src/core/transition.js
View
@@ -1,4 +1,4 @@
-(function(){d3 = {version: "1.8.1"}; // semver
+(function(){d3 = {version: "1.8.2"}; // semver
if (!Date.now) Date.now = function() {
return +new Date();
};
@@ -1785,7 +1785,7 @@ function d3_transition(groups) {
};
transition.ease = function(value) {
- ease = typeof value == "string" ? d3.ease(value) : value;
+ ease = typeof value == "function" ? value : d3.ease.apply(d3, arguments);
return transition;
};
View
@@ -18,14 +18,14 @@ f),i="__on"+e;return a.each(function(k,j){function p(q){var m=d3.event;d3.event=
h.__data__}else e.push(null)}return z(g)}a.append=function(c){function g(d){return d.appendChild(document.createElement(c))}function e(d){return d.appendChild(document.createElementNS(c.space,c.local))}c=d3.ns.qualify(c);return b(c.local?e:g)};a.insert=function(c,g){function e(f){return f.insertBefore(document.createElement(c),D(g,f))}function d(f){return f.insertBefore(document.createElementNS(c.space,c.local),D(g,f))}c=d3.ns.qualify(c);return b(c.local?d:e)};return a}function La(a){if(!arguments.length)a=
d3.ascending;return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function X(a){function b(m){var o=true,l=-1;a.each(function(){if(i[++l]!=2){var r=(m-k[l])/j[l],s=this.__transition__,u,v,t=d[l];if(r<1){o=false;if(r<0)return}else r=1;if(i[l]){if(!s||s.active!=g){i[l]=2;return}}else if(!s||s.active>g){i[l]=2;return}else{i[l]=1;h.start.dispatch.apply(this,arguments);t=d[l]={};s.active=g;for(v in e)t[v]=e[v].apply(this,arguments)}u=q(r);for(v in e)t[v].call(this,u);if(r==1){i[l]=2;if(s.active==
g){r=s.owner;if(r==g){delete this.__transition__;f&&this.parentNode.removeChild(this)}Y=g;h.end.dispatch.apply(this,arguments);Y=0;s.owner=r}}}});return o}var c={},g=Y||++Ma,e={},d=[],f=false,h=d3.dispatch("start","end"),i=[],k=[],j=[],p,q=d3.ease("cubic-in-out");a.each(function(){(this.__transition__||(this.__transition__={})).owner=g});c.delay=function(m){var o=Infinity,l=-1;if(typeof m=="function")a.each(function(){var r=k[++l]=+m.apply(this,arguments);if(r<o)o=r});else{o=+m;a.each(function(){k[++l]=
-o})}ka(b,o);return c};c.duration=function(m){var o=-1;if(typeof m=="function"){p=0;a.each(function(){var l=j[++o]=+m.apply(this,arguments);if(l>p)p=l})}else{p=+m;a.each(function(){j[++o]=p})}return c};c.ease=function(m){q=typeof m=="string"?d3.ease(m):m;return c};c.attrTween=function(m,o){function l(s,u){var v=o.call(this,s,u,this.getAttribute(m));return function(t){this.setAttribute(m,v(t))}}function r(s,u){var v=o.call(this,s,u,this.getAttributeNS(m.space,m.local));return function(t){this.setAttributeNS(m.space,
+o})}ka(b,o);return c};c.duration=function(m){var o=-1;if(typeof m=="function"){p=0;a.each(function(){var l=j[++o]=+m.apply(this,arguments);if(l>p)p=l})}else{p=+m;a.each(function(){j[++o]=p})}return c};c.ease=function(m){q=typeof m=="function"?m:d3.ease.apply(d3,arguments);return c};c.attrTween=function(m,o){function l(s,u){var v=o.call(this,s,u,this.getAttribute(m));return function(t){this.setAttribute(m,v(t))}}function r(s,u){var v=o.call(this,s,u,this.getAttributeNS(m.space,m.local));return function(t){this.setAttributeNS(m.space,
m.local,v(t))}}e["attr."+m]=m.local?r:l;return c};c.attr=function(m,o){return c.attrTween(m,la(o))};c.styleTween=function(m,o,l){if(arguments.length<3)l=null;e["style."+m]=function(r,s){var u=o.call(this,r,s,window.getComputedStyle(this,null).getPropertyValue(m));return function(v){this.style.setProperty(m,u(v),l)}};return c};c.style=function(m,o,l){if(arguments.length<3)l=null;return c.styleTween(m,la(o),l)};c.select=function(m){var o;m=X(a.select(m)).ease(q);o=-1;m.delay(function(){return k[++o]});
o=-1;m.duration(function(){return j[++o]});return m};c.selectAll=function(m){var o;m=X(a.selectAll(m)).ease(q);o=-1;m.delay(function(l,r){return k[r?o:++o]});o=-1;m.duration(function(l,r){return j[r?o:++o]});return m};c.remove=function(){f=true;return c};c.each=function(m,o){h[m].add(o);return c};c.call=fa;return c.delay(0).duration(250)}function la(a){return typeof a=="function"?function(b,c,g){return d3.interpolate(g,String(a.call(this,b,c)))}:(a=String(a),function(b,c,g){return d3.interpolate(g,
a)})}function ka(a,b){var c=Date.now(),g=false,e=c+b,d=F;if(isFinite(b)){for(;d;){if(d.callback==a){d.then=c;d.delay=b;g=true}else{var f=d.then+d.delay;if(f<e)e=f}d=d.next}g||(F={callback:a,then:c,delay:b,next:F});if(!K){clearTimeout(Z);Z=setTimeout(Na,Math.max(24,e-c))}}}function Na(){K=1;Z=0;ma(na)}function na(){for(var a,b=Date.now(),c=F;c;){a=b-c.then;if(a>c.delay)c.flush=c.callback(a);c=c.next}a=null;for(b=F;b;)b=b.flush?a?a.next=b.next:F=b.next:(a=b).next;a||(K=0);K&&ma(na)}function $(a){return Math.log(a)/
Math.LN10}function oa(a){return-Math.log(-a)/Math.LN10}function Oa(a){return function(b){return Math.pow(b,a)}}function Pa(a){return function(b){return-Math.pow(-b,a)}}function Qa(a){return a.innerRadius}function Ra(a){return a.outerRadius}function pa(a){return a.startAngle}function qa(a){return a.endAngle}function aa(a,b,c,g){var e=[],d=-1,f=b.length,h=typeof c=="function",i=typeof g=="function",k;if(h&&i)for(;++d<f;)e.push([c.call(a,k=b[d],d),g.call(a,k,d)]);else if(h)for(;++d<f;)e.push([c.call(a,
b[d],d),g]);else if(i)for(;++d<f;)e.push([c,g.call(a,b[d],d)]);else for(;++d<f;)e.push([c,g]);return e}function ra(a){return a[0]}function sa(a){return a[1]}function H(a){var b=[],c=0,g=a.length,e=a[0];for(b.push(e[0],",",e[1]);++c<g;)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function ta(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return H(a);var c=a.length!=b.length,g="",e=a[0],d=a[1],f=b[0],h=f,i=1;if(c){g+="Q"+(d[0]-f[0]*2/3)+","+(d[1]-f[1]*2/3)+","+d[0]+","+d[1];e=a[1];
i=2}if(b.length>1){h=b[1];d=a[i];i++;g+="C"+(e[0]+f[0])+","+(e[1]+f[1])+","+(d[0]-h[0])+","+(d[1]-h[1])+","+d[0]+","+d[1];for(e=2;e<b.length;e++,i++){d=a[i];h=b[e];g+="S"+(d[0]-h[0])+","+(d[1]-h[1])+","+d[0]+","+d[1]}}if(c){c=a[i];g+="Q"+(d[0]+h[0]*2/3)+","+(d[1]+h[1]*2/3)+","+c[0]+","+c[1]}return g}function ua(a,b){for(var c=[],g=(1-b)/2,e=a[0],d=a[1],f=a[2],h=2,i=a.length;++h<i;){c.push([g*(f[0]-e[0]),g*(f[1]-e[1])]);e=d;d=f;f=a[h]}c.push([g*(f[0]-e[0]),g*(f[1]-e[1])]);return c}function C(a,b){return a[0]*
-b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function L(a,b,c){a.push("C",C(va,b),",",C(va,c),",",C(wa,b),",",C(wa,c),",",C(M,b),",",C(M,c))}function Sa(){return 0}function Ta(a){return a.source}function Ua(a){return a.target}function Va(a){return a.radius}function Wa(){return 64}function Xa(){return"circle"}d3={version:"1.8.1"};if(!Date.now)Date.now=function(){return+new Date};if(!Object.create)Object.create=function(a){function b(){}b.prototype=a;return new b};var N=function(a){return Array.prototype.slice.call(a)};
+b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function L(a,b,c){a.push("C",C(va,b),",",C(va,c),",",C(wa,b),",",C(wa,c),",",C(M,b),",",C(M,c))}function Sa(){return 0}function Ta(a){return a.source}function Ua(a){return a.target}function Va(a){return a.radius}function Wa(){return 64}function Xa(){return"circle"}d3={version:"1.8.2"};if(!Date.now)Date.now=function(){return+new Date};if(!Object.create)Object.create=function(a){function b(){}b.prototype=a;return new b};var N=function(a){return Array.prototype.slice.call(a)};
try{N(document.documentElement.childNodes)}catch(jb){N=za}d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}};d3.ascending=function(a,b){return a<b?-1:a>b?1:0};d3.descending=function(a,b){return b<a?-1:b>a?1:0};d3.min=function(a,b){var c=0,g=a.length,e=a[0],d;if(arguments.length==1)for(;++c<g;){if(e>(d=a[c]))e=d}else for(e=b(a[0]);++c<g;)if(e>(d=b(a[c])))e=d;return e};d3.max=function(a,b){var c=0,g=a.length,e=a[0],d;if(arguments.length==1)for(;++c<g;){if(e<
(d=a[c]))e=d}else for(e=b(e);++c<g;)if(e<(d=b(a[c])))e=d;return e};d3.nest=function(){function a(h,i){if(i>=g.length)return f?f.call(c,h):d?h.sort(d):h;for(var k=-1,j=h.length,p=g[i++],q,m,o={};++k<j;)if((q=p(m=h[k]))in o)o[q].push(m);else o[q]=[m];for(q in o)o[q]=a(o[q],i);return o}function b(h,i){if(i>=g.length)return h;var k=[],j=e[i++],p;for(p in h)k.push({key:p,values:b(h[p],i)});j&&k.sort(function(q,m){return j(q.key,m.key)});return k}var c={},g=[],e=[],d,f;c.map=function(h){return a(h,0)};
c.entries=function(h){return b(a(h,0),0)};c.key=function(h){g.push(h);return c};c.sortKeys=function(h){e[g.length-1]=h;return c};c.sortValues=function(h){d=h;return c};c.rollup=function(h){f=h;return c};return c};d3.keys=function(a){var b=[],c;for(c in a)b.push(c);return b};d3.values=function(a){var b=[],c;for(c in a)b.push(a[c]);return b};d3.entries=function(a){var b=[],c;for(c in a)b.push({key:c,value:a[c]});return b};d3.merge=function(a){return Array.prototype.concat.apply([],a)};d3.split=function(a,
View
@@ -1 +1 @@
-d3 = {version: "1.8.1"}; // semver
+d3 = {version: "1.8.2"}; // semver
@@ -141,7 +141,7 @@ function d3_transition(groups) {
};
transition.ease = function(value) {
- ease = typeof value == "string" ? d3.ease(value) : value;
+ ease = typeof value == "function" ? value : d3.ease.apply(d3, arguments);
return transition;
};

0 comments on commit 4fcff60

Please sign in to comment.