Comparing version 0.6.1 to 0.6.2
@@ -1,1 +0,1 @@ | ||
var version = "0.6.1"; export * from "../index"; export {version}; | ||
var version = "0.6.2"; export * from "../index"; export {version}; |
@@ -618,7 +618,7 @@ (function (global, factory) { | ||
if (arguments.length === 1) { | ||
while (++i < n) if (!isNaN(a = +array[i])) s += a; // Note: zero and null are equivalent. | ||
while (++i < n) if (a = +array[i]) s += a; // Note: zero and null are equivalent. | ||
} | ||
else { | ||
while (++i < n) if (!isNaN(a = +f(array[i], i, array))) s += a; | ||
while (++i < n) if (a = +f(array[i], i, array)) s += a; | ||
} | ||
@@ -653,3 +653,3 @@ | ||
var version = "0.6.1"; | ||
var version = "0.6.2"; | ||
@@ -656,0 +656,0 @@ exports.version = version; |
@@ -1,1 +0,1 @@ | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define("d3-array",["exports"],r):r(n.d3_array={})}(this,function(n){"use strict";function r(n,r){return r>n?-1:n>r?1:n>=r?0:NaN}function t(n){return 1===n.length&&(n=e(n)),{left:function(r,t,e,u){for(arguments.length<3&&(e=0),arguments.length<4&&(u=r.length);u>e;){var i=e+u>>>1;n(r[i],t)<0?e=i+1:u=i}return e},right:function(r,t,e,u){for(arguments.length<3&&(e=0),arguments.length<4&&(u=r.length);u>e;){var i=e+u>>>1;n(r[i],t)>0?u=i:e=i+1}return e}}}function e(n){return function(t,e){return r(n(t),e)}}function u(n,r){return n>r?-1:r>n?1:r>=n?0:NaN}function i(n){return null===n?NaN:+n}function o(n,r){var t,e,u=n.length,o=0,a=0,f=-1,s=0;if(1===arguments.length)for(;++f<u;)isNaN(t=i(n[f]))||(e=t-o,o+=e/++s,a+=e*(t-o));else for(;++f<u;)isNaN(t=i(r(n[f],f,n)))||(e=t-o,o+=e/++s,a+=e*(t-o));return s>1?a/(s-1):void 0}function a(){var n=o.apply(this,arguments);return n?Math.sqrt(n):n}function f(n){var r=[];for(var t in n)r.push({key:t,value:n[t]});return r}function s(n,r){var t,e,u,i=-1,o=n.length;if(1===arguments.length){for(;++i<o;)if(null!=(e=n[i])&&e>=e){t=u=e;break}for(;++i<o;)null!=(e=n[i])&&(t>e&&(t=e),e>u&&(u=e))}else{for(;++i<o;)if(null!=(e=r(n[i],i,n))&&e>=e){t=u=e;break}for(;++i<o;)null!=(e=r(n[i],i,n))&&(t>e&&(t=e),e>u&&(u=e))}return[t,u]}function h(n){return function(){return n}}function l(n){return n}function c(n,r,t){(u=arguments.length)<3&&(t=1,2>u&&(r=n,n=0));for(var e=-1,u=0|Math.max(0,Math.ceil((r-n)/t)),i=new Array(u);++e<u;)i[e]=n+e*t;return i}function g(n,r,t){var e=v(n,r,t);return c(Math.ceil(n/e)*e,Math.floor(r/e)*e+e/2,e)}function v(n,r,t){var e=Math.abs(r-n)/Math.max(0,t),u=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),i=e/u;return i>=T?u*=10:i>=U?u*=5:i>=W&&(u*=2),n>r?-u:u}function p(n){return Math.ceil(Math.log(n.length)/Math.LN2)+1}function m(n){return+n}function y(){function n(n){var u,i,o=n.length,a=new Array(o);for(u=0;o>u;++u)a[u]=+r(n[u],u,n);var f=t(a),s=+f[0],h=+f[1],l=e(a,s,h);Array.isArray(l)||(l=g(s,h,+l));var c=l.length;for(u=0;c>u;++u)l[u]=+l[u];for(;l[0]<=s;)l.shift(),--c;for(;l[c-1]>=h;)l.pop(),--c;var v,p=new Array(c+1);for(u=0;c>=u;++u)v=p[u]=[],v.x0=u>0?l[u-1]:s,v.x1=c>u?l[u]:h;for(u=0;o>u;++u)i=a[u],i>=s&&h>=i&&p[P(l,i,0,c)].push(n[u]);return p}var r=l,t=s,e=p;return n.value=function(t){return arguments.length?(r="function"==typeof t?t:h(+t),n):r},n.domain=function(r){return arguments.length?(t="function"==typeof r?r:h([+r[0],+r[1]]),n):t},n.thresholds=function(r){return arguments.length?(e="function"==typeof r?r:h(Array.isArray(r)?Array.prototype.map.call(r,m):+r),n):e},n}function d(n,r,t){if(arguments.length<3&&(t=i),e=n.length){if((r=+r)<=0||2>e)return+t(n[0],0,n);if(r>=1)return+t(n[e-1],e-1,n);var e,u=(e-1)*r,o=Math.floor(u),a=+t(n[o],o,n),f=+t(n[o+1],o+1,n);return a+(f-a)*(u-o)}}function N(n,t,e){return n.sort(r),Math.ceil((e-t)/(2*(d(n,.75)-d(n,.25))*Math.pow(n.length,-1/3)))}function M(n,r,t){return Math.ceil((t-r)/(3.5*a(n)*Math.pow(n.length,-1/3)))}function k(n){var r=[];for(var t in n)r.push(t);return r}function A(){}function b(n,r){var t=new A;if(n instanceof A)n.each(function(n,r){t.set(r,n)});else if(Array.isArray(n)){var e,u=-1,i=n.length;if(1===arguments.length)for(;++u<i;)t.set(u,n[u]);else for(;++u<i;)t.set(r(e=n[u],u,n),e)}else if(n)for(var o in n)t.set(o,n[o]);return t}function w(n,r){var t,e,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(e=n[u])&&e>=e){t=e;break}for(;++u<i;)null!=(e=n[u])&&e>t&&(t=e)}else{for(;++u<i;)if(null!=(e=r(n[u],u,n))&&e>=e){t=e;break}for(;++u<i;)null!=(e=r(n[u],u,n))&&e>t&&(t=e)}return t}function x(n,r){var t,e=0,u=n.length,o=-1,a=u;if(1===arguments.length)for(;++o<u;)isNaN(t=i(n[o]))?--a:e+=t;else for(;++o<u;)isNaN(t=i(r(n[o],o,n)))?--a:e+=t;return a?e/a:void 0}function q(n,t){var e,u=[],o=n.length,a=-1;if(1===arguments.length)for(;++a<o;)isNaN(e=i(n[a]))||u.push(e);else for(;++a<o;)isNaN(e=i(t(n[a],a,n)))||u.push(e);return d(u.sort(r),.5)}function z(n){for(var r,t,e,u=n.length,i=-1,o=0;++i<u;)o+=n[i].length;for(t=new Array(o);--u>=0;)for(e=n[u],r=e.length;--r>=0;)t[--o]=e[r];return t}function L(n,r){var t,e,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(e=n[u])&&e>=e){t=e;break}for(;++u<i;)null!=(e=n[u])&&t>e&&(t=e)}else{for(;++u<i;)if(null!=(e=r(n[u],u,n))&&e>=e){t=e;break}for(;++u<i;)null!=(e=r(n[u],u,n))&&t>e&&(t=e)}return t}function S(){function n(r,u,o,a){if(u>=i.length)return e?e(r):t?r.sort(t):r;for(var f,s,h,l=-1,c=r.length,g=i[u++],v=b(),p=o();++l<c;)(h=v.get(f=g(s=r[l])+""))?h.push(s):v.set(f,[s]);return v.each(function(r,t){a(p,t,n(r,u,o,a))}),p}function r(n,t){if(t>=i.length)return n;var e=[],u=o[t++];return n.each(function(n,u){e.push({key:u,values:r(n,t)})}),u?e.sort(function(n,r){return u(n.key,r.key)}):e}var t,e,u,i=[],o=[];return u={object:function(r){return n(r,0,j,D)},map:function(r){return n(r,0,F,K)},entries:function(t){return r(n(t,0,F,K),0)},key:function(n){return i.push(n),u},sortKeys:function(n){return o[i.length-1]=n,u},sortValues:function(n){return t=n,u},rollup:function(n){return e=n,u}}}function j(){return{}}function D(n,r,t){n[r]=t}function F(){return b()}function K(n,r,t){n.set(r,t)}function R(n){for(var r,t=0,e=n.length-1,u=n[0],i=new Array(0>e?0:e);e>t;)i[t]=[r=u,u=n[++t]];return i}function V(n,r){for(var t=r.length,e=new Array(t);t--;)e[t]=n[r[t]];return e}function $(n,t){if(e=n.length){var e,u,i=0,o=0,a=n[o];for(t||(t=r);++i<e;)(t(u=n[i],a)<0||0!==t(a,a))&&(a=u,o=i);return 0===t(a,a)?o:void 0}}function _(){}function B(n,r){var t=new _;if(n instanceof _)n.each(function(n){t.add(n)});else if(n){var e,u=-1,i=n.length;if(1===arguments.length)for(;++u<i;)t.add(n[u]);else for(;++u<i;)t.add(r(e=n[u],u,n))}return t}function C(n,r,t){(i=arguments.length)<3&&(t=n.length,2>i&&(r=0));for(var e,u,i=t-r;i;)u=Math.random()*i--|0,e=n[i+r],n[i+r]=n[u+r],n[u+r]=e;return n}function E(n,r){var t,e=0,u=n.length,i=-1;if(1===arguments.length)for(;++i<u;)isNaN(t=+n[i])||(e+=t);else for(;++i<u;)isNaN(t=+r(n[i],i,n))||(e+=t);return e}function G(n){if(!(u=n.length))return[];for(var r=-1,t=L(n,H),e=new Array(t);++r<t;)for(var u,i=-1,o=e[r]=new Array(u);++i<u;)o[i]=n[i][r];return e}function H(n){return n.length}function I(n){var r=[];for(var t in n)r.push(n[t]);return r}function J(){return G(arguments)}var O=t(r),P=O.right,Q=O.left,T=Math.sqrt(50),U=Math.sqrt(10),W=Math.sqrt(2),X="$";A.prototype=b.prototype={has:function(n){return X+n in this},get:function(n){return this[X+n]},set:function(n,r){return this[X+n]=r,this},remove:function(n){var r=X+n;return r in this&&delete this[r]},clear:function(){for(var n in this)n[0]===X&&delete this[n]},keys:function(){var n=[];for(var r in this)r[0]===X&&n.push(r.slice(1));return n},values:function(){var n=[];for(var r in this)r[0]===X&&n.push(this[r]);return n},entries:function(){var n=[];for(var r in this)r[0]===X&&n.push({key:r.slice(1),value:this[r]});return n},size:function(){var n=0;for(var r in this)r[0]===X&&++n;return n},empty:function(){for(var n in this)if(n[0]===X)return!1;return!0},each:function(n){for(var r in this)r[0]===X&&n(this[r],r.slice(1),this)}};var Y=b.prototype;_.prototype=B.prototype={has:Y.has,add:function(n){return n+="",this[X+n]=n,this},remove:Y.remove,clear:Y.clear,values:Y.keys,size:Y.size,empty:Y.empty,each:Y.each};var Z="0.6.1";n.version=Z,n.bisect=P,n.bisectRight=P,n.bisectLeft=Q,n.ascending=r,n.bisector=t,n.descending=u,n.deviation=a,n.entries=f,n.extent=s,n.histogram=y,n.thresholdFreedmanDiaconis=N,n.thresholdScott=M,n.thresholdSturges=p,n.keys=k,n.map=b,n.max=w,n.mean=x,n.median=q,n.merge=z,n.min=L,n.nest=S,n.pairs=R,n.permute=V,n.quantile=d,n.range=c,n.scan=$,n.set=B,n.shuffle=C,n.sum=E,n.ticks=g,n.tickStep=v,n.transpose=G,n.values=I,n.variance=o,n.zip=J}); | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define("d3-array",["exports"],r):r(n.d3_array={})}(this,function(n){"use strict";function r(n,r){return r>n?-1:n>r?1:n>=r?0:NaN}function t(n){return 1===n.length&&(n=e(n)),{left:function(r,t,e,u){for(arguments.length<3&&(e=0),arguments.length<4&&(u=r.length);u>e;){var i=e+u>>>1;n(r[i],t)<0?e=i+1:u=i}return e},right:function(r,t,e,u){for(arguments.length<3&&(e=0),arguments.length<4&&(u=r.length);u>e;){var i=e+u>>>1;n(r[i],t)>0?u=i:e=i+1}return e}}}function e(n){return function(t,e){return r(n(t),e)}}function u(n,r){return n>r?-1:r>n?1:r>=n?0:NaN}function i(n){return null===n?NaN:+n}function o(n,r){var t,e,u=n.length,o=0,f=0,a=-1,s=0;if(1===arguments.length)for(;++a<u;)isNaN(t=i(n[a]))||(e=t-o,o+=e/++s,f+=e*(t-o));else for(;++a<u;)isNaN(t=i(r(n[a],a,n)))||(e=t-o,o+=e/++s,f+=e*(t-o));return s>1?f/(s-1):void 0}function f(){var n=o.apply(this,arguments);return n?Math.sqrt(n):n}function a(n){var r=[];for(var t in n)r.push({key:t,value:n[t]});return r}function s(n,r){var t,e,u,i=-1,o=n.length;if(1===arguments.length){for(;++i<o;)if(null!=(e=n[i])&&e>=e){t=u=e;break}for(;++i<o;)null!=(e=n[i])&&(t>e&&(t=e),e>u&&(u=e))}else{for(;++i<o;)if(null!=(e=r(n[i],i,n))&&e>=e){t=u=e;break}for(;++i<o;)null!=(e=r(n[i],i,n))&&(t>e&&(t=e),e>u&&(u=e))}return[t,u]}function h(n){return function(){return n}}function l(n){return n}function c(n,r,t){(u=arguments.length)<3&&(t=1,2>u&&(r=n,n=0));for(var e=-1,u=0|Math.max(0,Math.ceil((r-n)/t)),i=new Array(u);++e<u;)i[e]=n+e*t;return i}function g(n,r,t){var e=v(n,r,t);return c(Math.ceil(n/e)*e,Math.floor(r/e)*e+e/2,e)}function v(n,r,t){var e=Math.abs(r-n)/Math.max(0,t),u=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),i=e/u;return i>=T?u*=10:i>=U?u*=5:i>=W&&(u*=2),n>r?-u:u}function p(n){return Math.ceil(Math.log(n.length)/Math.LN2)+1}function m(n){return+n}function y(){function n(n){var u,i,o=n.length,f=new Array(o);for(u=0;o>u;++u)f[u]=+r(n[u],u,n);var a=t(f),s=+a[0],h=+a[1],l=e(f,s,h);Array.isArray(l)||(l=g(s,h,+l));var c=l.length;for(u=0;c>u;++u)l[u]=+l[u];for(;l[0]<=s;)l.shift(),--c;for(;l[c-1]>=h;)l.pop(),--c;var v,p=new Array(c+1);for(u=0;c>=u;++u)v=p[u]=[],v.x0=u>0?l[u-1]:s,v.x1=c>u?l[u]:h;for(u=0;o>u;++u)i=f[u],i>=s&&h>=i&&p[P(l,i,0,c)].push(n[u]);return p}var r=l,t=s,e=p;return n.value=function(t){return arguments.length?(r="function"==typeof t?t:h(+t),n):r},n.domain=function(r){return arguments.length?(t="function"==typeof r?r:h([+r[0],+r[1]]),n):t},n.thresholds=function(r){return arguments.length?(e="function"==typeof r?r:h(Array.isArray(r)?Array.prototype.map.call(r,m):+r),n):e},n}function d(n,r,t){if(arguments.length<3&&(t=i),e=n.length){if((r=+r)<=0||2>e)return+t(n[0],0,n);if(r>=1)return+t(n[e-1],e-1,n);var e,u=(e-1)*r,o=Math.floor(u),f=+t(n[o],o,n),a=+t(n[o+1],o+1,n);return f+(a-f)*(u-o)}}function M(n,t,e){return n.sort(r),Math.ceil((e-t)/(2*(d(n,.75)-d(n,.25))*Math.pow(n.length,-1/3)))}function N(n,r,t){return Math.ceil((t-r)/(3.5*f(n)*Math.pow(n.length,-1/3)))}function k(n){var r=[];for(var t in n)r.push(t);return r}function A(){}function b(n,r){var t=new A;if(n instanceof A)n.each(function(n,r){t.set(r,n)});else if(Array.isArray(n)){var e,u=-1,i=n.length;if(1===arguments.length)for(;++u<i;)t.set(u,n[u]);else for(;++u<i;)t.set(r(e=n[u],u,n),e)}else if(n)for(var o in n)t.set(o,n[o]);return t}function w(n,r){var t,e,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(e=n[u])&&e>=e){t=e;break}for(;++u<i;)null!=(e=n[u])&&e>t&&(t=e)}else{for(;++u<i;)if(null!=(e=r(n[u],u,n))&&e>=e){t=e;break}for(;++u<i;)null!=(e=r(n[u],u,n))&&e>t&&(t=e)}return t}function x(n,r){var t,e=0,u=n.length,o=-1,f=u;if(1===arguments.length)for(;++o<u;)isNaN(t=i(n[o]))?--f:e+=t;else for(;++o<u;)isNaN(t=i(r(n[o],o,n)))?--f:e+=t;return f?e/f:void 0}function q(n,t){var e,u=[],o=n.length,f=-1;if(1===arguments.length)for(;++f<o;)isNaN(e=i(n[f]))||u.push(e);else for(;++f<o;)isNaN(e=i(t(n[f],f,n)))||u.push(e);return d(u.sort(r),.5)}function z(n){for(var r,t,e,u=n.length,i=-1,o=0;++i<u;)o+=n[i].length;for(t=new Array(o);--u>=0;)for(e=n[u],r=e.length;--r>=0;)t[--o]=e[r];return t}function L(n,r){var t,e,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(e=n[u])&&e>=e){t=e;break}for(;++u<i;)null!=(e=n[u])&&t>e&&(t=e)}else{for(;++u<i;)if(null!=(e=r(n[u],u,n))&&e>=e){t=e;break}for(;++u<i;)null!=(e=r(n[u],u,n))&&t>e&&(t=e)}return t}function S(){function n(r,u,o,f){if(u>=i.length)return e?e(r):t?r.sort(t):r;for(var a,s,h,l=-1,c=r.length,g=i[u++],v=b(),p=o();++l<c;)(h=v.get(a=g(s=r[l])+""))?h.push(s):v.set(a,[s]);return v.each(function(r,t){f(p,t,n(r,u,o,f))}),p}function r(n,t){if(t>=i.length)return n;var e=[],u=o[t++];return n.each(function(n,u){e.push({key:u,values:r(n,t)})}),u?e.sort(function(n,r){return u(n.key,r.key)}):e}var t,e,u,i=[],o=[];return u={object:function(r){return n(r,0,j,D)},map:function(r){return n(r,0,F,K)},entries:function(t){return r(n(t,0,F,K),0)},key:function(n){return i.push(n),u},sortKeys:function(n){return o[i.length-1]=n,u},sortValues:function(n){return t=n,u},rollup:function(n){return e=n,u}}}function j(){return{}}function D(n,r,t){n[r]=t}function F(){return b()}function K(n,r,t){n.set(r,t)}function R(n){for(var r,t=0,e=n.length-1,u=n[0],i=new Array(0>e?0:e);e>t;)i[t]=[r=u,u=n[++t]];return i}function V(n,r){for(var t=r.length,e=new Array(t);t--;)e[t]=n[r[t]];return e}function $(n,t){if(e=n.length){var e,u,i=0,o=0,f=n[o];for(t||(t=r);++i<e;)(t(u=n[i],f)<0||0!==t(f,f))&&(f=u,o=i);return 0===t(f,f)?o:void 0}}function _(){}function B(n,r){var t=new _;if(n instanceof _)n.each(function(n){t.add(n)});else if(n){var e,u=-1,i=n.length;if(1===arguments.length)for(;++u<i;)t.add(n[u]);else for(;++u<i;)t.add(r(e=n[u],u,n))}return t}function C(n,r,t){(i=arguments.length)<3&&(t=n.length,2>i&&(r=0));for(var e,u,i=t-r;i;)u=Math.random()*i--|0,e=n[i+r],n[i+r]=n[u+r],n[u+r]=e;return n}function E(n,r){var t,e=0,u=n.length,i=-1;if(1===arguments.length)for(;++i<u;)(t=+n[i])&&(e+=t);else for(;++i<u;)(t=+r(n[i],i,n))&&(e+=t);return e}function G(n){if(!(u=n.length))return[];for(var r=-1,t=L(n,H),e=new Array(t);++r<t;)for(var u,i=-1,o=e[r]=new Array(u);++i<u;)o[i]=n[i][r];return e}function H(n){return n.length}function I(n){var r=[];for(var t in n)r.push(n[t]);return r}function J(){return G(arguments)}var O=t(r),P=O.right,Q=O.left,T=Math.sqrt(50),U=Math.sqrt(10),W=Math.sqrt(2),X="$";A.prototype=b.prototype={has:function(n){return X+n in this},get:function(n){return this[X+n]},set:function(n,r){return this[X+n]=r,this},remove:function(n){var r=X+n;return r in this&&delete this[r]},clear:function(){for(var n in this)n[0]===X&&delete this[n]},keys:function(){var n=[];for(var r in this)r[0]===X&&n.push(r.slice(1));return n},values:function(){var n=[];for(var r in this)r[0]===X&&n.push(this[r]);return n},entries:function(){var n=[];for(var r in this)r[0]===X&&n.push({key:r.slice(1),value:this[r]});return n},size:function(){var n=0;for(var r in this)r[0]===X&&++n;return n},empty:function(){for(var n in this)if(n[0]===X)return!1;return!0},each:function(n){for(var r in this)r[0]===X&&n(this[r],r.slice(1),this)}};var Y=b.prototype;_.prototype=B.prototype={has:Y.has,add:function(n){return n+="",this[X+n]=n,this},remove:Y.remove,clear:Y.clear,values:Y.keys,size:Y.size,empty:Y.empty,each:Y.each};var Z="0.6.2";n.version=Z,n.bisect=P,n.bisectRight=P,n.bisectLeft=Q,n.ascending=r,n.bisector=t,n.descending=u,n.deviation=f,n.entries=a,n.extent=s,n.histogram=y,n.thresholdFreedmanDiaconis=M,n.thresholdScott=N,n.thresholdSturges=p,n.keys=k,n.map=b,n.max=w,n.mean=x,n.median=q,n.merge=z,n.min=L,n.nest=S,n.pairs=R,n.permute=V,n.quantile=d,n.range=c,n.scan=$,n.set=B,n.shuffle=C,n.sum=E,n.ticks=g,n.tickStep=v,n.transpose=G,n.values=I,n.variance=o,n.zip=J}); |
{ | ||
"name": "d3-array", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "Array manipulation, ordering, searching, summarizing, etc.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -8,7 +8,7 @@ export default function(array, f) { | ||
if (arguments.length === 1) { | ||
while (++i < n) if (!isNaN(a = +array[i])) s += a; // Note: zero and null are equivalent. | ||
while (++i < n) if (a = +array[i]) s += a; // Note: zero and null are equivalent. | ||
} | ||
else { | ||
while (++i < n) if (!isNaN(a = +f(array[i], i, array))) s += a; | ||
while (++i < n) if (a = +f(array[i], i, array)) s += a; | ||
} | ||
@@ -15,0 +15,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
97352