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.
checksums.yaml
ADDED
@@ -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
|
(function(exports){
|
2
|
-
crossfilter.version = "1.
|
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
|
-
|
36
|
-
|
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
|
-
|
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)
|
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, //
|
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 =
|
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
|
-
|
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
|
-
|
615
|
-
|
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
|
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
|
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
|
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
|
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 (
|
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
|
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,
|
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.
|
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-
|
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:
|
69
|
+
rubygems_version: 2.0.2
|
74
70
|
signing_key:
|
75
|
-
specification_version:
|
71
|
+
specification_version: 4
|
76
72
|
summary: Gemified crossfilter.js asset for Rails
|
77
73
|
test_files: []
|