d3-transition
Advanced tools
Comparing version 0.1.3 to 0.2.0
@@ -1,1 +0,1 @@ | ||
var version = "0.1.3"; export * from "../index"; export {version}; | ||
var version = "0.2.0"; export * from "../index"; export {version}; |
@@ -322,5 +322,5 @@ (function (global, factory) { | ||
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { | ||
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { | ||
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, i = 0; i < n; ++i) { | ||
if ((node = group[i]) && match.call(node, node.__data__, i, group)) { | ||
subgroup.push(node); | ||
subgroup[i] = node; | ||
} | ||
@@ -333,2 +333,19 @@ } | ||
function transition_merge(selection) { | ||
for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { | ||
for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { | ||
if (node = group0[i] || group1[i]) { | ||
merge[i] = node; | ||
} | ||
} | ||
} | ||
for (; j < m0; ++j) { | ||
merges[j] = groups0[j]; | ||
} | ||
return new Transition(merges, this._parents, this._key, this._id); | ||
} | ||
function onFunction(key, id, name, listener) { | ||
@@ -412,2 +429,8 @@ if (typeof listener !== "function") throw new Error; | ||
var Selection = d3Selection.selection.prototype.constructor; | ||
function transition_selection() { | ||
return new Selection(this._groups, this._parents); | ||
} | ||
function styleRemove(name) { | ||
@@ -602,2 +625,4 @@ var value00, | ||
filter: transition_filter, | ||
merge: transition_merge, | ||
selection: transition_selection, | ||
transition: transition_transition, | ||
@@ -685,3 +710,3 @@ call: selection_prototype.call, | ||
var version = "0.1.3"; | ||
var version = "0.2.0"; | ||
@@ -688,0 +713,0 @@ exports.version = version; |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("d3-selection"),require("d3-interpolate"),require("d3-dispatch"),require("d3-timer"),require("d3-ease")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-interpolate","d3-dispatch","d3-timer","d3-ease"],e):e(t.d3_transition=t.d3_transition||{},t.d3_selection,t.d3_interpolate,t.d3_dispatch,t.d3_timer,t.d3_ease)}(this,function(t,e,n,r,i,o){"use strict";function u(t,r){return"transform"===r&&t.namespaceURI===e.namespaces.svg?n.interpolateTransform:n.interpolate}function a(t){return function(){this.removeAttribute(t)}}function s(t){return function(){this.removeAttributeNS(t.space,t.local)}}function l(t,e){var n,r;return e+="",function(){var i=this.getAttribute(t);return i===e?null:i===n?r:r=u(this,t)(n=i,e)}}function c(t,e){var r,i;return e+="",function(){var o=this.getAttributeNS(t.space,t.local);return o===e?null:o===r?i:i=n.interpolate(r=o,e)}}function f(t,e){var n,r,i;return function(){var o,a=e.apply(this,arguments);return null==a?void this.removeAttribute(t):(o=this.getAttribute(t),a+="",o===a?null:o===n&&a===r?i:i=u(this,t)(n=o,r=a))}}function h(t,e){var r,i,o;return function(){var u,a=e.apply(this,arguments);return null==a?void this.removeAttributeNS(t.space,t.local):(u=this.getAttributeNS(t.space,t.local),a+="",u===a?null:u===r&&a===i?o:o=n.interpolate(r=u,i=a))}}function p(t,n){var r=e.namespace(t);return this.attrTween(t,(null==n?r.local?s:a:"function"==typeof n?r.local?h:f:r.local?c:l)(r,n))}function d(t,e){function n(){var n=this,r=e.apply(n,arguments);return r&&function(e){n.setAttributeNS(t.space,t.local,r(e))}}return n._value=e,n}function v(t,e){function n(){var n=this,r=e.apply(n,arguments);return r&&function(e){n.setAttribute(t,r(e))}}return n._value=e,n}function _(t,n){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if("function"!=typeof n)throw new Error;var i=e.namespace(t);return this.tween(r,(i.local?d:v)(i,n))}function y(t,e,n,r,i,o){var u=t[e];if(u){if(g(t,e,n))return}else t[e]=u={active:null,pending:[]};b(t,e,{id:n,index:r,group:i,on:it,tweens:ot,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:ut})}function g(t,e,n){var r=t[e];if(r){var i=r.active;if(i&&i.id===n)return i;for(var o=r.pending,u=o.length;--u>=0;)if((i=o[u]).id===n)return i}}function m(t,e,n){var r=g(t,e,n);if(!r||r.state>ut)throw new Error("too late");return r}function w(t,e,n){var r=g(t,e,n);if(!r||r.state>at)throw new Error("too late");return r}function A(t,e,n){var r=g(t,e,n);if(!r)throw new Error("too late");return r}function b(t,e,n){function r(t){n.state=at,n.delay<=t?o(t-n.delay):n.timer.restart(o,n.delay,n.time)}function o(e){var r,o,l,c,f=s.active,h=s.pending;for(f&&(f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group)),r=0,o=-1,l=h.length;l>r;++r)c=h[r],c.id<n.id?c.timer.stop():c.id>n.id&&(h[++o]=c);for(h.length=o+1,s.active=n,i.timeout(function(){s.active===n&&(n.timer.restart(u,n.delay,n.time),u(e))}),n.on.call("start",t,t.__data__,n.index,n.group),n.state=st,a=new Array(l=n.tweens.length),r=0,o=-1;l>r;++r)(c=n.tweens[r].value.call(t,t.__data__,n.index,n.group))&&(a[++o]=c);a.length=o+1}function u(r){var i,o,u=r/n.duration,l=u>=1?1:n.ease.call(null,u);for(i=0,o=a.length;o>i;++i)a[i].call(null,l);u>=1&&(n.on.call("end",t,t.__data__,n.index,n.group),s.active=null,s.pending.length||delete t[e],n.timer.stop())}var a,s=t[e];s.pending.push(n),n.timer=i.timer(r,0,n.time)}function k(t,e,n){return function(){m(this,t,e).delay=+n.apply(this,arguments)}}function x(t,e,n){return n=+n,function(){m(this,t,e).delay=n}}function P(t){var e=this._key,n=this._id;return arguments.length?this.each(("function"==typeof t?k:x)(e,n,t)):A(this.node(),e,n).delay}function E(t,e,n){return function(){w(this,t,e).duration=+n.apply(this,arguments)}}function S(t,e,n){return n=+n,function(){w(this,t,e).duration=n}}function C(t){var e=this._key,n=this._id;return arguments.length?this.each(("function"==typeof t?E:S)(e,n,t)):A(this.node(),e,n).duration}function N(t,e,n){if("function"!=typeof n)throw new Error;return function(){w(this,t,e).ease=n}}function T(t){var e=this._key,n=this._id;return arguments.length?this.each(N(e,n,t)):A(this.node(),e,n).ease}function q(t){"function"!=typeof t&&(t=e.matcher(t));for(var n=this._groups,r=n.length,i=new Array(r),o=0;r>o;++o)for(var u,a=n[o],s=a.length,l=i[o]=[],c=0;s>c;++c)(u=a[c])&&t.call(u,u.__data__,c,a)&&l.push(u);return new Y(i,this._parents,this._key,this._id)}function V(t,e,n,r){if("function"!=typeof r)throw new Error;var i,o;return function(){var u=m(this,t,e),a=u.on;a!==i&&(o=(i=a).copy()).on(n,r),u.on=o}}function z(t,e){var n=this._key,r=this._id;return arguments.length<2?A(this.node(),n,r).on.on(t):this.each(V(n,r,t,e))}function I(t){return function(){var e=this.parentNode;e&&!this[t].pending.length&&e.removeChild(this)}}function j(){return this.on("end.remove",I(this._key))}function O(t){var n=this._key,r=this._id;"function"!=typeof t&&(t=e.selector(t));for(var i=this._groups,o=i.length,u=new Array(o),a=0;o>a;++a)for(var s,l,c=i[a],f=c.length,h=u[a]=new Array(f),p=0;f>p;++p)(s=c[p])&&(l=t.call(s,s.__data__,p,c))&&("__data__"in s&&(l.__data__=s.__data__),h[p]=l,y(h[p],n,r,p,h,A(s,n,r)));return new Y(u,this._parents,n,r)}function R(t){var n=this._key,r=this._id;"function"!=typeof t&&(t=e.selectorAll(t));for(var i=this._groups,o=i.length,u=[],a=[],s=0;o>s;++s)for(var l,c=i[s],f=c.length,h=0;f>h;++h)if(l=c[h]){for(var p,d=t.call(l,l.__data__,h,c),v=A(l,n,r),_=0,g=d.length;g>_;++_)(p=d[_])&&y(p,n,r,_,d,v);u.push(d),a.push(l)}return new Y(i,a,n,r)}function U(t){var r,i,o;return function(){var u=e.window(this).getComputedStyle(this,null),a=u.getPropertyValue(t),s=(this.style.removeProperty(t),u.getPropertyValue(t));return a===s?null:a===r&&s===i?o:o=n.interpolate(r=a,i=s)}}function B(t){return function(){this.style.removeProperty(t)}}function D(t,r){var i,o;return r+="",function(){var u=e.window(this).getComputedStyle(this,null).getPropertyValue(t);return u===r?null:u===i?o:o=n.interpolate(i=u,r)}}function F(t,r){var i,o,u;return function(){var a=e.window(this).getComputedStyle(this,null),s=a.getPropertyValue(t),l=r.apply(this,arguments);return null==l?(this.style.removeProperty(t),l=a.getPropertyValue(t)):l+="",s===l?null:s===i&&l===o?u:u=n.interpolate(i=s,o=l)}}function G(t,e,n){return null==e?this.styleTween(t,U(t)).on("end.style."+t,B(t)):this.styleTween(t,("function"==typeof e?F:D)(t,e),n)}function H(t,e,n){function r(){var r=this,i=e.apply(r,arguments);return i&&function(e){r.style.setProperty(t,i(e),n)}}if("function"!=typeof e)throw new Error;return r._value=e,r}function J(t,e,n){var r="style."+t;return arguments.length<2?(r=this.tween(r))&&r._value:this.tween(r,H(t,e,null==n?"":n))}function K(t){return t=null==t?"":t+"",function(){this.textContent=t}}function L(t){return function(){var e=t.apply(this,arguments);null==e&&(e=""),this.textContent=e}}function M(t){return this.tween("text",("function"==typeof t?L:K)(t))}function Q(){for(var t=this._key,e=this._id,n=$(),r=this._groups,i=r.length,o=0;i>o;++o)for(var u,a=r[o],s=a.length,l=0;s>l;++l)if(u=a[l]){var c=A(u,t,e);y(u,t,n,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Y(r,this._parents,t,n)}function W(t,e,n,r){var i,o;return function(){var u=w(this,t,e),a=u.tweens;if(a!==i){o=(i=a).slice();for(var s={name:n,value:r},l=0,c=o.length;c>l;++l)if(o[l].name===n){o[l]=s;break}l===c&&o.push(s)}u.tweens=o}}function X(t,e){var n=this._key,r=this._id;if(t+="",arguments.length<2){for(var i,o=A(this.node(),n,r).tweens,u=0,a=o.length;a>u;++u)if((i=o[u]).name===t)return i.value;return null}if("function"!=typeof e)throw new Error;return this.each(W(n,r,t,e))}function Y(t,e,n,r){this._groups=t,this._parents=e,this._key=n,this._id=r}function Z(t){return e.selection().transition(t)}function $(){return++lt}function tt(t){return t?"__transition"+t:"__transition"}function et(t){var e=tt(t);return this.each(function(){var t=this[e];if(t){var n,r,i=t.pending,o=t.active;for(o&&(o.on.call("interrupt",this,this.__data__,o.index,o.group),t.active=null,o.timer.stop()),n=0,r=i.length;r>n;++n)i[n].timer.stop();i.length=0,delete this[e]}})}function nt(t){var e,n,r;t instanceof Y?(e=t._key,n=t._id,r=A(t.node(),e,n)):(e=tt(t),n=$(),(r=ft).time=i.now());for(var o=this._groups,u=o.length,a=0;u>a;++a)for(var s,l=o[a],c=l.length,f=0;c>f;++f)(s=l[f])&&y(s,e,n,f,l,r);return new Y(o,this._parents,e,n)}function rt(t,e){var n=tt(e),r=t[n];return r&&(r=r.active)?new Y([[t]],ht,n,r.id):null}var it=r.dispatch("start","end","interrupt"),ot=[],ut=0,at=1,st=2,lt=0,ct=e.selection.prototype;Y.prototype=Z.prototype={constructor:Y,select:O,selectAll:R,filter:q,transition:Q,call:ct.call,nodes:ct.nodes,node:ct.node,size:ct.size,empty:ct.empty,each:ct.each,on:z,attr:p,attrTween:_,style:G,styleTween:J,text:M,remove:j,tween:X,delay:P,duration:C,ease:T};var ft={time:null,delay:0,duration:250,ease:o.easeCubicInOut};e.selection.prototype.interrupt=et,e.selection.prototype.transition=nt;var ht=[null],pt="0.1.3";t.version=pt,t.transition=Z,t.active=rt}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("d3-selection"),require("d3-interpolate"),require("d3-dispatch"),require("d3-timer"),require("d3-ease")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-interpolate","d3-dispatch","d3-timer","d3-ease"],e):e(t.d3_transition=t.d3_transition||{},t.d3_selection,t.d3_interpolate,t.d3_dispatch,t.d3_timer,t.d3_ease)}(this,function(t,e,n,r,i,o){"use strict";function u(t,r){return"transform"===r&&t.namespaceURI===e.namespaces.svg?n.interpolateTransform:n.interpolate}function a(t){return function(){this.removeAttribute(t)}}function s(t){return function(){this.removeAttributeNS(t.space,t.local)}}function l(t,e){var n,r;return e+="",function(){var i=this.getAttribute(t);return i===e?null:i===n?r:r=u(this,t)(n=i,e)}}function c(t,e){var r,i;return e+="",function(){var o=this.getAttributeNS(t.space,t.local);return o===e?null:o===r?i:i=n.interpolate(r=o,e)}}function f(t,e){var n,r,i;return function(){var o,a=e.apply(this,arguments);return null==a?void this.removeAttribute(t):(o=this.getAttribute(t),a+="",o===a?null:o===n&&a===r?i:i=u(this,t)(n=o,r=a))}}function h(t,e){var r,i,o;return function(){var u,a=e.apply(this,arguments);return null==a?void this.removeAttributeNS(t.space,t.local):(u=this.getAttributeNS(t.space,t.local),a+="",u===a?null:u===r&&a===i?o:o=n.interpolate(r=u,i=a))}}function p(t,n){var r=e.namespace(t);return this.attrTween(t,(null==n?r.local?s:a:"function"==typeof n?r.local?h:f:r.local?c:l)(r,n))}function d(t,e){function n(){var n=this,r=e.apply(n,arguments);return r&&function(e){n.setAttributeNS(t.space,t.local,r(e))}}return n._value=e,n}function _(t,e){function n(){var n=this,r=e.apply(n,arguments);return r&&function(e){n.setAttribute(t,r(e))}}return n._value=e,n}function v(t,n){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if("function"!=typeof n)throw new Error;var i=e.namespace(t);return this.tween(r,(i.local?d:_)(i,n))}function y(t,e,n,r,i,o){var u=t[e];if(u){if(g(t,e,n))return}else t[e]=u={active:null,pending:[]};k(t,e,{id:n,index:r,group:i,on:ut,tweens:at,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:st})}function g(t,e,n){var r=t[e];if(r){var i=r.active;if(i&&i.id===n)return i;for(var o=r.pending,u=o.length;--u>=0;)if((i=o[u]).id===n)return i}}function w(t,e,n){var r=g(t,e,n);if(!r||r.state>st)throw new Error("too late");return r}function m(t,e,n){var r=g(t,e,n);if(!r||r.state>lt)throw new Error("too late");return r}function A(t,e,n){var r=g(t,e,n);if(!r)throw new Error("too late");return r}function k(t,e,n){function r(t){n.state=lt,n.delay<=t?o(t-n.delay):n.timer.restart(o,n.delay,n.time)}function o(e){var r,o,l,c,f=s.active,h=s.pending;for(f&&(f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group)),r=0,o=-1,l=h.length;l>r;++r)c=h[r],c.id<n.id?c.timer.stop():c.id>n.id&&(h[++o]=c);for(h.length=o+1,s.active=n,i.timeout(function(){s.active===n&&(n.timer.restart(u,n.delay,n.time),u(e))}),n.on.call("start",t,t.__data__,n.index,n.group),n.state=ct,a=new Array(l=n.tweens.length),r=0,o=-1;l>r;++r)(c=n.tweens[r].value.call(t,t.__data__,n.index,n.group))&&(a[++o]=c);a.length=o+1}function u(r){var i,o,u=r/n.duration,l=u>=1?1:n.ease.call(null,u);for(i=0,o=a.length;o>i;++i)a[i].call(null,l);u>=1&&(n.on.call("end",t,t.__data__,n.index,n.group),s.active=null,s.pending.length||delete t[e],n.timer.stop())}var a,s=t[e];s.pending.push(n),n.timer=i.timer(r,0,n.time)}function b(t,e,n){return function(){w(this,t,e).delay=+n.apply(this,arguments)}}function x(t,e,n){return n=+n,function(){w(this,t,e).delay=n}}function P(t){var e=this._key,n=this._id;return arguments.length?this.each(("function"==typeof t?b:x)(e,n,t)):A(this.node(),e,n).delay}function E(t,e,n){return function(){m(this,t,e).duration=+n.apply(this,arguments)}}function S(t,e,n){return n=+n,function(){m(this,t,e).duration=n}}function C(t){var e=this._key,n=this._id;return arguments.length?this.each(("function"==typeof t?E:S)(e,n,t)):A(this.node(),e,n).duration}function N(t,e,n){if("function"!=typeof n)throw new Error;return function(){m(this,t,e).ease=n}}function T(t){var e=this._key,n=this._id;return arguments.length?this.each(N(e,n,t)):A(this.node(),e,n).ease}function q(t){"function"!=typeof t&&(t=e.matcher(t));for(var n=this._groups,r=n.length,i=new Array(r),o=0;r>o;++o)for(var u,a=n[o],s=a.length,l=i[o]=new Array(s),c=0;s>c;++c)(u=a[c])&&t.call(u,u.__data__,c,a)&&(l[c]=u);return new $(i,this._parents,this._key,this._id)}function V(t){for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),u=new Array(r),a=0;o>a;++a)for(var s,l=e[a],c=n[a],f=l.length,h=u[a]=new Array(f),p=0;f>p;++p)(s=l[p]||c[p])&&(h[p]=s);for(;r>a;++a)u[a]=e[a];return new $(u,this._parents,this._key,this._id)}function z(t,e,n,r){if("function"!=typeof r)throw new Error;var i,o;return function(){var u=w(this,t,e),a=u.on;a!==i&&(o=(i=a).copy()).on(n,r),u.on=o}}function I(t,e){var n=this._key,r=this._id;return arguments.length<2?A(this.node(),n,r).on.on(t):this.each(z(n,r,t,e))}function j(t){return function(){var e=this.parentNode;e&&!this[t].pending.length&&e.removeChild(this)}}function M(){return this.on("end.remove",j(this._key))}function O(t){var n=this._key,r=this._id;"function"!=typeof t&&(t=e.selector(t));for(var i=this._groups,o=i.length,u=new Array(o),a=0;o>a;++a)for(var s,l,c=i[a],f=c.length,h=u[a]=new Array(f),p=0;f>p;++p)(s=c[p])&&(l=t.call(s,s.__data__,p,c))&&("__data__"in s&&(l.__data__=s.__data__),h[p]=l,y(h[p],n,r,p,h,A(s,n,r)));return new $(u,this._parents,n,r)}function R(t){var n=this._key,r=this._id;"function"!=typeof t&&(t=e.selectorAll(t));for(var i=this._groups,o=i.length,u=[],a=[],s=0;o>s;++s)for(var l,c=i[s],f=c.length,h=0;f>h;++h)if(l=c[h]){for(var p,d=t.call(l,l.__data__,h,c),_=A(l,n,r),v=0,g=d.length;g>v;++v)(p=d[v])&&y(p,n,r,v,d,_);u.push(d),a.push(l)}return new $(i,a,n,r)}function U(){return new ft(this._groups,this._parents)}function B(t){var r,i,o;return function(){var u=e.window(this).getComputedStyle(this,null),a=u.getPropertyValue(t),s=(this.style.removeProperty(t),u.getPropertyValue(t));return a===s?null:a===r&&s===i?o:o=n.interpolate(r=a,i=s)}}function D(t){return function(){this.style.removeProperty(t)}}function F(t,r){var i,o;return r+="",function(){var u=e.window(this).getComputedStyle(this,null).getPropertyValue(t);return u===r?null:u===i?o:o=n.interpolate(i=u,r)}}function G(t,r){var i,o,u;return function(){var a=e.window(this).getComputedStyle(this,null),s=a.getPropertyValue(t),l=r.apply(this,arguments);return null==l?(this.style.removeProperty(t),l=a.getPropertyValue(t)):l+="",s===l?null:s===i&&l===o?u:u=n.interpolate(i=s,o=l)}}function H(t,e,n){return null==e?this.styleTween(t,B(t)).on("end.style."+t,D(t)):this.styleTween(t,("function"==typeof e?G:F)(t,e),n)}function J(t,e,n){function r(){var r=this,i=e.apply(r,arguments);return i&&function(e){r.style.setProperty(t,i(e),n)}}if("function"!=typeof e)throw new Error;return r._value=e,r}function K(t,e,n){var r="style."+t;return arguments.length<2?(r=this.tween(r))&&r._value:this.tween(r,J(t,e,null==n?"":n))}function L(t){return t=null==t?"":t+"",function(){this.textContent=t}}function Q(t){return function(){var e=t.apply(this,arguments);null==e&&(e=""),this.textContent=e}}function W(t){return this.tween("text",("function"==typeof t?Q:L)(t))}function X(){for(var t=this._key,e=this._id,n=et(),r=this._groups,i=r.length,o=0;i>o;++o)for(var u,a=r[o],s=a.length,l=0;s>l;++l)if(u=a[l]){var c=A(u,t,e);y(u,t,n,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new $(r,this._parents,t,n)}function Y(t,e,n,r){var i,o;return function(){var u=m(this,t,e),a=u.tweens;if(a!==i){o=(i=a).slice();for(var s={name:n,value:r},l=0,c=o.length;c>l;++l)if(o[l].name===n){o[l]=s;break}l===c&&o.push(s)}u.tweens=o}}function Z(t,e){var n=this._key,r=this._id;if(t+="",arguments.length<2){for(var i,o=A(this.node(),n,r).tweens,u=0,a=o.length;a>u;++u)if((i=o[u]).name===t)return i.value;return null}if("function"!=typeof e)throw new Error;return this.each(Y(n,r,t,e))}function $(t,e,n,r){this._groups=t,this._parents=e,this._key=n,this._id=r}function tt(t){return e.selection().transition(t)}function et(){return++ht}function nt(t){return t?"__transition"+t:"__transition"}function rt(t){var e=nt(t);return this.each(function(){var t=this[e];if(t){var n,r,i=t.pending,o=t.active;for(o&&(o.on.call("interrupt",this,this.__data__,o.index,o.group),t.active=null,o.timer.stop()),n=0,r=i.length;r>n;++n)i[n].timer.stop();i.length=0,delete this[e]}})}function it(t){var e,n,r;t instanceof $?(e=t._key,n=t._id,r=A(t.node(),e,n)):(e=nt(t),n=et(),(r=dt).time=i.now());for(var o=this._groups,u=o.length,a=0;u>a;++a)for(var s,l=o[a],c=l.length,f=0;c>f;++f)(s=l[f])&&y(s,e,n,f,l,r);return new $(o,this._parents,e,n)}function ot(t,e){var n=nt(e),r=t[n];return r&&(r=r.active)?new $([[t]],_t,n,r.id):null}var ut=r.dispatch("start","end","interrupt"),at=[],st=0,lt=1,ct=2,ft=e.selection.prototype.constructor,ht=0,pt=e.selection.prototype;$.prototype=tt.prototype={constructor:$,select:O,selectAll:R,filter:q,merge:V,selection:U,transition:X,call:pt.call,nodes:pt.nodes,node:pt.node,size:pt.size,empty:pt.empty,each:pt.each,on:I,attr:p,attrTween:v,style:H,styleTween:K,text:W,remove:M,tween:Z,delay:P,duration:C,ease:T};var dt={time:null,delay:0,duration:250,ease:o.easeCubicInOut};e.selection.prototype.interrupt=rt,e.selection.prototype.transition=it;var _t=[null],vt="0.2.0";t.version=vt,t.transition=tt,t.active=ot}); |
{ | ||
"name": "d3-transition", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"description": "Animated transitions for D3 selections.", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"prepublish": "npm run test && uglifyjs build/d3-transition.js -c -m -o build/d3-transition.min.js && rm -f build/d3-transition.zip && zip -j build/d3-transition.zip -- LICENSE README.md build/d3-transition.js build/d3-transition.min.js", | ||
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-transition.js ../d3.github.com/d3-transition.v0.1.js && cp build/d3-transition.min.js ../d3.github.com/d3-transition.v0.1.min.js && cd ../d3.github.com && git add d3-transition.v0.1.js d3-transition.v0.1.min.js && git commit -m \"d3-transition ${VERSION}\" && git push" | ||
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-transition.js ../d3.github.com/d3-transition.v0.2.js && cp build/d3-transition.min.js ../d3.github.com/d3-transition.v0.2.min.js && cd ../d3.github.com && git add d3-transition.v0.2.js d3-transition.v0.2.min.js && git commit -m \"d3-transition ${VERSION}\" && git push" | ||
}, | ||
@@ -34,3 +34,3 @@ "dependencies": { | ||
"d3-interpolate": "~0.5.0", | ||
"d3-selection": "~0.6.10", | ||
"d3-selection": "~0.7.0", | ||
"d3-timer": "~0.4.0" | ||
@@ -37,0 +37,0 @@ }, |
@@ -30,3 +30,3 @@ # d3-transition | ||
<script src="https://d3js.org/d3-interpolate.v0.5.min.js"></script> | ||
<script src="https://d3js.org/d3-selection.v0.6.min.js"></script> | ||
<script src="https://d3js.org/d3-selection.v0.7.min.js"></script> | ||
<script src="https://d3js.org/d3-timer.v0.4.min.js"></script> | ||
@@ -77,2 +77,6 @@ <script src="https://d3js.org/d3-transition.v0.1.min.js"></script> | ||
<a name="transition_merge" href="#transition_merge">#</a> <i>transition</i>.<b>merge</b>(<i>selection</i>) | ||
Returns a new transition merging this transition with the specified *selection* (or *transition*). The returned transition has the same number of groups, the same parents, the same name and the same id as this transition. Any missing (null) elements in this transition are filled with the corresponding element, if present (not null), from the specified *selection*. See [*selection*.merge](https://github.com/d3/d3-selection#selection_merge) for more information. | ||
<a name="transition_transition" href="#transition_transition">#</a> <i>transition</i>.<b>transition</b>() | ||
@@ -82,2 +86,6 @@ | ||
<a name="transition_selection" href="#transition_selection">#</a> <i>transition</i>.<b>selection</b>() | ||
Returns the [selection](https://github.com/d3/d3-selection#selection) corresponding to this transition. | ||
<a name="active" href="#active">#</a> d3.<b>active</b>(<i>node</i>[, <i>name</i>]) | ||
@@ -84,0 +92,0 @@ |
@@ -8,5 +8,5 @@ import {matcher} from "d3-selection"; | ||
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { | ||
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { | ||
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, i = 0; i < n; ++i) { | ||
if ((node = group[i]) && match.call(node, node.__data__, i, group)) { | ||
subgroup.push(node); | ||
subgroup[i] = node; | ||
} | ||
@@ -13,0 +13,0 @@ } |
@@ -8,2 +8,3 @@ import {selection} from "d3-selection"; | ||
import transition_filter from "./filter"; | ||
import transition_merge from "./merge"; | ||
import transition_on from "./on"; | ||
@@ -13,2 +14,3 @@ import transition_remove from "./remove"; | ||
import transition_selectAll from "./selectAll"; | ||
import transition_selection from "./selection"; | ||
import transition_style from "./style"; | ||
@@ -48,2 +50,4 @@ import transition_styleTween from "./styleTween"; | ||
filter: transition_filter, | ||
merge: transition_merge, | ||
selection: transition_selection, | ||
transition: transition_transition, | ||
@@ -50,0 +54,0 @@ call: selection_prototype.call, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67250
32
1259
171
+ Addedd3-selection@0.7.3(transitive)
- Removedd3-selection@0.6.12(transitive)
Updatedd3-selection@~0.7.0