crossfilter-rails 1.1.3 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a63eca9198a9e2ea8403de29dc23dd6e18afde22
4
+ data.tar.gz: 377988d5d6d1b9aa9af7f5e8131b0db9aa8494e3
5
+ SHA512:
6
+ metadata.gz: da7b5ee2a3d3968528b21c7c54a8b8c77b5b5a299bd5f8f9f8bfe55bdae87f7dcebeff079d96f7f754e839599ebfcb3d0fe3c7858d0b4026d8155c478fdba77c
7
+ data.tar.gz: f3bfab25c2294f1ae2fb401960592be67f01b5ce5522f8c564667015beac978925f2bdf5b665f9b2babd5db0952af476288e65af85f4ef624b5add3a6a471252
@@ -1,5 +1,5 @@
1
1
  module Crossfilter
2
2
  module Rails
3
- VERSION = "1.1.3"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  (function(exports){
2
- crossfilter.version = "1.1.3";
2
+ crossfilter.version = "1.2.0";
3
3
  function crossfilter_identity(d) {
4
4
  return d;
5
5
  }
@@ -23,18 +23,15 @@ 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.
28
26
  //
29
27
  // The returned insertion point i partitions the array a into two halves so
30
28
  // that all v < x for v in a[lo:i] for the left side and all v >= x for v in
31
29
  // a[i:hi] for the right side.
32
30
  function bisectLeft(a, x, lo, hi) {
33
31
  while (lo < hi) {
34
- var mid = lo + hi >>> 1,
35
- y = f(a[mid]);
36
- if (x <= y || !(y <= y)) hi = mid;
37
- else lo = mid + 1;
32
+ var mid = lo + hi >>> 1;
33
+ if (f(a[mid]) < x) lo = mid + 1;
34
+ else hi = mid;
38
35
  }
39
36
  return lo;
40
37
  }
@@ -47,9 +44,8 @@ function bisect_by(f) {
47
44
  // a[i:hi] for the right side.
48
45
  function bisectRight(a, x, lo, hi) {
49
46
  while (lo < hi) {
50
- var mid = lo + hi >>> 1,
51
- y = f(a[mid]);
52
- if (x < y || !(y <= y)) hi = mid;
47
+ var mid = lo + hi >>> 1;
48
+ if (x < f(a[mid])) hi = mid;
53
49
  else lo = mid + 1;
54
50
  }
55
51
  return lo;
@@ -147,7 +143,7 @@ function insertionsort_by(f) {
147
143
 
148
144
  function insertionsort(a, lo, hi) {
149
145
  for (var i = lo + 1; i < hi; ++i) {
150
- for (var j = i, t = a[i], x = f(t), y; j > lo && ((y = f(a[j - 1])) > x || !(y <= y)); --j) {
146
+ for (var j = i, t = a[i], x = f(t); j > lo && f(a[j - 1]) > x; --j) {
151
147
  a[j] = a[j - 1];
152
148
  }
153
149
  a[j] = t;
@@ -174,17 +170,6 @@ function quicksort_by(f) {
174
170
  }
175
171
 
176
172
  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
- }
187
-
188
173
  // Compute the two pivots by looking at 5 elements.
189
174
  var sixth = (hi - lo) / 6 | 0,
190
175
  i1 = lo + sixth,
@@ -539,7 +524,7 @@ function crossfilter() {
539
524
 
540
525
  var data = [], // the records
541
526
  n = 0, // the number of records; data.length
542
- m = 0, // number of dimensions in use
527
+ m = 0, // a bit mask representing which dimensions are in use
543
528
  M = 8, // number of dimensions that can fit in `filters`
544
529
  filters = crossfilter_array8(0), // M bits per record; 1 is filtered out
545
530
  filterListeners = [], // when the filters change
@@ -569,14 +554,16 @@ function crossfilter() {
569
554
  filter: filter,
570
555
  filterExact: filterExact,
571
556
  filterRange: filterRange,
557
+ filterFunction: filterFunction,
572
558
  filterAll: filterAll,
573
559
  top: top,
574
560
  bottom: bottom,
575
561
  group: group,
576
- groupAll: groupAll
562
+ groupAll: groupAll,
563
+ remove: remove
577
564
  };
578
565
 
579
- var one = 1 << m++, // bit mask, e.g., 00001000
566
+ var one = ~m & -~m, // lowest unset bit as mask, e.g., 00001000
580
567
  zero = ~one, // inverted one, e.g., 11110111
581
568
  values, // sorted, cached array
582
569
  index, // value rank ↦ object id
@@ -584,7 +571,9 @@ function crossfilter() {
584
571
  newIndex, // temporary array storing newly-added index
585
572
  sort = quicksort_by(function(i) { return newValues[i]; }),
586
573
  refilter = crossfilter_filterAll, // for recomputing filter
574
+ refilterFunction, // the custom filter function in use
587
575
  indexListeners = [], // when data is added
576
+ dimensionGroups = [],
588
577
  lo0 = 0,
589
578
  hi0 = 0;
590
579
 
@@ -596,7 +585,10 @@ function crossfilter() {
596
585
 
597
586
  // Incorporate any existing data into this dimension, and make sure that the
598
587
  // filter bitset is wide enough to handle the new dimension.
599
- if (m > M) filters = crossfilter_arrayWiden(filters, M <<= 1);
588
+ m |= one;
589
+ if (M >= 32 ? !one : m & (1 << M) - 1) {
590
+ filters = crossfilter_arrayWiden(filters, M <<= 1);
591
+ }
600
592
  preAdd(data, 0, n);
601
593
  postAdd(data, 0, n);
602
594
 
@@ -610,9 +602,15 @@ function crossfilter() {
610
602
  newValues = permute(newValues, newIndex);
611
603
 
612
604
  // Bisect newValues to determine which new records are selected.
613
- var bounds = refilter(newValues), lo1 = bounds[0], hi1 = bounds[1], i;
614
- for (i = 0; i < lo1; ++i) filters[newIndex[i] + n0] |= one;
615
- for (i = hi1; i < n1; ++i) filters[newIndex[i] + n0] |= one;
605
+ var bounds = refilter(newValues), lo1 = bounds[0], hi1 = bounds[1], i, k;
606
+ if (refilterFunction) {
607
+ for (i = 0; i < n1; ++i) {
608
+ if (!refilterFunction(newValues[i], k = newIndex[i] + n0)) filters[k] |= one;
609
+ }
610
+ } else {
611
+ for (i = 0; i < lo1; ++i) filters[newIndex[i] + n0] |= one;
612
+ for (i = hi1; i < n1; ++i) filters[newIndex[i] + n0] |= one;
613
+ }
616
614
 
617
615
  // If this dimension previously had no data, then we don't need to do the
618
616
  // more expensive merge operation; use the new values and index as-is.
@@ -668,12 +666,21 @@ function crossfilter() {
668
666
 
669
667
  // Updates the selected values based on the specified bounds [lo, hi].
670
668
  // This implementation is used by all the public filter methods.
671
- function filterIndex(bounds) {
669
+ function filterIndexBounds(bounds) {
670
+ var lo1 = bounds[0],
671
+ hi1 = bounds[1];
672
+
673
+ if (refilterFunction) {
674
+ refilterFunction = null;
675
+ filterIndexFunction(function(d, i) { return lo1 <= i && i < hi1; });
676
+ lo0 = lo1;
677
+ hi0 = hi1;
678
+ return dimension;
679
+ }
680
+
672
681
  var i,
673
682
  j,
674
683
  k,
675
- lo1 = bounds[0],
676
- hi1 = bounds[1],
677
684
  added = [],
678
685
  removed = [];
679
686
 
@@ -716,24 +723,53 @@ function crossfilter() {
716
723
  function filter(range) {
717
724
  return range == null
718
725
  ? filterAll() : Array.isArray(range)
719
- ? filterRange(range)
726
+ ? filterRange(range) : typeof range === "function"
727
+ ? filterFunction(range)
720
728
  : filterExact(range);
721
729
  }
722
730
 
723
731
  // Filters this dimension to select the exact value.
724
732
  function filterExact(value) {
725
- return filterIndex((refilter = crossfilter_filterExact(bisect, value))(values));
733
+ return filterIndexBounds((refilter = crossfilter_filterExact(bisect, value))(values));
726
734
  }
727
735
 
728
736
  // Filters this dimension to select the specified range [lo, hi].
729
737
  // The lower bound is inclusive, and the upper bound is exclusive.
730
738
  function filterRange(range) {
731
- return filterIndex((refilter = crossfilter_filterRange(bisect, range))(values));
739
+ return filterIndexBounds((refilter = crossfilter_filterRange(bisect, range))(values));
732
740
  }
733
741
 
734
742
  // Clears any filters on this dimension.
735
743
  function filterAll() {
736
- return filterIndex((refilter = crossfilter_filterAll)(values));
744
+ return filterIndexBounds((refilter = crossfilter_filterAll)(values));
745
+ }
746
+
747
+ // Filters this dimension using an arbitrary function.
748
+ function filterFunction(f) {
749
+ refilter = crossfilter_filterAll;
750
+
751
+ filterIndexFunction(refilterFunction = f);
752
+
753
+ lo0 = 0;
754
+ hi0 = n;
755
+
756
+ return dimension;
757
+ }
758
+
759
+ function filterIndexFunction(f) {
760
+ var i,
761
+ k,
762
+ x,
763
+ added = [],
764
+ removed = [];
765
+
766
+ for (i = 0; i < n; ++i) {
767
+ if (!(filters[k = index[i]] & one) ^ (x = f(values[i], k))) {
768
+ if (x) filters[k] &= zero, added.push(k);
769
+ else filters[k] |= one, removed.push(k);
770
+ }
771
+ }
772
+ filterListeners.forEach(function(l) { l(one, added, removed); });
737
773
  }
738
774
 
739
775
  // Returns the top K selected records based on this dimension's order.
@@ -781,9 +817,13 @@ function crossfilter() {
781
817
  reduceSum: reduceSum,
782
818
  order: order,
783
819
  orderNatural: orderNatural,
784
- size: size
820
+ size: size,
821
+ remove: remove
785
822
  };
786
823
 
824
+ // Ensure that this group will be removed when the dimension is removed.
825
+ dimensionGroups.push(group);
826
+
787
827
  var groups, // array of {key, value}
788
828
  groupIndex, // object id ↦ group id
789
829
  groupWidth = 8,
@@ -837,8 +877,8 @@ function crossfilter() {
837
877
  // Get the first old key (x0 of g0), if it exists.
838
878
  if (k0) x0 = (g0 = oldGroups[0]).key;
839
879
 
840
- // Find the first new key (x1).
841
- x1 = key(newValues[i1]);
880
+ // Find the first new key (x1), skipping NaN keys.
881
+ while (i1 < n1 && !((x1 = key(newValues[i1])) >= x1)) ++i1;
842
882
 
843
883
  // While new keys remain…
844
884
  while (i1 < n1) {
@@ -862,7 +902,7 @@ function crossfilter() {
862
902
 
863
903
  // Add any selected records belonging to the added group, while
864
904
  // advancing the new key and populating the associated group index.
865
- while (x1 <= x || !(x1 <= x1) && !(x <= x)) {
905
+ while (!(x1 > x)) {
866
906
  groupIndex[j = newIndex[i1] + n0] = k;
867
907
  if (!(filters[j] & zero)) g.value = add(g.value, data[j]);
868
908
  if (++i1 >= n1) break;
@@ -1057,6 +1097,15 @@ function crossfilter() {
1057
1097
  return k;
1058
1098
  }
1059
1099
 
1100
+ // Removes this group and associated event listeners.
1101
+ function remove() {
1102
+ var i = filterListeners.indexOf(update);
1103
+ if (i >= 0) filterListeners.splice(i, 1);
1104
+ i = indexListeners.indexOf(add);
1105
+ if (i >= 0) indexListeners.splice(i, 1);
1106
+ return group;
1107
+ }
1108
+
1060
1109
  return reduceCount().orderNatural();
1061
1110
  }
1062
1111
 
@@ -1072,17 +1121,29 @@ function crossfilter() {
1072
1121
  return g;
1073
1122
  }
1074
1123
 
1124
+ function remove() {
1125
+ dimensionGroups.forEach(function(group) { group.remove(); });
1126
+ var i = dataListeners.indexOf(preAdd);
1127
+ if (i >= 0) dataListeners.splice(i, 1);
1128
+ i = dataListeners.indexOf(postAdd);
1129
+ if (i >= 0) dataListeners.splice(i, 1);
1130
+ for (i = 0; i < n; ++i) filters[i] &= zero;
1131
+ m &= zero;
1132
+ return dimension;
1133
+ }
1134
+
1075
1135
  return dimension;
1076
1136
  }
1077
1137
 
1078
1138
  // A convenience method for groupAll on a dummy dimension.
1079
- // This implementation can be optimized since it is always cardinality 1.
1139
+ // This implementation can be optimized since it always has cardinality 1.
1080
1140
  function groupAll() {
1081
1141
  var group = {
1082
1142
  reduce: reduce,
1083
1143
  reduceCount: reduceCount,
1084
1144
  reduceSum: reduceSum,
1085
- value: value
1145
+ value: value,
1146
+ remove: remove
1086
1147
  };
1087
1148
 
1088
1149
  var reduceValue,
@@ -1176,6 +1237,15 @@ function crossfilter() {
1176
1237
  return reduceValue;
1177
1238
  }
1178
1239
 
1240
+ // Removes this group and associated event listeners.
1241
+ function remove() {
1242
+ var i = filterListeners.indexOf(update);
1243
+ if (i >= 0) filterListeners.splice(i);
1244
+ i = dataListeners.indexOf(add);
1245
+ if (i >= 0) dataListeners.splice(i);
1246
+ return group;
1247
+ }
1248
+
1179
1249
  return reduceCount();
1180
1250
  }
1181
1251
 
@@ -1 +1 @@
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);
1
+ (function(r){function n(r){return r}function t(r,n){for(var t=0,e=n.length,u=Array(e);e>t;++t)u[t]=r[n[t]];return u}function e(r){function n(n,t,e,u){for(;u>e;){var f=e+u>>>1;r(n[f])<t?e=f+1:u=f}return e}function t(n,t,e,u){for(;u>e;){var f=e+u>>>1;t<r(n[f])?u=f:e=f+1}return e}return t.right=t,t.left=n,t}function u(r){function n(r,n,t){for(var u=t-n,f=(u>>>1)+1;--f>0;)e(r,f,u,n);return r}function t(r,n,t){for(var u,f=t-n;--f>0;)u=r[n],r[n]=r[n+f],r[n+f]=u,e(r,1,f,n);return r}function e(n,t,e,u){for(var f,o=n[--u+t],i=r(o);(f=t<<1)<=e&&(e>f&&r(n[u+f])>r(n[u+f+1])&&f++,!(i<=r(n[u+f])));)n[u+t]=n[u+f],t=f;n[u+t]=o}return n.sort=t,n}function f(r){function n(n,e,u,f){var o,i,a,c,l=Array(f=Math.min(u-e,f));for(i=0;f>i;++i)l[i]=n[e++];if(t(l,0,f),u>e){o=r(l[0]);do(a=r(c=n[e])>o)&&(l[0]=c,o=r(t(l,0,f)[0]));while(++e<u)}return l}var t=u(r);return n}function o(r){function n(n,t,e){for(var u=t+1;e>u;++u){for(var f=u,o=n[u],i=r(o);f>t&&r(n[f-1])>i;--f)n[f]=n[f-1];n[f]=o}return n}return n}function i(r){function n(r,n,u){return(U>u-n?e:t)(r,n,u)}function t(t,e,u){var f,o=0|(u-e)/6,i=e+o,a=u-1-o,c=e+u-1>>1,l=c-o,v=c+o,s=t[i],h=r(s),d=t[l],p=r(d),g=t[c],y=r(g),m=t[v],b=r(m),A=t[a],k=r(A);h>p&&(f=s,s=d,d=f,f=h,h=p,p=f),b>k&&(f=m,m=A,A=f,f=b,b=k,k=f),h>y&&(f=s,s=g,g=f,f=h,h=y,y=f),p>y&&(f=d,d=g,g=f,f=p,p=y,y=f),h>b&&(f=s,s=m,m=f,f=h,h=b,b=f),y>b&&(f=g,g=m,m=f,f=y,y=b,b=f),p>k&&(f=d,d=A,A=f,f=p,p=k,k=f),p>y&&(f=d,d=g,g=f,f=p,p=y,y=f),b>k&&(f=m,m=A,A=f,f=b,b=k,k=f);var x=d,w=p,E=m,O=b;t[i]=s,t[l]=t[e],t[c]=g,t[v]=t[u-1],t[a]=A;var M=e+1,U=u-2,z=O>=w&&w>=O;if(z)for(var N=M;U>=N;++N){var C=t[N],S=r(C);if(w>S)N!==M&&(t[N]=t[M],t[M]=C),++M;else if(S>w)for(;;){var q=r(t[U]);{if(!(q>w)){if(w>q){t[N]=t[M],t[M++]=t[U],t[U--]=C;break}t[N]=t[U],t[U--]=C;break}U--}}}else for(var N=M;U>=N;N++){var C=t[N],S=r(C);if(w>S)N!==M&&(t[N]=t[M],t[M]=C),++M;else if(S>O)for(;;){var q=r(t[U]);{if(!(q>O)){w>q?(t[N]=t[M],t[M++]=t[U],t[U--]=C):(t[N]=t[U],t[U--]=C);break}if(U--,N>U)break}}}if(t[e]=t[M-1],t[M-1]=x,t[u-1]=t[U+1],t[U+1]=E,n(t,e,M-1),n(t,U+2,u),z)return t;if(i>M&&U>a){for(var F,q;(F=r(t[M]))<=w&&F>=w;)++M;for(;(q=r(t[U]))<=O&&q>=O;)--U;for(var N=M;U>=N;N++){var C=t[N],S=r(C);if(w>=S&&S>=w)N!==M&&(t[N]=t[M],t[M]=C),M++;else if(O>=S&&S>=O)for(;;){var q=r(t[U]);{if(!(O>=q&&q>=O)){w>q?(t[N]=t[M],t[M++]=t[U],t[U--]=C):(t[N]=t[U],t[U--]=C);break}if(U--,N>U)break}}}}return n(t,M,U+1)}var e=o(r);return n}function a(r){return Array(r)}function c(r,n){return function(t){var e=t.length;return[r.left(t,n,0,e),r.right(t,n,0,e)]}}function l(r,n){var t=n[0],e=n[1];return function(n){var u=n.length;return[r.left(n,t,0,u),r.left(n,e,0,u)]}}function v(r){return[0,r.length]}function s(){return null}function h(){return 0}function d(r){return r+1}function p(r){return r-1}function g(r){return function(n,t){return n+ +r(t)}}function y(r){return function(n,t){return n-r(t)}}function m(){function r(r){var n=E,t=r.length;return t&&(w=w.concat(r),U=S(U,E+=t),C.forEach(function(e){e(r,n,t)})),m}function e(r){function e(n,e,u){P=n.map(r),Q=Y(A(u),0,u),P=t(P,Q);var f,o,i=Z(P),a=i[0],c=i[1];if(T)for(f=0;u>f;++f)T(P[f],o=Q[f]+e)||(U[o]|=W);else{for(f=0;a>f;++f)U[Q[f]+e]|=W;for(f=c;u>f;++f)U[Q[f]+e]|=W}if(!e)return K=P,L=Q,rn=a,nn=c,void 0;var l=K,v=L,s=0,h=0;for(K=Array(E),L=b(E,E),f=0;e>s&&u>h;++f)l[s]<P[h]?(K[f]=l[s],L[f]=v[s++]):(K[f]=P[h],L[f]=Q[h++]+e);for(;e>s;++s,++f)K[f]=l[s],L[f]=v[s];for(;u>h;++h,++f)K[f]=P[h],L[f]=Q[h]+e;i=Z(K),rn=i[0],nn=i[1]}function o(r,n,t){$.forEach(function(r){r(P,Q,n,t)}),P=Q=null}function a(r){var n=r[0],t=r[1];if(T)return T=null,B(function(r,e){return e>=n&&t>e}),rn=n,nn=t,V;var e,u,f,o=[],i=[];if(rn>n)for(e=n,u=Math.min(rn,t);u>e;++e)U[f=L[e]]^=W,o.push(f);else if(n>rn)for(e=rn,u=Math.min(n,nn);u>e;++e)U[f=L[e]]^=W,i.push(f);if(t>nn)for(e=Math.max(n,nn),u=t;u>e;++e)U[f=L[e]]^=W,o.push(f);else if(nn>t)for(e=Math.max(rn,t),u=nn;u>e;++e)U[f=L[e]]^=W,i.push(f);return rn=n,nn=t,N.forEach(function(r){r(W,o,i)}),V}function m(r){return null==r?R():Array.isArray(r)?F(r):"function"==typeof r?j(r):z(r)}function z(r){return a((Z=c(x,r))(K))}function F(r){return a((Z=l(x,r))(K))}function R(){return a((Z=v)(K))}function j(r){return Z=v,B(T=r),rn=0,nn=E,V}function B(r){var n,t,e,u=[],f=[];for(n=0;E>n;++n)!(U[t=L[n]]&W)^(e=r(K[n],t))&&(e?(U[t]&=X,u.push(t)):(U[t]|=W,f.push(t)));N.forEach(function(r){r(W,u,f)})}function D(r){for(var n,t=[],e=nn;--e>=rn&&r>0;)U[n=L[e]]||(t.push(w[n]),--r);return t}function G(r){for(var n,t=[],e=rn;nn>e&&r>0;)U[n=L[e]]||(t.push(w[n]),--r),e++;return t}function H(r){function t(n,t,u,f){function c(){++P===J&&(m=q(m,I<<=1),R=q(R,I),J=k(I))}var l,v,h,d,p,g,y=F,m=b(P,J),A=D,x=H,O=P,M=0,z=0;for(V&&(A=x=s),F=Array(P),P=0,R=O>1?S(R,E):b(E,J),O&&(h=(v=y[0]).key);f>z&&!((d=r(n[z]))>=d);)++z;for(;f>z;){for(v&&d>=h?(p=v,g=h,m[M]=P,(v=y[++M])&&(h=v.key)):(p={key:d,value:x()},g=d),F[P]=p;!(d>g||(R[l=t[z]+u]=P,U[l]&X||(p.value=A(p.value,w[l])),++z>=f));)d=r(n[z]);c()}for(;O>M;)F[m[M]=P]=y[M++],c();if(P>M)for(M=0;u>M;++M)R[M]=m[R[M]];l=N.indexOf(Q),P>1?(Q=e,T=i):(1===P?(Q=o,T=a):(Q=s,T=s),R=null),N[l]=Q}function e(r,n,t){if(r!==W&&!V){var e,u,f,o;for(e=0,f=n.length;f>e;++e)U[u=n[e]]&X||(o=F[R[u]],o.value=D(o.value,w[u]));for(e=0,f=t.length;f>e;++e)(U[u=t[e]]&X)===r&&(o=F[R[u]],o.value=G(o.value,w[u]))}}function o(r,n,t){if(r!==W&&!V){var e,u,f,o=F[0];for(e=0,f=n.length;f>e;++e)U[u=n[e]]&X||(o.value=D(o.value,w[u]));for(e=0,f=t.length;f>e;++e)(U[u=t[e]]&X)===r&&(o.value=G(o.value,w[u]))}}function i(){var r,n;for(r=0;P>r;++r)F[r].value=H();for(r=0;E>r;++r)U[r]&X||(n=F[R[r]],n.value=D(n.value,w[r]))}function a(){var r,n=F[0];for(n.value=H(),r=0;E>r;++r)U[r]&X||(n.value=D(n.value,w[r]))}function c(){return V&&(T(),V=!1),F}function l(r){var n=j(c(),0,F.length,r);return B.sort(n,0,n.length)}function v(r,n,t){return D=r,G=n,H=t,V=!0,C}function m(){return v(d,p,h)}function A(r){return v(g(r),y(r),h)}function x(r){function n(n){return r(n.value)}return j=f(n),B=u(n),C}function O(){return x(n)}function M(){return P}function z(){var r=N.indexOf(Q);return r>=0&&N.splice(r,1),r=$.indexOf(t),r>=0&&$.splice(r,1),C}var C={top:l,all:c,reduce:v,reduceCount:m,reduceSum:A,order:x,orderNatural:O,size:M,remove:z};_.push(C);var F,R,j,B,D,G,H,I=8,J=k(I),P=0,Q=s,T=s,V=!0;return arguments.length<1&&(r=n),N.push(Q),$.push(t),t(K,L,0,E),m().orderNatural()}function I(){var r=H(s),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}function J(){_.forEach(function(r){r.remove()});var r=C.indexOf(e);for(r>=0&&C.splice(r,1),r=C.indexOf(o),r>=0&&C.splice(r,1),r=0;E>r;++r)U[r]&=X;return O&=X,V}var K,L,P,Q,T,V={filter:m,filterExact:z,filterRange:F,filterFunction:j,filterAll:R,top:D,bottom:G,group:H,groupAll:I,remove:J},W=~O&-~O,X=~W,Y=i(function(r){return P[r]}),Z=v,$=[],_=[],rn=0,nn=0;return C.unshift(e),C.push(o),O|=W,(M>=32?!W:O&(1<<M)-1)&&(U=q(U,M<<=1)),e(w,0,E),o(w,0,E),V}function o(){function r(r,n){var t;if(!m)for(t=n;E>t;++t)U[t]||(a=c(a,w[t]))}function n(r,n,t){var e,u,f;if(!m){for(e=0,f=n.length;f>e;++e)U[u=n[e]]||(a=c(a,w[u]));for(e=0,f=t.length;f>e;++e)U[u=t[e]]===r&&(a=l(a,w[u]))}}function t(){var r;for(a=v(),r=0;E>r;++r)U[r]||(a=c(a,w[r]))}function e(r,n,t){return c=r,l=n,v=t,m=!0,s}function u(){return e(d,p,h)}function f(r){return e(g(r),y(r),h)}function o(){return m&&(t(),m=!1),a}function i(){var t=N.indexOf(n);return t>=0&&N.splice(t),t=C.indexOf(r),t>=0&&C.splice(t),s}var a,c,l,v,s={reduce:e,reduceCount:u,reduceSum:f,value:o,remove:i},m=!0;return N.push(n),C.push(r),r(w,0,E),u()}function a(){return E}var m={add:r,dimension:e,groupAll:o,size:a},w=[],E=0,O=0,M=8,U=z(0),N=[],C=[];return arguments.length?r(arguments[0]):m}function b(r,n){return(257>n?z:65537>n?N:C)(r)}function A(r){for(var n=b(r,r),t=-1;++t<r;)n[t]=t;return n}function k(r){return 8===r?256:16===r?65536:4294967296}m.version="1.2.0",m.permute=t;var x=m.bisect=e(n);x.by=e;var w=m.heap=u(n);w.by=u;var E=m.heapselect=f(n);E.by=f;var O=m.insertionsort=o(n);O.by=o;var M=m.quicksort=i(n);M.by=i;var U=32,z=a,N=a,C=a,S=n,q=n;"undefined"!=typeof Uint8Array&&(z=function(r){return new Uint8Array(r)},N=function(r){return new Uint16Array(r)},C=function(r){return new Uint32Array(r)},S=function(r,n){var t=new r.constructor(n);return t.set(r),t},q=function(r,n){var t;switch(n){case 16:t=N(r.length);break;case 32:t=C(r.length);break;default:throw Error("invalid array width!")}return t.set(r),t}),r.crossfilter=m})(this);
metadata CHANGED
@@ -1,22 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crossfilter-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
5
- prerelease:
4
+ version: 1.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Vlad Gorodetsky
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-03-11 00:00:00.000000000 Z
11
+ date: 2013-05-23 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: railties
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '3.0'
22
20
  - - <
@@ -25,9 +23,8 @@ dependencies:
25
23
  type: :runtime
26
24
  prerelease: false
27
25
  version_requirements: !ruby/object:Gem::Requirement
28
- none: false
29
26
  requirements:
30
- - - ! '>='
27
+ - - '>='
31
28
  - !ruby/object:Gem::Version
32
29
  version: '3.0'
33
30
  - - <
@@ -52,26 +49,25 @@ files:
52
49
  - vendor/assets/javascripts/crossfilter.min.js
53
50
  homepage: http://github.com/bai/crossfilter-rails
54
51
  licenses: []
52
+ metadata: {}
55
53
  post_install_message:
56
54
  rdoc_options: []
57
55
  require_paths:
58
56
  - lib
59
57
  required_ruby_version: !ruby/object:Gem::Requirement
60
- none: false
61
58
  requirements:
62
- - - ! '>='
59
+ - - '>='
63
60
  - !ruby/object:Gem::Version
64
61
  version: '0'
65
62
  required_rubygems_version: !ruby/object:Gem::Requirement
66
- none: false
67
63
  requirements:
68
- - - ! '>='
64
+ - - '>='
69
65
  - !ruby/object:Gem::Version
70
66
  version: '0'
71
67
  requirements: []
72
68
  rubyforge_project:
73
- rubygems_version: 1.8.25
69
+ rubygems_version: 2.0.2
74
70
  signing_key:
75
- specification_version: 3
71
+ specification_version: 4
76
72
  summary: Gemified crossfilter.js asset for Rails
77
73
  test_files: []