This repository has been archived by the owner on Apr 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
crossfilter-async.min.js
1 lines (1 loc) · 14 KB
/
crossfilter-async.min.js
1
!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.crossfilterAsync=n()}}(function(){var define,module,exports;return function n(e,r,i){function o(u,l){if(!r[u]){if(!e[u]){var d="function"==typeof require&&require;if(!l&&d)return d(u,!0);if(t)return t(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var c=r[u]={exports:{}};e[u][0].call(c.exports,function(n){var r=e[u][1][n];return o(r?r:n)},c,c.exports,n,e,r,i)}return r[u].exports}for(var t="function"==typeof require&&require,u=0;u<i.length;u++)o(i[u]);return o}({1:[function(require,module,exports){(function(global){var operative="undefined"!=typeof window?window.operative:"undefined"!=typeof global?global.operative:null,cfFacade=function(data,cfUrl){cfUrl||(cfUrl="crossfilter.js");var opfilter=operative({unpack:function unpackFunction(func,context){var internal,evalStr="";return context&&(evalStr+=context),evalStr+="internal = "+func,eval(evalStr),internal},crossfilters:{},crossfilterIndex:0,dimensions:{},dimensionIndex:0,groupAlls:{},groupAllIndex:0,dimensionGroupAlls:{},dimensionGroupAllIndex:0,dimensionGroups:{},dimensionGroupIndex:0,"new":function(n){n?this.crossfilters[this.crossfilterIndex]=crossfilter(n):this.crossfilters[this.crossfilterIndex]=crossfilter([]);var e=this.crossfilterIndex;this.crossfilterIndex++,this.deferred().fulfill(e)},dimension:function(n,e){var r=this.deferred();this.dimensions[this.dimensionIndex]=this.crossfilters[n].dimension(this.unpack(e));var i=this.dimensionIndex;this.dimensionIndex++,r.fulfill(i)},"dimension.dispose":function(n){this.dimensions[n].dispose(),this.deferred().fulfill()},"dimension.groupAll":function(n){this.dimensionGroupAlls[this.dimensionGroupAllIndex]=this.dimensions[n].groupAll();var e=this.dimensionGroupAllIndex;this.dimensionGroupAllIndex++,this.deferred().fulfill(e)},"dimension.groupAll.value":function(n){var e=this.dimensionGroupAlls[n].value();this.deferred().fulfill(e)},"dimension.groupAll.reduceSum":function(n,e){this.dimensionGroupAlls[n].reduceSum(this.unpack(e)),this.deferred().fulfill()},"dimension.groupAll.reduceCount":function(n){this.dimensionGroupAlls[n].reduceCount(),this.deferred().fulfill()},"dimension.groupAll.reduce":function(n,e,r,i){this.dimensionGroupAlls[n].reduce(this.unpack(e),this.unpack(r),this.unpack(i)),this.deferred().fulfill()},"dimension.groupAll.dispose":function(n){this.dimensionGroupAlls[n].dispose(),this.deferred().fulfill()},"dimension.filterRange":function(n,e){this.dimensions[n].filterRange(e),this.deferred().fulfill()},"dimension.filterExact":function(n,e){this.dimensions[n].filterExact(e),this.deferred().fulfill()},"dimension.filterFunction":function(n,e){this.dimensions[n].filterFunction(this.unpack(e)),this.deferred().fulfill()},"dimension.filterAll":function(n){this.dimensions[n].filterAll(),this.deferred().fulfill()},"dimension.filter":function(n,e){this.dimensions[n].filter(e),this.deferred().fulfill()},"dimension.top":function(n,e){var r=this.dimensions[n].top(e);this.deferred().fulfill(r)},"dimension.bottom":function(n,e){var r=this.dimensions[n].bottom(e);this.deferred().fulfill(r)},"dimension.group":function(n,e){this.dimensionGroups[this.dimensionGroupIndex]=this.dimensions[n].group(this.unpack(e));var r=this.dimensionGroupIndex;this.dimensionGroupIndex++,this.deferred().fulfill(r)},"dimension.group.top":function(n,e){var r=this.dimensionGroups[n].top(e);this.deferred().fulfill(r)},"dimension.group.all":function(n){var e=this.dimensionGroups[n].all();this.deferred().fulfill(e)},"dimension.group.size":function(n){var e=this.dimensionGroups[n].size();this.deferred().fulfill(e)},"dimension.group.reduce":function(n,e,r,i){this.dimensionGroups[n].reduce(this.unpack(e),this.unpack(r),this.unpack(i)),this.deferred().fulfill()},"dimension.group.order":function(n,e){this.dimensionGroups[n].order(this.unpack(e)),this.deferred().fulfill()},"dimension.group.orderNatural":function(n){this.dimensionGroups[n].orderNatural(),this.deferred().fulfill()},"dimension.group.reduceSum":function(n,e){this.dimensionGroups[n].reduceSum(this.unpack(e)),this.deferred().fulfill()},"dimension.group.reduceCount":function(n){this.dimensionGroups[n].reduceCount(),this.deferred().fulfill()},"dimension.group.dispose":function(n){this.dimensionGroups[n].dispose(),this.deferred().fulfill()},groupAll:function(n){var e=this.deferred();this.groupAlls[this.groupAllIndex]=this.crossfilters[n].groupAll();var r=this.groupAllIndex;this.groupAllIndex++,e.fulfill(r)},"groupAll.value":function(n){var e=this.groupAlls[n].value();this.deferred().fulfill(e)},"groupAll.reduceSum":function(n,e){this.groupAlls[n].reduceSum(this.unpack(e)),this.deferred().fulfill()},"groupAll.reduceCount":function(n){this.groupAlls[n].reduceCount(),this.deferred().fulfill()},"groupAll.reduce":function(n,e,r,i){this.groupAlls[n].reduce(this.unpack(e),this.unpack(r),this.unpack(i)),this.deferred().fulfill()},"groupAll.dispose":function(n){this.groupAlls[n].dispose(),this.deferred().fulfill()},add:function(n,e){this.crossfilters[n].add(e),this.deferred().fulfill()},size:function(n){var e=this.crossfilters[n].size();this.deferred().fulfill(e)},all:function(n){var e=this.crossfilters[n].all();this.deferred().fulfill(e)},remove:function(n){this.crossfilters[n].remove(),this.deferred().fulfill()}},[cfUrl]),readSynchronizer=Promise.all([]),updateSynchronizer=Promise.all([]),cfIndex=opfilter["new"](data),cfAsync={dimension:function(n){var e=cfIndex.then(function(e){return opfilter.dimension(e,n.toString())});return{dispose:function(){var n=Promise.all([e,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter["dimension.dispose"](n[0])});return updateSynchronizer=Promise.all([updateSynchronizer,n]),n},groupAll:function(){var n=e.then(function(n){return opfilter["dimension.groupAll"](n)});return{value:function(){var e=Promise.all([n,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter["dimension.groupAll.value"](n[0])});return readSynchronizer=Promise.all([readSynchronizer,e]),e},reduceSum:function(e){var r=Promise.all([n,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter["dimension.groupAll.reduceSum"](n[0],e.toString())});return updateSynchronizer=Promise.all([updateSynchronizer,r]),this},reduceCount:function(){var e=Promise.all([n,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter["dimension.groupAll.reduceCount"](n[0])});return updateSynchronizer=Promise.all([updateSynchronizer,e]),this},reduce:function(e,r,i){var o=Promise.all([n,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter["dimension.groupAll.reduce"](n[0],e.toString(),r.toString(),i.toString())});return updateSynchronizer=Promise.all([updateSynchronizer,o]),this},dispose:function(){var e=Promise.all([n,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter["dimension.groupAll.dispose"](n[0])});return updateSynchronizer=Promise.all([updateSynchronizer,e]),e}}},group:function(n){var r=e.then(function(e){return opfilter["dimension.group"](e,n?n.toString():function(n){return n}.toString())});return{top:function(n){var e=Promise.all([r,readSynchronizer,updateSynchronizer]).then(function(e){return opfilter["dimension.group.top"](e[0],n)});return readSynchronizer=Promise.all([readSynchronizer,e]),e},all:function(){var n=Promise.all([r,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter["dimension.group.all"](n[0])});return readSynchronizer=Promise.all([readSynchronizer,n]),n},size:function(){return r.then(function(n){return opfilter["dimension.group.size"](n)})},reduceSum:function(n){var e=Promise.all([r,readSynchronizer,updateSynchronizer]).then(function(e){return opfilter["dimension.group.reduceSum"](e[0],n.toString())});return updateSynchronizer=Promise.all([updateSynchronizer,e]),this},reduceCount:function(){var n=Promise.all([r,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter["dimension.group.reduceCount"](n[0])});return updateSynchronizer=Promise.all([updateSynchronizer,n]),this},reduce:function(n,e,i){var o=Promise.all([r,readSynchronizer,updateSynchronizer]).then(function(r){return opfilter["dimension.group.reduce"](r[0],n.toString(),e.toString(),i.toString())});return updateSynchronizer=Promise.all([updateSynchronizer,o]),this},order:function(n){var e=Promise.all([r,readSynchronizer,updateSynchronizer]).then(function(e){return opfilter["dimension.group.order"](e[0],n.toString())});return updateSynchronizer=Promise.all([updateSynchronizer,e]),this},orderNatural:function(){var n=Promise.all([r,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter["dimension.group.orderNatural"](n[0])});return updateSynchronizer=Promise.all([updateSynchronizer,n]),this},dispose:function(){var n=Promise.all([r,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter["dimension.group.dispose"](n[0])});return updateSynchronizer=Promise.all([updateSynchronizer,n]),n}}},filterRange:function(n){var r=Promise.all([e,readSynchronizer,updateSynchronizer]).then(function(e){return opfilter["dimension.filterRange"](e[0],n)});return updateSynchronizer=Promise.all([updateSynchronizer,r]),r},filterExact:function(n){var r=Promise.all([e,readSynchronizer,updateSynchronizer]).then(function(e){return opfilter["dimension.filterExact"](e[0],n)});return updateSynchronizer=Promise.all([updateSynchronizer,r]),r},filterFunction:function(n){var r=Promise.all([e,readSynchronizer,updateSynchronizer]).then(function(e){return opfilter["dimension.filterFunction"](e[0],n.toString())});return updateSynchronizer=Promise.all([updateSynchronizer,r]),r},filterAll:function(){var n=Promise.all([e,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter["dimension.filterAll"](n[0])});return updateSynchronizer=Promise.all([updateSynchronizer,n]),n},filter:function(n){var r=Promise.all([e,readSynchronizer,updateSynchronizer]).then(function(e){return opfilter["dimension.filter"](e[0],n)});return updateSynchronizer=Promise.all([updateSynchronizer,r]),r},top:function(n){var r=Promise.all([e,readSynchronizer,updateSynchronizer]).then(function(e){return opfilter["dimension.top"](e[0],n)});return readSynchronizer=Promise.all([readSynchronizer,r]),r},bottom:function(n){var r=Promise.all([e,readSynchronizer,updateSynchronizer]).then(function(e){return opfilter["dimension.bottom"](e[0],n)});return readSynchronizer=Promise.all([readSynchronizer,r]),r}}},groupAll:function(){var n=cfIndex.then(function(n){return opfilter.groupAll(n)});return{value:function(){var e=Promise.all([n,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter["groupAll.value"](n[0])});return readSynchronizer=Promise.all([readSynchronizer,e]),e},reduceSum:function(e){var r=Promise.all([n,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter["groupAll.reduceSum"](n[0],e.toString())});return updateSynchronizer=Promise.all([updateSynchronizer,r]),this},reduceCount:function(){var e=Promise.all([n,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter["groupAll.reduceCount"](n[0])});return updateSynchronizer=Promise.all([updateSynchronizer,e]),this},reduce:function(e,r,i){var o=Promise.all([n,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter["groupAll.reduce"](n[0],e.toString(),r.toString(),i.toString())});return updateSynchronizer=Promise.all([updateSynchronizer,o]),this},dispose:function(){var e=Promise.all([n,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter["groupAll.dispose"](n[0])});return updateSynchronizer=Promise.all([updateSynchronizer,e]),e}}},remove:function(){var n=Promise.all([cfIndex,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter.remove(n[0])});return updateSynchronizer=Promise.all([updateSynchronizer,n]),this},add:function(n){var e=Promise.all([cfIndex,readSynchronizer,updateSynchronizer]).then(function(e){return opfilter.add(e[0],n)});return updateSynchronizer=Promise.all([updateSynchronizer,e]),this},size:function(){var n=Promise.all([cfIndex,readSynchronizer,updateSynchronizer]).then(function(n){return opfilter.size(n[0])});return readSynchronizer=Promise.all([readSynchronizer,n]),n},all:function(){return cfIndex.then(function(n){return opfilter.all(n)})}},callback=function(){};return cfAsync.facade={dimension:function(n){var e=cfAsync.dimension(n);return{dispose:e.dispose,groupAll:function(){var n=e.groupAll(),r={};return{value:function(){return n.value().then(function(n){r=n}).then(callback),r},reduceSum:function(e){return n.reduceSum(e),this},reduceCount:function(){return n.reduceCount(),this},reduce:function(e,r,i){return n.reduce(e,r,i),this},dispose:function(){n.dispose()}}},group:function(n){var r=e.group(n),i=[],o=[],t=0;return{top:function(n){return r.top(1/0).then(function(n){i=n}).then(callback),i.slice(0,n)},all:function(){return r.all().then(function(n){o=n}).then(callback),o},size:function(){return r.size().then(function(n){t=n}).then(callback),t},reduceSum:function(n){return r.reduceSum(n),this},reduceCount:function(){return r.reduceCount(),this},reduce:function(n,e,i){return r.reduce(n,e,i),this},order:function(n){return r.order(n),this},orderNatural:function(){return r.orderNatural(),this},dispose:function(){r.dispose()}}},filterRange:function(n){e.filterRange(n)},filterExact:function(n){e.filterExact(n)},filterFunction:function(n){e.filterFunction(n)},filterAll:function(){e.filterAll()},filter:function(n){e.filter(n)},top:function(n){},bottom:function(n){}}},groupAll:function(){var n=cfAsync.groupAll();return{value:function(){},reduceSum:function(e){return n.reduceSum(e),this},reduceCount:function(){return n.reduceCount(),this},reduce:function(e,r,i){return n.reduct(e,r,i),this},dispose:function(){n.dispose()}}},remove:function(){return cfAsync.remove(),this},add:function(n){return cfAsync.add(n),this},size:function(){},all:function(){},callback:function(n){return n?void(callback=n):callback}},cfAsync};module.exports=cfFacade}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)});