crossfilter-rails 1.1.0 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
|
|
1
1
|
(function(exports){
|
2
|
-
crossfilter.version = "1.1.
|
2
|
+
crossfilter.version = "1.1.3";
|
3
3
|
function crossfilter_identity(d) {
|
4
4
|
return d;
|
5
5
|
}
|
@@ -23,15 +23,18 @@ function bisect_by(f) {
|
|
23
23
|
// present in a, the insertion point will be before (to the left of) any
|
24
24
|
// existing entries. The return value is suitable for use as the first
|
25
25
|
// argument to `array.splice` assuming that a is already sorted.
|
26
|
+
// Incomparable values such as NaN and undefined are assumed to be at the end
|
27
|
+
// of the array.
|
26
28
|
//
|
27
29
|
// The returned insertion point i partitions the array a into two halves so
|
28
30
|
// that all v < x for v in a[lo:i] for the left side and all v >= x for v in
|
29
31
|
// a[i:hi] for the right side.
|
30
32
|
function bisectLeft(a, x, lo, hi) {
|
31
33
|
while (lo < hi) {
|
32
|
-
var mid = lo + hi
|
33
|
-
|
34
|
-
|
34
|
+
var mid = lo + hi >>> 1,
|
35
|
+
y = f(a[mid]);
|
36
|
+
if (x <= y || !(y <= y)) hi = mid;
|
37
|
+
else lo = mid + 1;
|
35
38
|
}
|
36
39
|
return lo;
|
37
40
|
}
|
@@ -44,8 +47,9 @@ function bisect_by(f) {
|
|
44
47
|
// a[i:hi] for the right side.
|
45
48
|
function bisectRight(a, x, lo, hi) {
|
46
49
|
while (lo < hi) {
|
47
|
-
var mid = lo + hi
|
48
|
-
|
50
|
+
var mid = lo + hi >>> 1,
|
51
|
+
y = f(a[mid]);
|
52
|
+
if (x < y || !(y <= y)) hi = mid;
|
49
53
|
else lo = mid + 1;
|
50
54
|
}
|
51
55
|
return lo;
|
@@ -143,7 +147,7 @@ function insertionsort_by(f) {
|
|
143
147
|
|
144
148
|
function insertionsort(a, lo, hi) {
|
145
149
|
for (var i = lo + 1; i < hi; ++i) {
|
146
|
-
for (var j = i, t = a[i], x = f(t); j > lo && f(a[j - 1]) > x; --j) {
|
150
|
+
for (var j = i, t = a[i], x = f(t), y; j > lo && ((y = f(a[j - 1])) > x || !(y <= y)); --j) {
|
147
151
|
a[j] = a[j - 1];
|
148
152
|
}
|
149
153
|
a[j] = t;
|
@@ -170,6 +174,16 @@ function quicksort_by(f) {
|
|
170
174
|
}
|
171
175
|
|
172
176
|
function quicksort(a, lo, hi) {
|
177
|
+
// First move NaN and undefined to the end.
|
178
|
+
var x, y;
|
179
|
+
while (lo < hi && !((x = f(a[hi - 1])) <= x)) hi--;
|
180
|
+
for (var i = hi; --i >= lo; ) {
|
181
|
+
x = f(y = a[i]);
|
182
|
+
if (!(x <= x)) {
|
183
|
+
a[i] = a[--hi];
|
184
|
+
a[hi] = y;
|
185
|
+
}
|
186
|
+
}
|
173
187
|
|
174
188
|
// Compute the two pivots by looking at 5 elements.
|
175
189
|
var sixth = (hi - lo) / 6 | 0,
|
@@ -823,8 +837,8 @@ function crossfilter() {
|
|
823
837
|
// Get the first old key (x0 of g0), if it exists.
|
824
838
|
if (k0) x0 = (g0 = oldGroups[0]).key;
|
825
839
|
|
826
|
-
// Find the first new key (x1)
|
827
|
-
|
840
|
+
// Find the first new key (x1).
|
841
|
+
x1 = key(newValues[i1]);
|
828
842
|
|
829
843
|
// While new keys remain…
|
830
844
|
while (i1 < n1) {
|
@@ -848,7 +862,7 @@ function crossfilter() {
|
|
848
862
|
|
849
863
|
// Add any selected records belonging to the added group, while
|
850
864
|
// advancing the new key and populating the associated group index.
|
851
|
-
while (!(x1
|
865
|
+
while (x1 <= x || !(x1 <= x1) && !(x <= x)) {
|
852
866
|
groupIndex[j = newIndex[i1] + n0] = k;
|
853
867
|
if (!(filters[j] & zero)) g.value = add(g.value, data[j]);
|
854
868
|
if (++i1 >= n1) break;
|
@@ -1087,7 +1101,7 @@ function crossfilter() {
|
|
1087
1101
|
add(data, 0, n);
|
1088
1102
|
|
1089
1103
|
// Incorporates the specified new values into this group.
|
1090
|
-
function add(newData, n0
|
1104
|
+
function add(newData, n0) {
|
1091
1105
|
var i;
|
1092
1106
|
|
1093
1107
|
if (resetNeeded) return;
|
@@ -1 +1 @@
|
|
1
|
-
(function(
|
1
|
+
(function(r){function n(r){return r}function t(r,n){for(var t=0,u=n.length,e=Array(u);u>t;++t)e[t]=r[n[t]];return e}function u(r){function n(n,t,u,e){for(;e>u;){var f=u+e>>>1,o=r(n[f]);o>=t||!(o>=o)?e=f:u=f+1}return u}function t(n,t,u,e){for(;e>u;){var f=u+e>>>1,o=r(n[f]);o>t||!(o>=o)?e=f:u=f+1}return u}return t.right=t,t.left=n,t}function e(r){function n(r,n,t){for(var e=t-n,f=(e>>>1)+1;--f>0;)u(r,f,e,n);return r}function t(r,n,t){for(var e,f=t-n;--f>0;)e=r[n],r[n]=r[n+f],r[n+f]=e,u(r,1,f,n);return r}function u(n,t,u,e){for(var f,o=n[--e+t],i=r(o);(f=t<<1)<=u&&(u>f&&r(n[e+f])>r(n[e+f+1])&&f++,!(i<=r(n[e+f])));)n[e+t]=n[e+f],t=f;n[e+t]=o}return n.sort=t,n}function f(r){function n(n,u,e,f){var o,i,a,c,l=Array(f=Math.min(e-u,f));for(i=0;f>i;++i)l[i]=n[u++];if(t(l,0,f),e>u){o=r(l[0]);do(a=r(c=n[u])>o)&&(l[0]=c,o=r(t(l,0,f)[0]));while(++u<e)}return l}var t=e(r);return n}function o(r){function n(n,t,u){for(var e=t+1;u>e;++e){for(var f,o=e,i=n[e],a=r(i);o>t&&((f=r(n[o-1]))>a||!(f>=f));--o)n[o]=n[o-1];n[o]=i}return n}return n}function i(r){function n(r,n,e){return(z>e-n?u:t)(r,n,e)}function t(t,u,e){for(var f,o;e>u&&!((f=r(t[e-1]))<=f);)e--;for(var i=e;--i>=u;)f=r(o=t[i]),f>=f||(t[i]=t[--e],t[e]=o);var a,c=0|(e-u)/6,l=u+c,v=e-1-c,h=u+e-1>>1,s=h-c,d=h+c,g=t[l],p=r(g),y=t[s],b=r(y),m=t[h],A=r(m),k=t[d],w=r(k),E=t[v],M=r(E);p>b&&(a=g,g=y,y=a,a=p,p=b,b=a),w>M&&(a=k,k=E,E=a,a=w,w=M,M=a),p>A&&(a=g,g=m,m=a,a=p,p=A,A=a),b>A&&(a=y,y=m,m=a,a=b,b=A,A=a),p>w&&(a=g,g=k,k=a,a=p,p=w,w=a),A>w&&(a=m,m=k,k=a,a=A,A=w,w=a),b>M&&(a=y,y=E,E=a,a=b,b=M,M=a),b>A&&(a=y,y=m,m=a,a=b,b=A,A=a),w>M&&(a=k,k=E,E=a,a=w,w=M,M=a);var x=y,U=b,z=k,N=w;t[l]=g,t[s]=t[u],t[h]=m,t[d]=t[e-1],t[v]=E;var C=u+1,S=e-2,q=N>=U&&U>=N;if(q)for(var O=C;S>=O;++O){var R=t[O],j=r(R);if(U>j)O!==C&&(t[O]=t[C],t[C]=R),++C;else if(j>U)for(;;){var B=r(t[S]);{if(!(B>U)){if(U>B){t[O]=t[C],t[C++]=t[S],t[S--]=R;break}t[O]=t[S],t[S--]=R;break}S--}}}else for(var O=C;S>=O;O++){var R=t[O],j=r(R);if(U>j)O!==C&&(t[O]=t[C],t[C]=R),++C;else if(j>N)for(;;){var B=r(t[S]);{if(!(B>N)){U>B?(t[O]=t[C],t[C++]=t[S],t[S--]=R):(t[O]=t[S],t[S--]=R);break}if(S--,O>S)break}}}if(t[u]=t[C-1],t[C-1]=x,t[e-1]=t[S+1],t[S+1]=z,n(t,u,C-1),n(t,S+2,e),q)return t;if(l>C&&S>v){for(var D,B;(D=r(t[C]))<=U&&D>=U;)++C;for(;(B=r(t[S]))<=N&&B>=N;)--S;for(var O=C;S>=O;O++){var R=t[O],j=r(R);if(U>=j&&j>=U)O!==C&&(t[O]=t[C],t[C]=R),C++;else if(N>=j&&j>=N)for(;;){var B=r(t[S]);{if(!(N>=B&&B>=N)){U>B?(t[O]=t[C],t[C++]=t[S],t[S--]=R):(t[O]=t[S],t[S--]=R);break}if(S--,O>S)break}}}}return n(t,C,S+1)}var u=o(r);return n}function a(r){return Array(r)}function c(r,n){return function(t){var u=t.length;return[r.left(t,n,0,u),r.right(t,n,0,u)]}}function l(r,n){var t=n[0],u=n[1];return function(n){var e=n.length;return[r.left(n,t,0,e),r.left(n,u,0,e)]}}function v(r){return[0,r.length]}function h(){return null}function s(){return 0}function d(r){return r+1}function g(r){return r-1}function p(r){return function(n,t){return n+ +r(t)}}function y(r){return function(n,t){return n-r(t)}}function b(){function r(r){var n=M,t=r.length;return t&&(E=E.concat(r),z=q(z,M+=t),S.forEach(function(u){u(r,n,t)})),b}function u(r){function u(n,u,e){J=n.map(r),K=T(A(e),0,e),J=t(J,K);var f,o=V(J),i=o[0],a=o[1];for(f=0;i>f;++f)z[K[f]+u]|=P;for(f=a;e>f;++f)z[K[f]+u]|=P;if(!u)return H=J,I=K,X=i,Y=a,void 0;var c=H,l=I,v=0,h=0;for(H=Array(M),I=m(M,M),f=0;u>v&&e>h;++f)c[v]<J[h]?(H[f]=c[v],I[f]=l[v++]):(H[f]=J[h],I[f]=K[h++]+u);for(;u>v;++v,++f)H[f]=c[v],I[f]=l[v];for(;e>h;++h,++f)H[f]=J[h],I[f]=K[h]+u;o=V(H),X=o[0],Y=o[1]}function o(r,n,t){W.forEach(function(r){r(J,K,n,t)}),J=K=null}function a(r){var n,t,u,e=r[0],f=r[1],o=[],i=[];if(X>e)for(n=e,t=Math.min(X,f);t>n;++n)z[u=I[n]]^=P,o.push(u);else if(e>X)for(n=X,t=Math.min(e,Y);t>n;++n)z[u=I[n]]^=P,i.push(u);if(f>Y)for(n=Math.max(e,Y),t=f;t>n;++n)z[u=I[n]]^=P,o.push(u);else if(Y>f)for(n=Math.max(X,f),t=Y;t>n;++n)z[u=I[n]]^=P,i.push(u);return X=e,Y=f,C.forEach(function(r){r(P,o,i)}),L}function b(r){return null==r?j():Array.isArray(r)?R(r):N(r)}function N(r){return a((V=c(w,r))(H))}function R(r){return a((V=l(w,r))(H))}function j(){return a((V=v)(H))}function B(r){for(var n,t=[],u=Y;--u>=X&&r>0;)z[n=I[u]]||(t.push(E[n]),--r);return t}function D(r){for(var n,t=[],u=X;Y>u&&r>0;)z[n=I[u]]||(t.push(E[n]),--r),u++;return t}function F(r){function t(n,t,e,f){function c(){++L===K&&(b=O(b,J<<=1),S=O(S,J),K=k(J))}var l,v,s,d,g,p,y=N,b=m(L,K),A=B,w=F,x=L,U=0,R=0;for(X&&(A=w=h),N=Array(L),L=0,S=x>1?q(S,M):m(M,K),x&&(s=(v=y[0]).key),d=r(n[R]);f>R;){for(v&&d>=s?(g=v,p=s,b[U]=L,(v=y[++U])&&(s=v.key)):(g={key:d,value:w()},p=d),N[L]=g;!(!(p>=d)&&(d>=d||p>=p)||(S[l=t[R]+e]=L,z[l]&Q||(g.value=A(g.value,E[l])),++R>=f));)d=r(n[R]);c()}for(;x>U;)N[b[U]=L]=y[U++],c();if(L>U)for(U=0;e>U;++U)S[U]=b[S[U]];l=C.indexOf(T),L>1?(T=u,V=i):(1===L?(T=o,V=a):(T=h,V=h),S=null),C[l]=T}function u(r,n,t){if(r!==P&&!X){var u,e,f,o;for(u=0,f=n.length;f>u;++u)z[e=n[u]]&Q||(o=N[S[e]],o.value=B(o.value,E[e]));for(u=0,f=t.length;f>u;++u)(z[e=t[u]]&Q)===r&&(o=N[S[e]],o.value=D(o.value,E[e]))}}function o(r,n,t){if(r!==P&&!X){var u,e,f,o=N[0];for(u=0,f=n.length;f>u;++u)z[e=n[u]]&Q||(o.value=B(o.value,E[e]));for(u=0,f=t.length;f>u;++u)(z[e=t[u]]&Q)===r&&(o.value=D(o.value,E[e]))}}function i(){var r,n;for(r=0;L>r;++r)N[r].value=F();for(r=0;M>r;++r)z[r]&Q||(n=N[S[r]],n.value=B(n.value,E[r]))}function a(){var r,n=N[0];for(n.value=F(),r=0;M>r;++r)z[r]&Q||(n.value=B(n.value,E[r]))}function c(){return X&&(V(),X=!1),N}function l(r){var n=R(c(),0,N.length,r);return j.sort(n,0,n.length)}function v(r,n,t){return B=r,D=n,F=t,X=!0,G}function b(){return v(d,g,s)}function A(r){return v(p(r),y(r),s)}function w(r){function n(n){return r(n.value)}return R=f(n),j=e(n),G}function x(){return w(n)}function U(){return L}var N,S,R,j,B,D,F,G={top:l,all:c,reduce:v,reduceCount:b,reduceSum:A,order:w,orderNatural:x,size:U},J=8,K=k(J),L=0,T=h,V=h,X=!0;return arguments.length<1&&(r=n),C.push(T),W.push(t),t(H,I,0,M),b().orderNatural()}function G(){var r=F(h),n=r.all;return delete r.all,delete r.top,delete r.order,delete r.orderNatural,delete r.size,r.value=function(){return n()[0].value},r}var H,I,J,K,L={filter:b,filterExact:N,filterRange:R,filterAll:j,top:B,bottom:D,group:F,groupAll:G},P=1<<x++,Q=~P,T=i(function(r){return J[r]}),V=v,W=[],X=0,Y=0;return S.unshift(u),S.push(o),x>U&&(z=O(z,U<<=1)),u(E,0,M),o(E,0,M),L}function o(){function r(r,n){var t;if(!h)for(t=n;M>t;++t)z[t]||(i=a(i,E[t]))}function n(r,n,t){var u,e,f;if(!h){for(u=0,f=n.length;f>u;++u)z[e=n[u]]||(i=a(i,E[e]));for(u=0,f=t.length;f>u;++u)z[e=t[u]]===r&&(i=c(i,E[e]))}}function t(){var r;for(i=l(),r=0;M>r;++r)z[r]||(i=a(i,E[r]))}function u(r,n,t){return a=r,c=n,l=t,h=!0,v}function e(){return u(d,g,s)}function f(r){return u(p(r),y(r),s)}function o(){return h&&(t(),h=!1),i}var i,a,c,l,v={reduce:u,reduceCount:e,reduceSum:f,value:o},h=!0;return C.push(n),S.push(r),r(E,0,M),e()}function a(){return M}var b={add:r,dimension:u,groupAll:o,size:a},E=[],M=0,x=0,U=8,z=N(0),C=[],S=[];return arguments.length?r(arguments[0]):b}function m(r,n){return(257>n?N:65537>n?C:S)(r)}function A(r){for(var n=m(r,r),t=-1;++t<r;)n[t]=t;return n}function k(r){return 8===r?256:16===r?65536:4294967296}b.version="1.1.3",b.permute=t;var w=b.bisect=u(n);w.by=u;var E=b.heap=e(n);E.by=e;var M=b.heapselect=f(n);M.by=f;var x=b.insertionsort=o(n);x.by=o;var U=b.quicksort=i(n);U.by=i;var z=32,N=a,C=a,S=a,q=n,O=n;"undefined"!=typeof Uint8Array&&(N=function(r){return new Uint8Array(r)},C=function(r){return new Uint16Array(r)},S=function(r){return new Uint32Array(r)},q=function(r,n){var t=new r.constructor(n);return t.set(r),t},O=function(r,n){var t;switch(n){case 16:t=C(r.length);break;case 32:t=S(r.length);break;default:throw Error("invalid array width!")}return t.set(r),t}),r.crossfilter=b})(this);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crossfilter-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-03-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
72
|
rubyforge_project:
|
73
|
-
rubygems_version: 1.8.
|
73
|
+
rubygems_version: 1.8.25
|
74
74
|
signing_key:
|
75
75
|
specification_version: 3
|
76
76
|
summary: Gemified crossfilter.js asset for Rails
|