d3-transition
Advanced tools
Comparing version 0.3.1 to 1.0.0
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-transition/ Version 0.3.1. Copyright 2016 Mike Bostock. | ||
// https://d3js.org/d3-transition/ Version 1.0.0. Copyright 2016 Mike Bostock. | ||
(function (global, factory) { | ||
@@ -427,5 +427,5 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-selection'), require('d3-dispatch'), require('d3-timer'), require('d3-interpolate'), require('d3-color'), require('d3-ease')) : | ||
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] = new Array(n), node, i = 0; i < n; ++i) { | ||
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { | ||
if ((node = group[i]) && match.call(node, node.__data__, i, group)) { | ||
subgroup[i] = node; | ||
subgroup.push(node); | ||
} | ||
@@ -432,0 +432,0 @@ } |
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-transition/ Version 0.3.1. Copyright 2016 Mike Bostock. | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-selection"),require("d3-dispatch"),require("d3-timer"),require("d3-interpolate"),require("d3-color"),require("d3-ease")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-dispatch","d3-timer","d3-interpolate","d3-color","d3-ease"],n):n(t.d3=t.d3||{},t.d3,t.d3,t.d3,t.d3,t.d3,t.d3)}(this,function(t,n,e,r,i,o,u){"use strict";function a(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};c(t,e,{name:n,index:r,group:i,on:ft,tween:ct,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:ht})}function l(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>ht)throw new Error("too late");return e}function s(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>pt)throw new Error("too late");return e}function f(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("too late");return e}function c(t,n,e){function i(t){e.state=dt,e.delay<=t?o(t-e.delay):e.timer.restart(o,e.delay,e.time)}function o(i){var o,s,f,c;for(o in l)c=l[o],c.name===e.name&&(c.state===_t?(c.state=yt,c.timer.stop(),c.on.call("interrupt",t,t.__data__,c.index,c.group),delete l[o]):n>+o&&(c.state=yt,c.timer.stop(),delete l[o]));if(r.timeout(function(){e.state===_t&&(e.timer.restart(u,e.delay,e.time),u(i))}),e.state=pt,e.on.call("start",t,t.__data__,e.index,e.group),e.state===pt){for(e.state=_t,a=new Array(f=e.tween.length),o=0,s=-1;f>o;++o)(c=e.tween[o].value.call(t,t.__data__,e.index,e.group))&&(a[++s]=c);a.length=s+1}}function u(r){for(var i=r<e.duration?e.ease.call(null,r/e.duration):(e.state=vt,1),o=-1,u=a.length;++o<u;)a[o].call(null,i);if(e.state===vt){e.state=yt,e.timer.stop(),e.on.call("end",t,t.__data__,e.index,e.group);for(o in l)if(+o!==n)return void delete l[n];delete t.__transition}}var a,l=t.__transition;l[n]=e,e.timer=r.timer(i,0,e.time)}function h(t,n){var e,r,i,o=t.__transition,u=!0;if(o){n=null==n?null:n+"";for(i in o)(e=o[i]).name===n?(r=e.state===_t,e.state=yt,e.timer.stop(),r&&e.on.call("interrupt",t,t.__data__,e.index,e.group),delete o[i]):u=!1;u&&delete t.__transition}}function d(t){return this.each(function(){h(this,t)})}function p(t,n){var e,r;return function(){var i=s(this,t),o=i.tween;if(o!==e){r=e=o;for(var u=0,a=r.length;a>u;++u)if(r[u].name===n){r=r.slice(),r.splice(u,1);break}}i.tween=r}}function _(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=s(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},l=0,f=i.length;f>l;++l)if(i[l].name===n){i[l]=a;break}l===f&&i.push(a)}o.tween=i}}function v(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=f(this.node(),e).tween,o=0,u=i.length;u>o;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?p:_)(e,t,n))}function y(t,n,e){var r=t._id;return t.each(function(){var t=s(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)}),function(t){return f(t,r).value[n]}}function m(t,n){var e;return("number"==typeof n?i.interpolateNumber:n instanceof o.color?i.interpolateRgb:(e=o.color(n))?(n=e,i.interpolateRgb):i.interpolateString)(t,n)}function w(t){return function(){this.removeAttribute(t)}}function g(t){return function(){this.removeAttributeNS(t.space,t.local)}}function b(t,n,e){var r,i;return function(){var o=this.getAttribute(t);return o===e?null:o===r?i:i=n(r=o,e)}}function A(t,n,e){var r,i;return function(){var o=this.getAttributeNS(t.space,t.local);return o===e?null:o===r?i:i=n(r=o,e)}}function x(t,n,e){var r,i,o;return function(){var u,a=e(this);return null==a?void this.removeAttribute(t):(u=this.getAttribute(t),u===a?null:u===r&&a===i?o:o=n(r=u,i=a))}}function P(t,n,e){var r,i,o;return function(){var u,a=e(this);return null==a?void this.removeAttributeNS(t.space,t.local):(u=this.getAttributeNS(t.space,t.local),u===a?null:u===r&&a===i?o:o=n(r=u,i=a))}}function S(t,e){var r=n.namespace(t),o="transform"===r?i.interpolateTransformSvg:m;return this.attrTween(t,"function"==typeof e?(r.local?P:x)(r,o,y(this,"attr."+t,e)):null==e?(r.local?g:w)(r):(r.local?A:b)(r,o,e))}function C(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}function E(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e}function N(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;var i=n.namespace(t);return this.tween(r,(i.local?C:E)(i,e))}function T(t,n){return function(){l(this,t).delay=+n.apply(this,arguments)}}function q(t,n){return n=+n,function(){l(this,t).delay=n}}function V(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?T:q)(n,t)):f(this.node(),n).delay}function O(t,n){return function(){s(this,t).duration=+n.apply(this,arguments)}}function j(t,n){return n=+n,function(){s(this,t).duration=n}}function k(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?O:j)(n,t)):f(this.node(),n).duration}function z(t,n){if("function"!=typeof n)throw new Error;return function(){s(this,t).ease=n}}function M(t){var n=this._id;return arguments.length?this.each(z(n,t)):f(this.node(),n).ease}function R(t){"function"!=typeof t&&(t=n.matcher(t));for(var e=this._groups,r=e.length,i=new Array(r),o=0;r>o;++o)for(var u,a=e[o],l=a.length,s=i[o]=new Array(l),f=0;l>f;++f)(u=a[f])&&t.call(u,u.__data__,f,a)&&(s[f]=u);return new it(i,this._parents,this._name,this._id)}function I(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;o>a;++a)for(var l,s=n[a],f=e[a],c=s.length,h=u[a]=new Array(c),d=0;c>d;++d)(l=s[d]||f[d])&&(h[d]=l);for(;r>a;++a)u[a]=n[a];return new it(u,this._parents,this._name,this._id)}function B(t){return(t+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t})}function D(t,n,e){var r,i,o=B(n)?l:s;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}function F(t,n){var e=this._id;return arguments.length<2?f(this.node(),e).on.on(t):this.each(D(e,t,n))}function G(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function H(){return this.on("end.remove",G(this._id))}function J(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=n.selector(t));for(var i=this._groups,o=i.length,u=new Array(o),l=0;o>l;++l)for(var s,c,h=i[l],d=h.length,p=u[l]=new Array(d),_=0;d>_;++_)(s=h[_])&&(c=t.call(s,s.__data__,_,h))&&("__data__"in s&&(c.__data__=s.__data__),p[_]=c,a(p[_],e,r,_,p,f(s,r)));return new it(u,this._parents,e,r)}function K(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=n.selectorAll(t));for(var i=this._groups,o=i.length,u=[],l=[],s=0;o>s;++s)for(var c,h=i[s],d=h.length,p=0;d>p;++p)if(c=h[p]){for(var _,v=t.call(c,c.__data__,p,h),y=f(c,r),m=0,w=v.length;w>m;++m)(_=v[m])&&a(_,e,r,m,v,y);u.push(v),l.push(c)}return new it(u,l,e,r)}function L(){return new mt(this._groups,this._parents)}function Q(t,e){var r,i,o;return function(){var u=n.window(this).getComputedStyle(this,null),a=u.getPropertyValue(t),l=(this.style.removeProperty(t),u.getPropertyValue(t));return a===l?null:a===r&&l===i?o:o=e(r=a,i=l)}}function U(t){return function(){this.style.removeProperty(t)}}function W(t,e,r){var i,o;return function(){var u=n.window(this).getComputedStyle(this,null).getPropertyValue(t);return u===r?null:u===i?o:o=e(i=u,r)}}function X(t,e,r){var i,o,u;return function(){var a=n.window(this).getComputedStyle(this,null),l=a.getPropertyValue(t),s=r(this);return null==s&&(this.style.removeProperty(t),s=a.getPropertyValue(t)),l===s?null:l===i&&s===o?u:u=e(i=l,o=s)}}function Y(t,n,e){var r="transform"==(t+="")?i.interpolateTransformCss:m;return null==n?this.styleTween(t,Q(t,r)).on("end.style."+t,U(t)):this.styleTween(t,"function"==typeof n?X(t,r,y(this,"style."+t,n)):W(t,r,n),e)}function Z(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}function $(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,Z(t,n,null==e?"":e))}function tt(t){return function(){this.textContent=t}}function nt(t){return function(){var n=t(this);this.textContent=null==n?"":n}}function et(t){return this.tween("text","function"==typeof t?nt(y(this,"text",t)):tt(null==t?"":t+""))}function rt(){for(var t=this._name,n=this._id,e=ut(),r=this._groups,i=r.length,o=0;i>o;++o)for(var u,l=r[o],s=l.length,c=0;s>c;++c)if(u=l[c]){var h=f(u,n);a(u,t,e,c,l,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new it(r,this._parents,t,e)}function it(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function ot(t){return n.selection().transition(t)}function ut(){return++wt}function at(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return bt.time=r.now(),bt;return e}function lt(t){var n,e;t instanceof it?(n=t._id,t=t._name):(n=ut(),(e=bt).time=r.now(),t=null==t?null:t+"");for(var i=this._groups,o=i.length,u=0;o>u;++u)for(var l,s=i[u],f=s.length,c=0;f>c;++c)(l=s[c])&&a(l,t,n,c,s,e||at(l,n));return new it(i,this._parents,t,n)}function st(t,n){var e,r,i=t.__transition;if(i){n=null==n?null:n+"";for(r in i)if((e=i[r]).state>dt&&e.name===n)return new it([[t]],At,n,+r)}return null}var ft=e.dispatch("start","end","interrupt"),ct=[],ht=0,dt=1,pt=2,_t=3,vt=4,yt=5,mt=n.selection.prototype.constructor,wt=0,gt=n.selection.prototype;it.prototype=ot.prototype={constructor:it,select:J,selectAll:K,filter:R,merge:I,selection:L,transition:rt,call:gt.call,nodes:gt.nodes,node:gt.node,size:gt.size,empty:gt.empty,each:gt.each,on:F,attr:S,attrTween:N,style:Y,styleTween:$,text:et,remove:H,tween:v,delay:V,duration:k,ease:M};var bt={time:null,delay:0,duration:250,ease:u.easeCubicInOut};n.selection.prototype.interrupt=d,n.selection.prototype.transition=lt;var At=[null];t.transition=ot,t.active=st,t.interrupt=h,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
// https://d3js.org/d3-transition/ Version 1.0.0. Copyright 2016 Mike Bostock. | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-selection"),require("d3-dispatch"),require("d3-timer"),require("d3-interpolate"),require("d3-color"),require("d3-ease")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-dispatch","d3-timer","d3-interpolate","d3-color","d3-ease"],n):n(t.d3=t.d3||{},t.d3,t.d3,t.d3,t.d3,t.d3,t.d3)}(this,function(t,n,e,r,i,o,u){"use strict";function a(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};c(t,e,{name:n,index:r,group:i,on:ft,tween:ct,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:ht})}function s(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>ht)throw new Error("too late");return e}function l(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>pt)throw new Error("too late");return e}function f(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("too late");return e}function c(t,n,e){function i(t){e.state=dt,e.delay<=t?o(t-e.delay):e.timer.restart(o,e.delay,e.time)}function o(i){var o,l,f,c;for(o in s)c=s[o],c.name===e.name&&(c.state===_t?(c.state=yt,c.timer.stop(),c.on.call("interrupt",t,t.__data__,c.index,c.group),delete s[o]):+o<n&&(c.state=yt,c.timer.stop(),delete s[o]));if(r.timeout(function(){e.state===_t&&(e.timer.restart(u,e.delay,e.time),u(i))}),e.state=pt,e.on.call("start",t,t.__data__,e.index,e.group),e.state===pt){for(e.state=_t,a=new Array(f=e.tween.length),o=0,l=-1;o<f;++o)(c=e.tween[o].value.call(t,t.__data__,e.index,e.group))&&(a[++l]=c);a.length=l+1}}function u(r){for(var i=r<e.duration?e.ease.call(null,r/e.duration):(e.state=vt,1),o=-1,u=a.length;++o<u;)a[o].call(null,i);if(e.state===vt){e.state=yt,e.timer.stop(),e.on.call("end",t,t.__data__,e.index,e.group);for(o in s)if(+o!==n)return void delete s[n];delete t.__transition}}var a,s=t.__transition;s[n]=e,e.timer=r.timer(i,0,e.time)}function h(t,n){var e,r,i,o=t.__transition,u=!0;if(o){n=null==n?null:n+"";for(i in o)(e=o[i]).name===n?(r=e.state===_t,e.state=yt,e.timer.stop(),r&&e.on.call("interrupt",t,t.__data__,e.index,e.group),delete o[i]):u=!1;u&&delete t.__transition}}function d(t){return this.each(function(){h(this,t)})}function p(t,n){var e,r;return function(){var i=l(this,t),o=i.tween;if(o!==e){r=e=o;for(var u=0,a=r.length;u<a;++u)if(r[u].name===n){r=r.slice(),r.splice(u,1);break}}i.tween=r}}function _(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=l(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},s=0,f=i.length;s<f;++s)if(i[s].name===n){i[s]=a;break}s===f&&i.push(a)}o.tween=i}}function v(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=f(this.node(),e).tween,o=0,u=i.length;o<u;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?p:_)(e,t,n))}function y(t,n,e){var r=t._id;return t.each(function(){var t=l(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)}),function(t){return f(t,r).value[n]}}function m(t,n){var e;return("number"==typeof n?i.interpolateNumber:n instanceof o.color?i.interpolateRgb:(e=o.color(n))?(n=e,i.interpolateRgb):i.interpolateString)(t,n)}function g(t){return function(){this.removeAttribute(t)}}function w(t){return function(){this.removeAttributeNS(t.space,t.local)}}function b(t,n,e){var r,i;return function(){var o=this.getAttribute(t);return o===e?null:o===r?i:i=n(r=o,e)}}function A(t,n,e){var r,i;return function(){var o=this.getAttributeNS(t.space,t.local);return o===e?null:o===r?i:i=n(r=o,e)}}function x(t,n,e){var r,i,o;return function(){var u,a=e(this);return null==a?void this.removeAttribute(t):(u=this.getAttribute(t),u===a?null:u===r&&a===i?o:o=n(r=u,i=a))}}function P(t,n,e){var r,i,o;return function(){var u,a=e(this);return null==a?void this.removeAttributeNS(t.space,t.local):(u=this.getAttributeNS(t.space,t.local),u===a?null:u===r&&a===i?o:o=n(r=u,i=a))}}function S(t,e){var r=n.namespace(t),o="transform"===r?i.interpolateTransformSvg:m;return this.attrTween(t,"function"==typeof e?(r.local?P:x)(r,o,y(this,"attr."+t,e)):null==e?(r.local?w:g)(r):(r.local?A:b)(r,o,e))}function C(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}function E(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e}function N(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;var i=n.namespace(t);return this.tween(r,(i.local?C:E)(i,e))}function T(t,n){return function(){s(this,t).delay=+n.apply(this,arguments)}}function q(t,n){return n=+n,function(){s(this,t).delay=n}}function V(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?T:q)(n,t)):f(this.node(),n).delay}function O(t,n){return function(){l(this,t).duration=+n.apply(this,arguments)}}function j(t,n){return n=+n,function(){l(this,t).duration=n}}function k(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?O:j)(n,t)):f(this.node(),n).duration}function z(t,n){if("function"!=typeof n)throw new Error;return function(){l(this,t).ease=n}}function M(t){var n=this._id;return arguments.length?this.each(z(n,t)):f(this.node(),n).ease}function R(t){"function"!=typeof t&&(t=n.matcher(t));for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o)for(var u,a=e[o],s=a.length,l=i[o]=[],f=0;f<s;++f)(u=a[f])&&t.call(u,u.__data__,f,a)&&l.push(u);return new it(i,this._parents,this._name,this._id)}function I(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,l=n[a],f=e[a],c=l.length,h=u[a]=new Array(c),d=0;d<c;++d)(s=l[d]||f[d])&&(h[d]=s);for(;a<r;++a)u[a]=n[a];return new it(u,this._parents,this._name,this._id)}function B(t){return(t+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t})}function D(t,n,e){var r,i,o=B(n)?s:l;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}function F(t,n){var e=this._id;return arguments.length<2?f(this.node(),e).on.on(t):this.each(D(e,t,n))}function G(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function H(){return this.on("end.remove",G(this._id))}function J(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=n.selector(t));for(var i=this._groups,o=i.length,u=new Array(o),s=0;s<o;++s)for(var l,c,h=i[s],d=h.length,p=u[s]=new Array(d),_=0;_<d;++_)(l=h[_])&&(c=t.call(l,l.__data__,_,h))&&("__data__"in l&&(c.__data__=l.__data__),p[_]=c,a(p[_],e,r,_,p,f(l,r)));return new it(u,this._parents,e,r)}function K(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=n.selectorAll(t));for(var i=this._groups,o=i.length,u=[],s=[],l=0;l<o;++l)for(var c,h=i[l],d=h.length,p=0;p<d;++p)if(c=h[p]){for(var _,v=t.call(c,c.__data__,p,h),y=f(c,r),m=0,g=v.length;m<g;++m)(_=v[m])&&a(_,e,r,m,v,y);u.push(v),s.push(c)}return new it(u,s,e,r)}function L(){return new mt(this._groups,this._parents)}function Q(t,e){var r,i,o;return function(){var u=n.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=e(r=a,i=s)}}function U(t){return function(){this.style.removeProperty(t)}}function W(t,e,r){var i,o;return function(){var u=n.window(this).getComputedStyle(this,null).getPropertyValue(t);return u===r?null:u===i?o:o=e(i=u,r)}}function X(t,e,r){var i,o,u;return function(){var a=n.window(this).getComputedStyle(this,null),s=a.getPropertyValue(t),l=r(this);return null==l&&(this.style.removeProperty(t),l=a.getPropertyValue(t)),s===l?null:s===i&&l===o?u:u=e(i=s,o=l)}}function Y(t,n,e){var r="transform"==(t+="")?i.interpolateTransformCss:m;return null==n?this.styleTween(t,Q(t,r)).on("end.style."+t,U(t)):this.styleTween(t,"function"==typeof n?X(t,r,y(this,"style."+t,n)):W(t,r,n),e)}function Z(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}function $(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,Z(t,n,null==e?"":e))}function tt(t){return function(){this.textContent=t}}function nt(t){return function(){var n=t(this);this.textContent=null==n?"":n}}function et(t){return this.tween("text","function"==typeof t?nt(y(this,"text",t)):tt(null==t?"":t+""))}function rt(){for(var t=this._name,n=this._id,e=ut(),r=this._groups,i=r.length,o=0;o<i;++o)for(var u,s=r[o],l=s.length,c=0;c<l;++c)if(u=s[c]){var h=f(u,n);a(u,t,e,c,s,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new it(r,this._parents,t,e)}function it(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function ot(t){return n.selection().transition(t)}function ut(){return++gt}function at(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return bt.time=r.now(),bt;return e}function st(t){var n,e;t instanceof it?(n=t._id,t=t._name):(n=ut(),(e=bt).time=r.now(),t=null==t?null:t+"");for(var i=this._groups,o=i.length,u=0;u<o;++u)for(var s,l=i[u],f=l.length,c=0;c<f;++c)(s=l[c])&&a(s,t,n,c,l,e||at(s,n));return new it(i,this._parents,t,n)}function lt(t,n){var e,r,i=t.__transition;if(i){n=null==n?null:n+"";for(r in i)if((e=i[r]).state>dt&&e.name===n)return new it([[t]],At,n,(+r))}return null}var ft=e.dispatch("start","end","interrupt"),ct=[],ht=0,dt=1,pt=2,_t=3,vt=4,yt=5,mt=n.selection.prototype.constructor,gt=0,wt=n.selection.prototype;it.prototype=ot.prototype={constructor:it,select:J,selectAll:K,filter:R,merge:I,selection:L,transition:rt,call:wt.call,nodes:wt.nodes,node:wt.node,size:wt.size,empty:wt.empty,each:wt.each,on:F,attr:S,attrTween:N,style:Y,styleTween:$,text:et,remove:H,tween:v,delay:V,duration:k,ease:M};var bt={time:null,delay:0,duration:250,ease:u.easeCubicInOut};n.selection.prototype.interrupt=d,n.selection.prototype.transition=st;var At=[null];t.transition=ot,t.active=lt,t.interrupt=h,Object.defineProperty(t,"__esModule",{value:!0})}); |
{ | ||
"name": "d3-transition", | ||
"version": "0.3.1", | ||
"version": "1.0.0", | ||
"description": "Animated transitions for D3 selections.", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"prepublish": "npm run test && uglifyjs --preamble \"$(preamble)\" build/d3-transition.js -c -m -o 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.3.js && cp build/d3-transition.min.js ../d3.github.com/d3-transition.v0.3.min.js && cd ../d3.github.com && git add d3-transition.v0.3.js d3-transition.v0.3.min.js && git commit -m \"d3-transition ${VERSION}\" && git push && cd - && 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.v1.js && cp build/d3-transition.min.js ../d3.github.com/d3-transition.v1.min.js && cd ../d3.github.com && git add d3-transition.v1.js d3-transition.v1.min.js && git commit -m \"d3-transition ${VERSION}\" && git push && cd - && zip -j build/d3-transition.zip -- LICENSE README.md build/d3-transition.js build/d3-transition.min.js" | ||
}, | ||
@@ -36,3 +36,3 @@ "dependencies": { | ||
"d3-interpolate": "1", | ||
"d3-selection": "~0.9.0", | ||
"d3-selection": "1", | ||
"d3-timer": "1" | ||
@@ -43,3 +43,3 @@ }, | ||
"package-preamble": "0.0", | ||
"rollup": "0.31", | ||
"rollup": "0.33", | ||
"jsdom": "9", | ||
@@ -46,0 +46,0 @@ "tape": "4", |
@@ -19,3 +19,3 @@ # d3-transition | ||
If you use NPM, `npm install d3-transition`. Otherwise, download the [latest release](https://github.com/d3/d3-transition/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-transition.v0.3.min.js) or as part of [D3 4.0](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported: | ||
If you use NPM, `npm install d3-transition`. Otherwise, download the [latest release](https://github.com/d3/d3-transition/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-transition.v1.min.js) or as part of [D3 4.0](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported: | ||
@@ -27,5 +27,5 @@ ```html | ||
<script src="https://d3js.org/d3-interpolate.v1.min.js"></script> | ||
<script src="https://d3js.org/d3-selection.v0.9.min.js"></script> | ||
<script src="https://d3js.org/d3-selection.v1.min.js"></script> | ||
<script src="https://d3js.org/d3-timer.v1.min.js"></script> | ||
<script src="https://d3js.org/d3-transition.v0.3.min.js"></script> | ||
<script src="https://d3js.org/d3-transition.v1.min.js"></script> | ||
<script> | ||
@@ -32,0 +32,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] = new Array(n), node, i = 0; i < n; ++i) { | ||
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { | ||
if ((node = group[i]) && match.call(node, node.__data__, i, group)) { | ||
subgroup[i] = node; | ||
subgroup.push(node); | ||
} | ||
@@ -13,0 +13,0 @@ } |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
95810
+ Addedd3-selection@1.4.2(transitive)
- Removedd3-selection@0.9.0(transitive)
Updatedd3-selection@1