Socket
Socket
Sign inDemoInstall

pivottable

Package Overview
Dependencies
1
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.3.0 to 2.4.0

composer.json

2

bower.json
{
"name": "pivottable",
"description": "Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop",
"version": "2.3.0",
"version": "2.4.0",
"main": [

@@ -6,0 +6,0 @@ "dist/pivot.js",

@@ -16,5 +16,5 @@ ## Issues

* Multiple small pull requests which aim to solve clearly-stated problems are preferable to large pull requests which make many unrelated changes
* The code for this project is written in CoffeeScript and thereafter compiled to Javascript, so it would be best to submit modifications to the CoffeeScript source files rather than to the automatically-generated Javascript source files (please reach out if you've made some neat modifications to the Javascript and want help 'porting' back up to the CoffeeScript version).
* The code for this project is written in CoffeeScript and thereafter compiled to Javascript, so it would be best to submit modifications to the CoffeeScript source files rather than to the automatically-generated Javascript source files (please reach out if you've made some neat modifications to the Javascript and want help 'porting' back up to the CoffeeScript version).
* Releases for this project are built using the Gulp build system, and the resulting build products (located under `dist`) are tested with the Jasmine test suite under `tests`. See the building/test section of the main [ReadMe](https://github.com/nicolaskruchten/pivottable/blob/master/ReadMe.md) for details.
* The aim of this project is to have an extensible core component that fits into a single smallish file ([pivot.coffee](https://github.com/nicolaskruchten/pivottable/blob/master/pivot.coffee)), which depends only on the jQuery and jQueryUI core. If you want to submit changes which depend on other libraries, please submit them as separate 'plugin' files like the Google Chart or D3 renderers.
* This is a cross-browser, client-side library with very little (if any) browser-specific shim code, so please try to submit modifications that work with as many browsers as possible and which don't require any server-side components

@@ -459,4 +459,4 @@ (function() {

}
a = String(as).toLowerCase();
b = String(bs).toLowerCase();
a = String(as);
b = String(bs);
if (a === b) {

@@ -605,11 +605,2 @@ return 0;

PivotData.convertToArray = function(input) {
var result;
result = [];
PivotData.forEachRecord(input, {}, function(record) {
return result.push(record);
});
return result;
};
PivotData.prototype.arrSort = function(attrs) {

@@ -966,3 +957,3 @@ var a, sortersArr;

$.fn.pivotUI = function(input, inputOpts, overwrite, locale) {
var a, aggregator, attrLength, axisValues, c, colList, defaults, e, error, existingOpts, fn, i, initialRender, k, l, len1, len2, len3, len4, n, o, opts, pivotTable, q, ref, ref1, ref2, ref3, ref4, refresh, refreshDelayed, renderer, rendererControl, shownAttributes, tblCols, tr1, tr2, uiTable, unusedAttrsVerticalAutoCutoff, unusedAttrsVerticalAutoOverride, x;
var a, aggregator, attr, attrLength, attrValues, defaults, e, error, existingOpts, fn, i, initialRender, l, len1, len2, len3, materializedInput, n, o, opts, pivotTable, recordsProcessed, ref, ref1, ref2, ref3, refresh, refreshDelayed, renderer, rendererControl, shownAttributes, tr1, tr2, uiTable, unused, unusedAttrsVerticalAutoCutoff, unusedAttrsVerticalAutoOverride, x;
if (overwrite == null) {

@@ -1008,43 +999,28 @@ overwrite = false;

try {
input = PivotData.convertToArray(input);
tblCols = (function() {
var ref, results;
ref = input[0];
results = [];
for (k in ref) {
if (!hasProp.call(ref, k)) continue;
results.push(k);
attrValues = {};
materializedInput = [];
recordsProcessed = 0;
PivotData.forEachRecord(input, opts.derivedAttributes, function(record) {
var attr, base, ref, value;
if (!opts.filter(record)) {
return;
}
return results;
})();
ref = opts.derivedAttributes;
for (c in ref) {
if (!hasProp.call(ref, c)) continue;
if ((indexOf.call(tblCols, c) < 0)) {
tblCols.push(c);
materializedInput.push(record);
for (attr in record) {
if (!hasProp.call(record, attr)) continue;
if (attrValues[attr] == null) {
attrValues[attr] = {};
if (recordsProcessed > 0) {
attrValues[attr]["null"] = recordsProcessed;
}
}
}
}
axisValues = {};
for (l = 0, len1 = tblCols.length; l < len1; l++) {
x = tblCols[l];
axisValues[x] = {};
}
PivotData.forEachRecord(input, opts.derivedAttributes, function(record) {
var base, results, v;
results = [];
for (k in record) {
if (!hasProp.call(record, k)) continue;
v = record[k];
if (!(opts.filter(record))) {
continue;
for (attr in attrValues) {
value = (ref = record[attr]) != null ? ref : "null";
if ((base = attrValues[attr])[value] == null) {
base[value] = 0;
}
if (v == null) {
v = "null";
}
if ((base = axisValues[k])[v] == null) {
base[v] = 0;
}
results.push(axisValues[k][v]++);
attrValues[attr][value]++;
}
return results;
return recordsProcessed++;
});

@@ -1058,15 +1034,14 @@ uiTable = $("<table>", {

});
ref1 = opts.renderers;
for (x in ref1) {
if (!hasProp.call(ref1, x)) continue;
ref = opts.renderers;
for (x in ref) {
if (!hasProp.call(ref, x)) continue;
$("<option>").val(x).html(x).appendTo(renderer);
}
colList = $("<td>").addClass('pvtAxisContainer pvtUnused');
unused = $("<td>").addClass('pvtAxisContainer pvtUnused');
shownAttributes = (function() {
var len2, n, results;
var results;
results = [];
for (n = 0, len2 = tblCols.length; n < len2; n++) {
c = tblCols[n];
if (indexOf.call(opts.hiddenAttributes, c) < 0) {
results.push(c);
for (a in attrValues) {
if (indexOf.call(opts.hiddenAttributes, a) < 0) {
results.push(a);
}

@@ -1084,4 +1059,4 @@ }

attrLength = 0;
for (n = 0, len2 = shownAttributes.length; n < len2; n++) {
a = shownAttributes[n];
for (l = 0, len1 = shownAttributes.length; l < len1; l++) {
a = shownAttributes[l];
attrLength += a.length;

@@ -1092,13 +1067,13 @@ }

if (opts.unusedAttrsVertical === true || unusedAttrsVerticalAutoOverride) {
colList.addClass('pvtVertList');
unused.addClass('pvtVertList');
} else {
colList.addClass('pvtHorizList');
unused.addClass('pvtHorizList');
}
fn = function(c) {
var attrElem, btns, checkContainer, filterItem, filterItemExcluded, hasExcludedItem, keys, len3, o, ref2, showFilterList, triangleLink, updateFilter, v, valueList;
keys = (function() {
fn = function(attr) {
var attrElem, btns, checkContainer, filterItem, filterItemExcluded, hasExcludedItem, len2, n, ref1, showFilterList, triangleLink, updateFilter, v, value, valueCount, valueList, values;
values = (function() {
var results;
results = [];
for (k in axisValues[c]) {
results.push(k);
for (v in attrValues[attr]) {
results.push(v);
}

@@ -1109,4 +1084,4 @@ return results;

valueList = $("<div>").addClass('pvtFilterBox').hide();
valueList.append($("<h4>").text(c + " (" + keys.length + ")"));
if (keys.length > opts.menuLimit) {
valueList.append($("<h4>").text(attr + " (" + values.length + ")"));
if (values.length > opts.menuLimit) {
valueList.append($("<p>").html(opts.localeStrings.tooMany));

@@ -1144,17 +1119,17 @@ } else {

checkContainer = $("<div>").addClass("pvtCheckContainer").appendTo(valueList);
ref2 = keys.sort(getSort(opts.sorters, c));
for (o = 0, len3 = ref2.length; o < len3; o++) {
k = ref2[o];
v = axisValues[c][k];
ref1 = values.sort(getSort(opts.sorters, attr));
for (n = 0, len2 = ref1.length; n < len2; n++) {
value = ref1[n];
valueCount = attrValues[attr][value];
filterItem = $("<label>");
filterItemExcluded = false;
if (opts.inclusions[c]) {
filterItemExcluded = (indexOf.call(opts.inclusions[c], k) < 0);
} else if (opts.exclusions[c]) {
filterItemExcluded = (indexOf.call(opts.exclusions[c], k) >= 0);
if (opts.inclusions[attr]) {
filterItemExcluded = (indexOf.call(opts.inclusions[attr], value) < 0);
} else if (opts.exclusions[attr]) {
filterItemExcluded = (indexOf.call(opts.exclusions[attr], value) >= 0);
}
hasExcludedItem || (hasExcludedItem = filterItemExcluded);
$("<input>").attr("type", "checkbox").addClass('pvtFilter').attr("checked", !filterItemExcluded).data("filter", [c, k]).appendTo(filterItem);
filterItem.append($("<span>").text(k));
filterItem.append($("<span>").text(" (" + v + ")"));
$("<input>").attr("type", "checkbox").addClass('pvtFilter').attr("checked", !filterItemExcluded).data("filter", [attr, value]).appendTo(filterItem);
filterItem.append($("<span>").text(value));
filterItem.append($("<span>").text(" (" + valueCount + ")"));
checkContainer.append($("<p>").append(filterItem));

@@ -1171,3 +1146,3 @@ }

}
if (keys.length > opts.menuLimit) {
if (values.length > opts.menuLimit) {
return valueList.toggle();

@@ -1182,7 +1157,7 @@ } else {

showFilterList = function(e) {
var clickLeft, clickTop, ref3;
ref3 = $(e.currentTarget).position(), clickLeft = ref3.left, clickTop = ref3.top;
var left, ref2, top;
ref2 = $(e.currentTarget).position(), left = ref2.left, top = ref2.top;
valueList.css({
left: clickLeft + 10,
top: clickTop + 10
left: left + 10,
top: top + 10
}).toggle();

@@ -1193,13 +1168,12 @@ valueList.find('.pvtSearch').val('');

triangleLink = $("<span>").addClass('pvtTriangle').html(" &#x25BE;").bind("click", showFilterList);
attrElem = $("<li>").addClass("axis_" + i).append($("<span>").addClass('pvtAttr').text(c).data("attrName", c).append(triangleLink));
attrElem = $("<li>").addClass("axis_" + i).append($("<span>").addClass('pvtAttr').text(attr).data("attrName", attr).append(triangleLink)).bind("dblclick", showFilterList);
if (hasExcludedItem) {
attrElem.addClass('pvtFilteredAttribute');
}
colList.append(attrElem).append(valueList);
return attrElem.bind("dblclick", showFilterList);
return unused.append(attrElem).append(valueList);
};
for (i in shownAttributes) {
if (!hasProp.call(shownAttributes, i)) continue;
c = shownAttributes[i];
fn(c);
attr = shownAttributes[i];
fn(attr);
}

@@ -1210,5 +1184,5 @@ tr1 = $("<tr>").appendTo(uiTable);

});
ref2 = opts.aggregators;
for (x in ref2) {
if (!hasProp.call(ref2, x)) continue;
ref1 = opts.aggregators;
for (x in ref1) {
if (!hasProp.call(ref1, x)) continue;
aggregator.append($("<option>").val(x).html(x));

@@ -1223,15 +1197,15 @@ }

uiTable.find('tr:nth-child(1)').prepend(rendererControl);
uiTable.find('tr:nth-child(2)').prepend(colList);
uiTable.find('tr:nth-child(2)').prepend(unused);
} else {
uiTable.prepend($("<tr>").append(rendererControl).append(colList));
uiTable.prepend($("<tr>").append(rendererControl).append(unused));
}
this.html(uiTable);
ref3 = opts.cols;
ref2 = opts.cols;
for (n = 0, len2 = ref2.length; n < len2; n++) {
x = ref2[n];
this.find(".pvtCols").append(this.find(".axis_" + ($.inArray(x, shownAttributes))));
}
ref3 = opts.rows;
for (o = 0, len3 = ref3.length; o < len3; o++) {
x = ref3[o];
this.find(".pvtCols").append(this.find(".axis_" + ($.inArray(x, shownAttributes))));
}
ref4 = opts.rows;
for (q = 0, len4 = ref4.length; q < len4; q++) {
x = ref4[q];
this.find(".pvtRows").append(this.find(".axis_" + ($.inArray(x, shownAttributes))));

@@ -1248,3 +1222,3 @@ }

return function() {
var attr, exclusions, inclusions, len5, newDropdown, numInputsToProcess, pivotUIOptions, pvtVals, ref5, ref6, s, subopts, t, unusedAttrsContainer, vals;
var exclusions, inclusions, len4, newDropdown, numInputsToProcess, pivotUIOptions, pvtVals, q, ref4, ref5, s, subopts, unusedAttrsContainer, vals;
subopts = {

@@ -1259,3 +1233,3 @@ derivedAttributes: opts.derivedAttributes,

};
numInputsToProcess = (ref5 = opts.aggregators[aggregator.val()]([])().numInputs) != null ? ref5 : 0;
numInputsToProcess = (ref4 = opts.aggregators[aggregator.val()]([])().numInputs) != null ? ref4 : 0;
vals = [];

@@ -1280,8 +1254,8 @@ _this.find(".pvtRows li span.pvtAttr").each(function() {

pvtVals = _this.find(".pvtVals");
for (x = s = 0, ref6 = numInputsToProcess; 0 <= ref6 ? s < ref6 : s > ref6; x = 0 <= ref6 ? ++s : --s) {
for (x = q = 0, ref5 = numInputsToProcess; 0 <= ref5 ? q < ref5 : q > ref5; x = 0 <= ref5 ? ++q : --q) {
newDropdown = $("<select>").addClass('pvtAttrDropdown').append($("<option>")).bind("change", function() {
return refresh();
});
for (t = 0, len5 = shownAttributes.length; t < len5; t++) {
attr = shownAttributes[t];
for (s = 0, len4 = shownAttributes.length; s < len4; s++) {
attr = shownAttributes[s];
newDropdown.append($("<option>").val(attr).text(attr));

@@ -1328,3 +1302,3 @@ }

subopts.filter = function(record) {
var excludedItems, ref7;
var excludedItems, k, ref6, ref7;
if (!opts.filter(record)) {

@@ -1335,3 +1309,3 @@ return false;

excludedItems = exclusions[k];
if (ref7 = "" + record[k], indexOf.call(excludedItems, ref7) >= 0) {
if (ref6 = "" + ((ref7 = record[k]) != null ? ref7 : 'null'), indexOf.call(excludedItems, ref6) >= 0) {
return false;

@@ -1342,3 +1316,3 @@ }

};
pivotTable.pivot(input, subopts);
pivotTable.pivot(materializedInput, subopts);
pivotUIOptions = $.extend(opts, {

@@ -1345,0 +1319,0 @@ cols: subopts.cols,

@@ -1,2 +0,2 @@

(function(){var t,e=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},n=[].slice,r=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;(t=function(t){return"object"==typeof exports&&"object"==typeof module?t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){var o,i,s,u,l,c,p,h,d,f,m,g,v,C,b,A,y,w;return i=function(t,e,n){var r,a,o,i;for(t+="",a=t.split("."),o=a[0],i=a.length>1?n+a[1]:"",r=/(\d+)(\d{3})/;r.test(o);)o=o.replace(r,"$1"+e+"$2");return o+i},m=function(e){var n;return n={digitsAfterDecimal:2,scaler:1,thousandsSep:",",decimalSep:".",prefix:"",suffix:"",showZero:!1},e=t.extend(n,e),function(t){var n;return isNaN(t)||!isFinite(t)?"":0!==t||e.showZero?(n=i((e.scaler*t).toFixed(e.digitsAfterDecimal),e.thousandsSep,e.decimalSep),""+e.prefix+n+e.suffix):""}},b=m(),A=m({digitsAfterDecimal:0}),y=m({digitsAfterDecimal:1,scaler:100,suffix:"%"}),s={count:function(t){return null==t&&(t=A),function(){return function(e,n,r){return{count:0,push:function(){return this.count++},value:function(){return this.count},format:t}}}},countUnique:function(t){return null==t&&(t=A),function(n){var r;return r=n[0],function(n,a,o){return{uniq:[],push:function(t){var n;return n=t[r],e.call(this.uniq,n)<0?this.uniq.push(t[r]):void 0},value:function(){return this.uniq.length},format:t,numInputs:null!=r?0:1}}}},listUnique:function(t){return function(n){var r;return r=n[0],function(n,a,o){return{uniq:[],push:function(t){var n;return n=t[r],e.call(this.uniq,n)<0?this.uniq.push(t[r]):void 0},value:function(){return this.uniq.join(t)},format:function(t){return t},numInputs:null!=r?0:1}}}},sum:function(t){return null==t&&(t=b),function(e){var n;return n=e[0],function(e,r,a){return{sum:0,push:function(t){return isNaN(parseFloat(t[n]))?void 0:this.sum+=parseFloat(t[n])},value:function(){return this.sum},format:t,numInputs:null!=n?0:1}}}},min:function(t){return null==t&&(t=b),function(e){var n;return n=e[0],function(e,r,a){return{val:null,push:function(t){var e,r;return r=parseFloat(t[n]),isNaN(r)?void 0:this.val=Math.min(r,null!=(e=this.val)?e:r)},value:function(){return this.val},format:t,numInputs:null!=n?0:1}}}},max:function(t){return null==t&&(t=b),function(e){var n;return n=e[0],function(e,r,a){return{val:null,push:function(t){var e,r;return r=parseFloat(t[n]),isNaN(r)?void 0:this.val=Math.max(r,null!=(e=this.val)?e:r)},value:function(){return this.val},format:t,numInputs:null!=n?0:1}}}},average:function(t){return null==t&&(t=b),function(e){var n;return n=e[0],function(e,r,a){return{sum:0,len:0,push:function(t){return isNaN(parseFloat(t[n]))?void 0:(this.sum+=parseFloat(t[n]),this.len++)},value:function(){return this.sum/this.len},format:t,numInputs:null!=n?0:1}}}},sumOverSum:function(t){return null==t&&(t=b),function(e){var n,r;return r=e[0],n=e[1],function(e,a,o){return{sumNum:0,sumDenom:0,push:function(t){return isNaN(parseFloat(t[r]))||(this.sumNum+=parseFloat(t[r])),isNaN(parseFloat(t[n]))?void 0:this.sumDenom+=parseFloat(t[n])},value:function(){return this.sumNum/this.sumDenom},format:t,numInputs:null!=r&&null!=n?0:2}}}},sumOverSumBound80:function(t,e){return null==t&&(t=!0),null==e&&(e=b),function(n){var r,a;return a=n[0],r=n[1],function(n,o,i){return{sumNum:0,sumDenom:0,push:function(t){return isNaN(parseFloat(t[a]))||(this.sumNum+=parseFloat(t[a])),isNaN(parseFloat(t[r]))?void 0:this.sumDenom+=parseFloat(t[r])},value:function(){var e;return e=t?1:-1,(.821187207574908/this.sumDenom+this.sumNum/this.sumDenom+1.2815515655446004*e*Math.sqrt(.410593603787454/(this.sumDenom*this.sumDenom)+this.sumNum*(1-this.sumNum/this.sumDenom)/(this.sumDenom*this.sumDenom)))/(1+1.642374415149816/this.sumDenom)},format:e,numInputs:null!=a&&null!=r?0:2}}}},fractionOf:function(t,e,r){return null==e&&(e="total"),null==r&&(r=y),function(){var a;return a=1<=arguments.length?n.call(arguments,0):[],function(n,o,i){return{selector:{total:[[],[]],row:[o,[]],col:[[],i]}[e],inner:t.apply(null,a)(n,o,i),push:function(t){return this.inner.push(t)},format:r,value:function(){return this.inner.value()/n.getAggregator.apply(n,this.selector).inner.value()},numInputs:t.apply(null,a)().numInputs}}}}},u=function(t){return{Count:t.count(A),"Count Unique Values":t.countUnique(A),"List Unique Values":t.listUnique(", "),Sum:t.sum(b),"Integer Sum":t.sum(A),Average:t.average(b),Minimum:t.min(b),Maximum:t.max(b),"Sum over Sum":t.sumOverSum(b),"80% Upper Bound":t.sumOverSumBound80(!0,b),"80% Lower Bound":t.sumOverSumBound80(!1,b),"Sum as Fraction of Total":t.fractionOf(t.sum(),"total",y),"Sum as Fraction of Rows":t.fractionOf(t.sum(),"row",y),"Sum as Fraction of Columns":t.fractionOf(t.sum(),"col",y),"Count as Fraction of Total":t.fractionOf(t.count(),"total",y),"Count as Fraction of Rows":t.fractionOf(t.count(),"row",y),"Count as Fraction of Columns":t.fractionOf(t.count(),"col",y)}}(s),v={Table:function(t,e){return g(t,e)},"Table Barchart":function(e,n){return t(g(e,n)).barchart()},Heatmap:function(e,n){return t(g(e,n)).heatmap("heatmap",n)},"Row Heatmap":function(e,n){return t(g(e,n)).heatmap("rowheatmap",n)},"Col Heatmap":function(e,n){return t(g(e,n)).heatmap("colheatmap",n)}},h={en:{aggregators:u,renderers:v,localeStrings:{renderError:"An error occurred rendering the PivotTable results.",computeError:"An error occurred computing the PivotTable results.",uiRenderError:"An error occurred rendering the PivotTable UI.",selectAll:"Select All",selectNone:"Select None",tooMany:"(too many to list)",filterResults:"Filter results",totals:"Totals",vs:"vs",by:"by"}}},d=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],l=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],w=function(t){return("0"+t).substr(-2,2)},c={bin:function(t,e){return function(n){return n[t]-n[t]%e}},dateFormat:function(t,e,n,r,a){var o;return null==n&&(n=!1),null==r&&(r=d),null==a&&(a=l),o=n?"UTC":"",function(n){var i;return i=new Date(Date.parse(n[t])),isNaN(i)?"":e.replace(/%(.)/g,function(t,e){switch(e){case"y":return i["get"+o+"FullYear"]();case"m":return w(i["get"+o+"Month"]()+1);case"n":return r[i["get"+o+"Month"]()];case"d":return w(i["get"+o+"Date"]());case"w":return a[i["get"+o+"Day"]()];case"x":return i["get"+o+"Day"]();case"H":return w(i["get"+o+"Hours"]());case"M":return w(i["get"+o+"Minutes"]());case"S":return w(i["get"+o+"Seconds"]());default:return"%"+e}})}}},f=function(t){return function(t,e){var n,r,a,o,i,s,u;if(s=/(\d+)|(\D+)/g,i=/\d/,u=/^0/,"number"==typeof t||"number"==typeof e)return isNaN(t)?1:isNaN(e)?-1:t-e;if(n=String(t).toLowerCase(),a=String(e).toLowerCase(),n===a)return 0;if(!i.test(n)||!i.test(a))return n>a?1:-1;for(n=n.match(s),a=a.match(s);n.length&&a.length;)if(r=n.shift(),o=a.shift(),r!==o)return i.test(r)&&i.test(o)?r.replace(u,".0")-o.replace(u,".0"):r>o?1:-1;return n.length-a.length}}(this),C=function(t){var e,n,r;n={};for(e in t)r=t[e],n[r]=e;return function(t,e){return null!=n[t]&&null!=n[e]?n[t]-n[e]:null!=n[t]?-1:null!=n[e]?1:f(t,e)}},p=function(e,n){var r;return r=e(n),t.isFunction(r)?r:f},o=function(){function e(t,n){this.getAggregator=r(this.getAggregator,this),this.getRowKeys=r(this.getRowKeys,this),this.getColKeys=r(this.getColKeys,this),this.sortKeys=r(this.sortKeys,this),this.arrSort=r(this.arrSort,this),this.aggregator=n.aggregator,this.aggregatorName=n.aggregatorName,this.colAttrs=n.cols,this.rowAttrs=n.rows,this.valAttrs=n.vals,this.sorters=n.sorters,this.tree={},this.rowKeys=[],this.colKeys=[],this.rowTotals={},this.colTotals={},this.allTotal=this.aggregator(this,[],[]),this.sorted=!1,e.forEachRecord(t,n.derivedAttributes,function(t){return function(e){return n.filter(e)?t.processRecord(e):void 0}}(this))}return e.forEachRecord=function(e,n,r){var o,i,s,u,l,c,p,h,d,f,m,g;if(o=t.isEmptyObject(n)?r:function(t){var e,a,o;for(e in n)o=n[e],t[e]=null!=(a=o(t))?a:t[e];return r(t)},t.isFunction(e))return e(o);if(t.isArray(e)){if(t.isArray(e[0])){f=[];for(s in e)if(a.call(e,s)&&(i=e[s],s>0)){h={},d=e[0];for(u in d)a.call(d,u)&&(l=d[u],h[l]=i[u]);f.push(o(h))}return f}for(m=[],c=0,p=e.length;p>c;c++)h=e[c],m.push(o(h));return m}if(e instanceof jQuery)return g=[],t("thead > tr > th",e).each(function(e){return g.push(t(this).text())}),t("tbody > tr",e).each(function(e){return h={},t("td",this).each(function(e){return h[g[e]]=t(this).text()}),o(h)});throw new Error("unknown input format")},e.convertToArray=function(t){var n;return n=[],e.forEachRecord(t,{},function(t){return n.push(t)}),n},e.prototype.arrSort=function(t){var e,n;return n=function(){var n,r,a;for(a=[],n=0,r=t.length;r>n;n++)e=t[n],a.push(p(this.sorters,e));return a}.call(this),function(t,e){var r,o,i;for(o in n)if(a.call(n,o)&&(i=n[o],r=i(t[o],e[o]),0!==r))return r;return 0}},e.prototype.sortKeys=function(){return this.sorted?void 0:(this.sorted=!0,this.rowKeys.sort(this.arrSort(this.rowAttrs)),this.colKeys.sort(this.arrSort(this.colAttrs)))},e.prototype.getColKeys=function(){return this.sortKeys(),this.colKeys},e.prototype.getRowKeys=function(){return this.sortKeys(),this.rowKeys},e.prototype.processRecord=function(t){var e,n,r,a,o,i,s,u,l,c,p,h,d;for(e=[],h=[],u=this.colAttrs,a=0,o=u.length;o>a;a++)d=u[a],e.push(null!=(l=t[d])?l:"null");for(c=this.rowAttrs,s=0,i=c.length;i>s;s++)d=c[s],h.push(null!=(p=t[d])?p:"null");return r=h.join(String.fromCharCode(0)),n=e.join(String.fromCharCode(0)),this.allTotal.push(t),0!==h.length&&(this.rowTotals[r]||(this.rowKeys.push(h),this.rowTotals[r]=this.aggregator(this,h,[])),this.rowTotals[r].push(t)),0!==e.length&&(this.colTotals[n]||(this.colKeys.push(e),this.colTotals[n]=this.aggregator(this,[],e)),this.colTotals[n].push(t)),0!==e.length&&0!==h.length?(this.tree[r]||(this.tree[r]={}),this.tree[r][n]||(this.tree[r][n]=this.aggregator(this,h,e)),this.tree[r][n].push(t)):void 0},e.prototype.getAggregator=function(t,e){var n,r,a;return a=t.join(String.fromCharCode(0)),r=e.join(String.fromCharCode(0)),n=0===t.length&&0===e.length?this.allTotal:0===t.length?this.colTotals[r]:0===e.length?this.rowTotals[a]:this.tree[a][r],null!=n?n:{value:function(){return null},format:function(){return""}}},e}(),t.pivotUtilities={aggregatorTemplates:s,aggregators:u,renderers:v,derivers:c,locales:h,naturalSort:f,numberFormat:m,sortAs:C,PivotData:o},g=function(e,n){var r,o,i,s,u,l,c,p,h,d,f,m,g,v,C,b,A,y,w,x,N,T,S;l={localeStrings:{totals:"Totals"}},n=t.extend(l,n),i=e.colAttrs,f=e.rowAttrs,g=e.getRowKeys(),u=e.getColKeys(),d=document.createElement("table"),d.className="pvtTable",v=function(t,e,n){var r,a,o,i,s,u,l,c;if(0!==e){for(i=!0,c=r=0,s=n;s>=0?s>=r:r>=s;c=s>=0?++r:--r)t[e-1][c]!==t[e][c]&&(i=!1);if(i)return-1}for(a=0;e+a<t.length;){for(l=!1,c=o=0,u=n;u>=0?u>=o:o>=u;c=u>=0?++o:--o)t[e][c]!==t[e+a][c]&&(l=!0);if(l)break;a++}return a},y=document.createElement("thead");for(p in i)if(a.call(i,p)){o=i[p],x=document.createElement("tr"),0===parseInt(p)&&0!==f.length&&(A=document.createElement("th"),A.setAttribute("colspan",f.length),A.setAttribute("rowspan",i.length),x.appendChild(A)),A=document.createElement("th"),A.className="pvtAxisLabel",A.textContent=o,x.appendChild(A);for(c in u)a.call(u,c)&&(s=u[c],S=v(u,parseInt(c),parseInt(p)),-1!==S&&(A=document.createElement("th"),A.className="pvtColLabel",A.textContent=s[p],A.setAttribute("colspan",S),parseInt(p)===i.length-1&&0!==f.length&&A.setAttribute("rowspan",2),x.appendChild(A)));0===parseInt(p)&&(A=document.createElement("th"),A.className="pvtTotalLabel",A.innerHTML=n.localeStrings.totals,A.setAttribute("rowspan",i.length+(0===f.length?0:1)),x.appendChild(A)),y.appendChild(x)}if(0!==f.length){x=document.createElement("tr");for(c in f)a.call(f,c)&&(h=f[c],A=document.createElement("th"),A.className="pvtAxisLabel",A.textContent=h,x.appendChild(A));A=document.createElement("th"),0===i.length&&(A.className="pvtTotalLabel",A.innerHTML=n.localeStrings.totals),x.appendChild(A),y.appendChild(x)}d.appendChild(y),C=document.createElement("tbody");for(c in g)if(a.call(g,c)){m=g[c],x=document.createElement("tr");for(p in m)a.call(m,p)&&(N=m[p],S=v(g,parseInt(c),parseInt(p)),-1!==S&&(A=document.createElement("th"),A.className="pvtRowLabel",A.textContent=N,A.setAttribute("rowspan",S),parseInt(p)===f.length-1&&0!==i.length&&A.setAttribute("colspan",2),x.appendChild(A)));for(p in u)a.call(u,p)&&(s=u[p],r=e.getAggregator(m,s),T=r.value(),b=document.createElement("td"),b.className="pvtVal row"+c+" col"+p,b.textContent=r.format(T),b.setAttribute("data-value",T),x.appendChild(b));w=e.getAggregator(m,[]),T=w.value(),b=document.createElement("td"),b.className="pvtTotal rowTotal",b.textContent=w.format(T),b.setAttribute("data-value",T),b.setAttribute("data-for","row"+c),x.appendChild(b),C.appendChild(x)}x=document.createElement("tr"),A=document.createElement("th"),A.className="pvtTotalLabel",A.innerHTML=n.localeStrings.totals,A.setAttribute("colspan",f.length+(0===i.length?0:1)),x.appendChild(A);for(p in u)a.call(u,p)&&(s=u[p],w=e.getAggregator([],s),T=w.value(),b=document.createElement("td"),b.className="pvtTotal colTotal",b.textContent=w.format(T),b.setAttribute("data-value",T),b.setAttribute("data-for","col"+p),x.appendChild(b));return w=e.getAggregator([],[]),T=w.value(),b=document.createElement("td"),b.className="pvtGrandTotal",b.textContent=w.format(T),b.setAttribute("data-value",T),x.appendChild(b),C.appendChild(x),d.appendChild(C),d.setAttribute("data-numrows",g.length),d.setAttribute("data-numcols",u.length),d},t.fn.pivot=function(e,n){var r,a,i,u,l,c,p;r={cols:[],rows:[],vals:[],dataClass:o,filter:function(){return!0},aggregator:s.count()(),aggregatorName:"Count",sorters:function(){},derivedAttributes:{},renderer:g,rendererOptions:null,localeStrings:h.en.localeStrings},n=t.extend(r,n),c=null;try{l=new n.dataClass(e,n);try{c=n.renderer(l,n.rendererOptions)}catch(i){a=i,"undefined"!=typeof console&&null!==console&&console.error(a.stack),c=t("<span>").html(n.localeStrings.renderError)}}catch(u){a=u,"undefined"!=typeof console&&null!==console&&console.error(a.stack),c=t("<span>").html(n.localeStrings.computeError)}for(p=this[0];p.hasChildNodes();)p.removeChild(p.lastChild);return this.append(c)},t.fn.pivotUI=function(n,r,i,s){var u,l,c,d,m,g,v,C,b,A,y,w,x,N,T,S,F,E,D,k,R,I,O,M,K,L,q,U,V,j,H,B,P,J,_,z,G,Q,W,Z,$;null==i&&(i=!1),null==s&&(s="en"),null==h[s]&&(s="en"),v={derivedAttributes:{},aggregators:h[s].aggregators,renderers:h[s].renderers,hiddenAttributes:[],menuLimit:200,cols:[],rows:[],vals:[],dataClass:o,exclusions:{},inclusions:{},unusedAttrsVertical:85,autoSortUnusedAttrs:!1,rendererOptions:{localeStrings:h[s].localeStrings},onRefresh:null,filter:function(){return!0},sorters:function(){},localeStrings:h[s].localeStrings},A=this.data("pivotUIOptions"),I=null==A||i?t.extend(v,r):A;try{n=o.convertToArray(n),_=function(){var t,e;t=n[0],e=[];for(N in t)a.call(t,N)&&e.push(N);return e}(),K=I.derivedAttributes;for(m in K)a.call(K,m)&&e.call(_,m)<0&&_.push(m);for(d={},T=0,S=_.length;S>T;T++)$=_[T],d[$]={};o.forEachRecord(n,I.derivedAttributes,function(t){var e,n,r;n=[];for(N in t)a.call(t,N)&&(r=t[N],I.filter(t)&&(null==r&&(r="null"),null==(e=d[N])[r]&&(e[r]=0),n.push(d[N][r]++)));return n}),Q=t("<table>",{"class":"pvtUi"}).attr("cellpadding",5),P=t("<td>"),B=t("<select>").addClass("pvtRenderer").appendTo(P).bind("change",function(){return j()}),L=I.renderers;for($ in L)a.call(L,$)&&t("<option>").val($).html($).appendTo(B);if(g=t("<td>").addClass("pvtAxisContainer pvtUnused"),J=function(){var t,n,r;for(r=[],n=0,t=_.length;t>n;n++)m=_[n],e.call(I.hiddenAttributes,m)<0&&r.push(m);return r}(),Z=!1,W="auto"===I.unusedAttrsVertical?120:parseInt(I.unusedAttrsVertical),!isNaN(W)){for(c=0,k=0,F=J.length;F>k;k++)u=J[k],c+=u.length;Z=c>W}I.unusedAttrsVertical===!0||Z?g.addClass("pvtVertList"):g.addClass("pvtHorizList"),y=function(n){var r,a,o,i,s,u,l,c,h,f,m,v,C,b,A;if(l=function(){var t;t=[];for(N in d[n])t.push(N);return t}(),u=!1,A=t("<div>").addClass("pvtFilterBox").hide(),A.append(t("<h4>").text(n+" ("+l.length+")")),l.length>I.menuLimit)A.append(t("<p>").html(I.localeStrings.tooMany));else for(a=t("<p>").appendTo(A),a.append(t("<button>",{type:"button"}).html(I.localeStrings.selectAll).bind("click",function(){return A.find("input:visible").prop("checked",!0)})),a.append(t("<button>",{type:"button"}).html(I.localeStrings.selectNone).bind("click",function(){return A.find("input:visible").prop("checked",!1)})),a.append(t("<br>")),a.append(t("<input>",{type:"text",placeholder:I.localeStrings.filterResults,"class":"pvtSearch"}).bind("keyup",function(){var e;return e=t(this).val().toLowerCase(),A.find(".pvtCheckContainer p").each(function(){var n;return n=t(this).text().toLowerCase().indexOf(e),-1!==n?t(this).show():t(this).hide()})})),o=t("<div>").addClass("pvtCheckContainer").appendTo(A),f=l.sort(p(I.sorters,n)),h=0,c=f.length;c>h;h++)N=f[h],b=d[n][N],i=t("<label>"),s=!1,I.inclusions[n]?s=e.call(I.inclusions[n],N)<0:I.exclusions[n]&&(s=e.call(I.exclusions[n],N)>=0),u||(u=s),t("<input>").attr("type","checkbox").addClass("pvtFilter").attr("checked",!s).data("filter",[n,N]).appendTo(i),i.append(t("<span>").text(N)),i.append(t("<span>").text(" ("+b+")")),o.append(t("<p>").append(i));return C=function(){var t;return t=A.find("[type='checkbox']").length-A.find("[type='checkbox']:checked").length,t>0?r.addClass("pvtFilteredAttribute"):r.removeClass("pvtFilteredAttribute"),l.length>I.menuLimit?A.toggle():A.toggle(0,j)},t("<p>").appendTo(A).append(t("<button>",{type:"button"}).text("OK").bind("click",C)),m=function(e){var n,r,a;return a=t(e.currentTarget).position(),n=a.left,r=a.top,A.css({left:n+10,top:r+10}).toggle(),A.find(".pvtSearch").val(""),A.find(".pvtCheckContainer p").show()},v=t("<span>").addClass("pvtTriangle").html(" &#x25BE;").bind("click",m),r=t("<li>").addClass("axis_"+w).append(t("<span>").addClass("pvtAttr").text(n).data("attrName",n).append(v)),u&&r.addClass("pvtFilteredAttribute"),g.append(r).append(A),r.bind("dblclick",m)};for(w in J)a.call(J,w)&&(m=J[w],y(m));z=t("<tr>").appendTo(Q),l=t("<select>").addClass("pvtAggregator").bind("change",function(){return j()}),q=I.aggregators;for($ in q)a.call(q,$)&&l.append(t("<option>").val($).html($));for(t("<td>").addClass("pvtVals").appendTo(z).append(l).append(t("<br>")),t("<td>").addClass("pvtAxisContainer pvtHorizList pvtCols").appendTo(z),G=t("<tr>").appendTo(Q),G.append(t("<td>").addClass("pvtAxisContainer pvtRows").attr("valign","top")),O=t("<td>").attr("valign","top").addClass("pvtRendererArea").appendTo(G),I.unusedAttrsVertical===!0||Z?(Q.find("tr:nth-child(1)").prepend(P),Q.find("tr:nth-child(2)").prepend(g)):Q.prepend(t("<tr>").append(P).append(g)),this.html(Q),U=I.cols,R=0,E=U.length;E>R;R++)$=U[R],this.find(".pvtCols").append(this.find(".axis_"+t.inArray($,J)));for(V=I.rows,M=0,D=V.length;D>M;M++)$=V[M],this.find(".pvtRows").append(this.find(".axis_"+t.inArray($,J)));null!=I.aggregatorName&&this.find(".pvtAggregator").val(I.aggregatorName),null!=I.rendererName&&this.find(".pvtRenderer").val(I.rendererName),x=!0,H=function(r){return function(){var a,o,i,s,u,c,p,h,d,m,g,v,C,b,A;if(v={derivedAttributes:I.derivedAttributes,localeStrings:I.localeStrings,rendererOptions:I.rendererOptions,sorters:I.sorters,cols:[],rows:[],dataClass:I.dataClass},c=null!=(d=I.aggregators[l.val()]([])().numInputs)?d:0,A=[],r.find(".pvtRows li span.pvtAttr").each(function(){return v.rows.push(t(this).data("attrName"))}),r.find(".pvtCols li span.pvtAttr").each(function(){return v.cols.push(t(this).data("attrName"))}),r.find(".pvtVals select.pvtAttrDropdown").each(function(){return 0===c?t(this).remove():(c--,""!==t(this).val()?A.push(t(this).val()):void 0)}),0!==c)for(h=r.find(".pvtVals"),$=g=0,m=c;m>=0?m>g:g>m;$=m>=0?++g:--g){for(u=t("<select>").addClass("pvtAttrDropdown").append(t("<option>")).bind("change",function(){return j()}),C=0,s=J.length;s>C;C++)a=J[C],u.append(t("<option>").val(a).text(a));h.append(u)}return x&&(A=I.vals,w=0,r.find(".pvtVals select.pvtAttrDropdown").each(function(){return t(this).val(A[w]),w++}),x=!1),v.aggregatorName=l.val(),v.vals=A,v.aggregator=I.aggregators[l.val()](A),v.renderer=I.renderers[B.val()],o={},r.find("input.pvtFilter").not(":checked").each(function(){var e;return e=t(this).data("filter"),null!=o[e[0]]?o[e[0]].push(e[1]):o[e[0]]=[e[1]]}),i={},r.find("input.pvtFilter:checked").each(function(){var e;return e=t(this).data("filter"),null!=o[e[0]]?null!=i[e[0]]?i[e[0]].push(e[1]):i[e[0]]=[e[1]]:void 0}),v.filter=function(t){var n,r;if(!I.filter(t))return!1;for(N in o)if(n=o[N],r=""+t[N],e.call(n,r)>=0)return!1;return!0},O.pivot(n,v),p=t.extend(I,{cols:v.cols,rows:v.rows,vals:A,exclusions:o,inclusions:i,inclusionsInfo:i,aggregatorName:l.val(),rendererName:B.val()}),r.data("pivotUIOptions",p),I.autoSortUnusedAttrs&&(b=r.find("td.pvtUnused.pvtAxisContainer"),t(b).children("li").sort(function(e,n){return f(t(e).text(),t(n).text())}).appendTo(b)),O.css("opacity",1),null!=I.onRefresh?I.onRefresh(p):void 0}}(this),j=function(t){return function(){return O.css("opacity",.5),setTimeout(H,10)}}(this),j(),this.find(".pvtAxisContainer").sortable({update:function(t,e){return null==e.sender?j():void 0},connectWith:this.find(".pvtAxisContainer"),items:"li",placeholder:"pvtPlaceholder"})}catch(b){C=b,"undefined"!=typeof console&&null!==console&&console.error(C.stack),this.html(I.localeStrings.uiRenderError)}return this},t.fn.heatmap=function(e,n){var r,a,o,i,s,u,l,c,p,h,d;switch(null==e&&(e="heatmap"),c=this.data("numrows"),l=this.data("numcols"),r=null!=n&&null!=(p=n.heatmap)?p.colorScaleGenerator:void 0,null==r&&(r=function(t){var e,n;return n=Math.min.apply(Math,t),e=Math.max.apply(Math,t),function(t){var r;return r=255-Math.round(255*(t-n)/(e-n)),"rgb(255,"+r+","+r+")"}}),a=function(e){return function(n){var a,o,i;return o=function(r){return e.find(n).each(function(){var e;return e=t(this).data("value"),null!=e&&isFinite(e)?r(e,t(this)):void 0})},i=[],o(function(t){return i.push(t)}),a=r(i),o(function(t,e){return e.css("background-color",a(t))})}}(this),e){case"heatmap":a(".pvtVal");break;case"rowheatmap":for(o=s=0,h=c;h>=0?h>s:s>h;o=h>=0?++s:--s)a(".pvtVal.row"+o);break;case"colheatmap":for(i=u=0,d=l;d>=0?d>u:u>d;i=d>=0?++u:--u)a(".pvtVal.col"+i)}return a(".pvtTotal.rowTotal"),a(".pvtTotal.colTotal"),this},t.fn.barchart=function(){var e,n,r,a,o,i;for(o=this.data("numrows"),a=this.data("numcols"),e=function(e){return function(n){var r,a,o,i;return r=function(r){return e.find(n).each(function(){var e;return e=t(this).data("value"),null!=e&&isFinite(e)?r(e,t(this)):void 0})},i=[],r(function(t){return i.push(t)}),a=Math.max.apply(Math,i),o=function(t){return 100*t/(1.4*a)},r(function(e,n){var r,a;return r=n.text(),a=t("<div>").css({position:"relative",height:"55px"}),a.append(t("<div>").css({position:"absolute",bottom:0,left:0,right:0,height:o(e)+"%","background-color":"gray"})),a.append(t("<div>").text(r).css({position:"relative","padding-left":"5px","padding-right":"5px"})),n.css({padding:0,"padding-top":"5px","text-align":"center"}).html(a)})}}(this),n=r=0,i=o;i>=0?i>r:r>i;n=i>=0?++r:--r)e(".pvtVal.row"+n);return e(".pvtTotal.colTotal"),this}})}).call(this);
(function(){var t,e=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},n=[].slice,r=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;(t=function(t){return"object"==typeof exports&&"object"==typeof module?t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){var o,i,s,u,l,c,p,h,d,f,m,g,v,C,b,A,y,w;return i=function(t,e,n){var r,a,o,i;for(t+="",a=t.split("."),o=a[0],i=a.length>1?n+a[1]:"",r=/(\d+)(\d{3})/;r.test(o);)o=o.replace(r,"$1"+e+"$2");return o+i},m=function(e){var n;return n={digitsAfterDecimal:2,scaler:1,thousandsSep:",",decimalSep:".",prefix:"",suffix:"",showZero:!1},e=t.extend(n,e),function(t){var n;return isNaN(t)||!isFinite(t)?"":0!==t||e.showZero?(n=i((e.scaler*t).toFixed(e.digitsAfterDecimal),e.thousandsSep,e.decimalSep),""+e.prefix+n+e.suffix):""}},b=m(),A=m({digitsAfterDecimal:0}),y=m({digitsAfterDecimal:1,scaler:100,suffix:"%"}),s={count:function(t){return null==t&&(t=A),function(){return function(e,n,r){return{count:0,push:function(){return this.count++},value:function(){return this.count},format:t}}}},countUnique:function(t){return null==t&&(t=A),function(n){var r;return r=n[0],function(n,a,o){return{uniq:[],push:function(t){var n;return n=t[r],e.call(this.uniq,n)<0?this.uniq.push(t[r]):void 0},value:function(){return this.uniq.length},format:t,numInputs:null!=r?0:1}}}},listUnique:function(t){return function(n){var r;return r=n[0],function(n,a,o){return{uniq:[],push:function(t){var n;return n=t[r],e.call(this.uniq,n)<0?this.uniq.push(t[r]):void 0},value:function(){return this.uniq.join(t)},format:function(t){return t},numInputs:null!=r?0:1}}}},sum:function(t){return null==t&&(t=b),function(e){var n;return n=e[0],function(e,r,a){return{sum:0,push:function(t){return isNaN(parseFloat(t[n]))?void 0:this.sum+=parseFloat(t[n])},value:function(){return this.sum},format:t,numInputs:null!=n?0:1}}}},min:function(t){return null==t&&(t=b),function(e){var n;return n=e[0],function(e,r,a){return{val:null,push:function(t){var e,r;return r=parseFloat(t[n]),isNaN(r)?void 0:this.val=Math.min(r,null!=(e=this.val)?e:r)},value:function(){return this.val},format:t,numInputs:null!=n?0:1}}}},max:function(t){return null==t&&(t=b),function(e){var n;return n=e[0],function(e,r,a){return{val:null,push:function(t){var e,r;return r=parseFloat(t[n]),isNaN(r)?void 0:this.val=Math.max(r,null!=(e=this.val)?e:r)},value:function(){return this.val},format:t,numInputs:null!=n?0:1}}}},average:function(t){return null==t&&(t=b),function(e){var n;return n=e[0],function(e,r,a){return{sum:0,len:0,push:function(t){return isNaN(parseFloat(t[n]))?void 0:(this.sum+=parseFloat(t[n]),this.len++)},value:function(){return this.sum/this.len},format:t,numInputs:null!=n?0:1}}}},sumOverSum:function(t){return null==t&&(t=b),function(e){var n,r;return r=e[0],n=e[1],function(e,a,o){return{sumNum:0,sumDenom:0,push:function(t){return isNaN(parseFloat(t[r]))||(this.sumNum+=parseFloat(t[r])),isNaN(parseFloat(t[n]))?void 0:this.sumDenom+=parseFloat(t[n])},value:function(){return this.sumNum/this.sumDenom},format:t,numInputs:null!=r&&null!=n?0:2}}}},sumOverSumBound80:function(t,e){return null==t&&(t=!0),null==e&&(e=b),function(n){var r,a;return a=n[0],r=n[1],function(n,o,i){return{sumNum:0,sumDenom:0,push:function(t){return isNaN(parseFloat(t[a]))||(this.sumNum+=parseFloat(t[a])),isNaN(parseFloat(t[r]))?void 0:this.sumDenom+=parseFloat(t[r])},value:function(){var e;return e=t?1:-1,(.821187207574908/this.sumDenom+this.sumNum/this.sumDenom+1.2815515655446004*e*Math.sqrt(.410593603787454/(this.sumDenom*this.sumDenom)+this.sumNum*(1-this.sumNum/this.sumDenom)/(this.sumDenom*this.sumDenom)))/(1+1.642374415149816/this.sumDenom)},format:e,numInputs:null!=a&&null!=r?0:2}}}},fractionOf:function(t,e,r){return null==e&&(e="total"),null==r&&(r=y),function(){var a;return a=1<=arguments.length?n.call(arguments,0):[],function(n,o,i){return{selector:{total:[[],[]],row:[o,[]],col:[[],i]}[e],inner:t.apply(null,a)(n,o,i),push:function(t){return this.inner.push(t)},format:r,value:function(){return this.inner.value()/n.getAggregator.apply(n,this.selector).inner.value()},numInputs:t.apply(null,a)().numInputs}}}}},u=function(t){return{Count:t.count(A),"Count Unique Values":t.countUnique(A),"List Unique Values":t.listUnique(", "),Sum:t.sum(b),"Integer Sum":t.sum(A),Average:t.average(b),Minimum:t.min(b),Maximum:t.max(b),"Sum over Sum":t.sumOverSum(b),"80% Upper Bound":t.sumOverSumBound80(!0,b),"80% Lower Bound":t.sumOverSumBound80(!1,b),"Sum as Fraction of Total":t.fractionOf(t.sum(),"total",y),"Sum as Fraction of Rows":t.fractionOf(t.sum(),"row",y),"Sum as Fraction of Columns":t.fractionOf(t.sum(),"col",y),"Count as Fraction of Total":t.fractionOf(t.count(),"total",y),"Count as Fraction of Rows":t.fractionOf(t.count(),"row",y),"Count as Fraction of Columns":t.fractionOf(t.count(),"col",y)}}(s),v={Table:function(t,e){return g(t,e)},"Table Barchart":function(e,n){return t(g(e,n)).barchart()},Heatmap:function(e,n){return t(g(e,n)).heatmap("heatmap",n)},"Row Heatmap":function(e,n){return t(g(e,n)).heatmap("rowheatmap",n)},"Col Heatmap":function(e,n){return t(g(e,n)).heatmap("colheatmap",n)}},h={en:{aggregators:u,renderers:v,localeStrings:{renderError:"An error occurred rendering the PivotTable results.",computeError:"An error occurred computing the PivotTable results.",uiRenderError:"An error occurred rendering the PivotTable UI.",selectAll:"Select All",selectNone:"Select None",tooMany:"(too many to list)",filterResults:"Filter results",totals:"Totals",vs:"vs",by:"by"}}},d=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],l=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],w=function(t){return("0"+t).substr(-2,2)},c={bin:function(t,e){return function(n){return n[t]-n[t]%e}},dateFormat:function(t,e,n,r,a){var o;return null==n&&(n=!1),null==r&&(r=d),null==a&&(a=l),o=n?"UTC":"",function(n){var i;return i=new Date(Date.parse(n[t])),isNaN(i)?"":e.replace(/%(.)/g,function(t,e){switch(e){case"y":return i["get"+o+"FullYear"]();case"m":return w(i["get"+o+"Month"]()+1);case"n":return r[i["get"+o+"Month"]()];case"d":return w(i["get"+o+"Date"]());case"w":return a[i["get"+o+"Day"]()];case"x":return i["get"+o+"Day"]();case"H":return w(i["get"+o+"Hours"]());case"M":return w(i["get"+o+"Minutes"]());case"S":return w(i["get"+o+"Seconds"]());default:return"%"+e}})}}},f=function(t){return function(t,e){var n,r,a,o,i,s,u;if(s=/(\d+)|(\D+)/g,i=/\d/,u=/^0/,"number"==typeof t||"number"==typeof e)return isNaN(t)?1:isNaN(e)?-1:t-e;if(n=String(t),a=String(e),n===a)return 0;if(!i.test(n)||!i.test(a))return n>a?1:-1;for(n=n.match(s),a=a.match(s);n.length&&a.length;)if(r=n.shift(),o=a.shift(),r!==o)return i.test(r)&&i.test(o)?r.replace(u,".0")-o.replace(u,".0"):r>o?1:-1;return n.length-a.length}}(this),C=function(t){var e,n,r;n={};for(e in t)r=t[e],n[r]=e;return function(t,e){return null!=n[t]&&null!=n[e]?n[t]-n[e]:null!=n[t]?-1:null!=n[e]?1:f(t,e)}},p=function(e,n){var r;return r=e(n),t.isFunction(r)?r:f},o=function(){function e(t,n){this.getAggregator=r(this.getAggregator,this),this.getRowKeys=r(this.getRowKeys,this),this.getColKeys=r(this.getColKeys,this),this.sortKeys=r(this.sortKeys,this),this.arrSort=r(this.arrSort,this),this.aggregator=n.aggregator,this.aggregatorName=n.aggregatorName,this.colAttrs=n.cols,this.rowAttrs=n.rows,this.valAttrs=n.vals,this.sorters=n.sorters,this.tree={},this.rowKeys=[],this.colKeys=[],this.rowTotals={},this.colTotals={},this.allTotal=this.aggregator(this,[],[]),this.sorted=!1,e.forEachRecord(t,n.derivedAttributes,function(t){return function(e){return n.filter(e)?t.processRecord(e):void 0}}(this))}return e.forEachRecord=function(e,n,r){var o,i,s,u,l,c,p,h,d,f,m,g;if(o=t.isEmptyObject(n)?r:function(t){var e,a,o;for(e in n)o=n[e],t[e]=null!=(a=o(t))?a:t[e];return r(t)},t.isFunction(e))return e(o);if(t.isArray(e)){if(t.isArray(e[0])){f=[];for(s in e)if(a.call(e,s)&&(i=e[s],s>0)){h={},d=e[0];for(u in d)a.call(d,u)&&(l=d[u],h[l]=i[u]);f.push(o(h))}return f}for(m=[],c=0,p=e.length;p>c;c++)h=e[c],m.push(o(h));return m}if(e instanceof jQuery)return g=[],t("thead > tr > th",e).each(function(e){return g.push(t(this).text())}),t("tbody > tr",e).each(function(e){return h={},t("td",this).each(function(e){return h[g[e]]=t(this).text()}),o(h)});throw new Error("unknown input format")},e.prototype.arrSort=function(t){var e,n;return n=function(){var n,r,a;for(a=[],n=0,r=t.length;r>n;n++)e=t[n],a.push(p(this.sorters,e));return a}.call(this),function(t,e){var r,o,i;for(o in n)if(a.call(n,o)&&(i=n[o],r=i(t[o],e[o]),0!==r))return r;return 0}},e.prototype.sortKeys=function(){return this.sorted?void 0:(this.sorted=!0,this.rowKeys.sort(this.arrSort(this.rowAttrs)),this.colKeys.sort(this.arrSort(this.colAttrs)))},e.prototype.getColKeys=function(){return this.sortKeys(),this.colKeys},e.prototype.getRowKeys=function(){return this.sortKeys(),this.rowKeys},e.prototype.processRecord=function(t){var e,n,r,a,o,i,s,u,l,c,p,h,d;for(e=[],h=[],u=this.colAttrs,a=0,o=u.length;o>a;a++)d=u[a],e.push(null!=(l=t[d])?l:"null");for(c=this.rowAttrs,s=0,i=c.length;i>s;s++)d=c[s],h.push(null!=(p=t[d])?p:"null");return r=h.join(String.fromCharCode(0)),n=e.join(String.fromCharCode(0)),this.allTotal.push(t),0!==h.length&&(this.rowTotals[r]||(this.rowKeys.push(h),this.rowTotals[r]=this.aggregator(this,h,[])),this.rowTotals[r].push(t)),0!==e.length&&(this.colTotals[n]||(this.colKeys.push(e),this.colTotals[n]=this.aggregator(this,[],e)),this.colTotals[n].push(t)),0!==e.length&&0!==h.length?(this.tree[r]||(this.tree[r]={}),this.tree[r][n]||(this.tree[r][n]=this.aggregator(this,h,e)),this.tree[r][n].push(t)):void 0},e.prototype.getAggregator=function(t,e){var n,r,a;return a=t.join(String.fromCharCode(0)),r=e.join(String.fromCharCode(0)),n=0===t.length&&0===e.length?this.allTotal:0===t.length?this.colTotals[r]:0===e.length?this.rowTotals[a]:this.tree[a][r],null!=n?n:{value:function(){return null},format:function(){return""}}},e}(),t.pivotUtilities={aggregatorTemplates:s,aggregators:u,renderers:v,derivers:c,locales:h,naturalSort:f,numberFormat:m,sortAs:C,PivotData:o},g=function(e,n){var r,o,i,s,u,l,c,p,h,d,f,m,g,v,C,b,A,y,w,x,N,S,T;l={localeStrings:{totals:"Totals"}},n=t.extend(l,n),i=e.colAttrs,f=e.rowAttrs,g=e.getRowKeys(),u=e.getColKeys(),d=document.createElement("table"),d.className="pvtTable",v=function(t,e,n){var r,a,o,i,s,u,l,c;if(0!==e){for(i=!0,c=r=0,s=n;s>=0?s>=r:r>=s;c=s>=0?++r:--r)t[e-1][c]!==t[e][c]&&(i=!1);if(i)return-1}for(a=0;e+a<t.length;){for(l=!1,c=o=0,u=n;u>=0?u>=o:o>=u;c=u>=0?++o:--o)t[e][c]!==t[e+a][c]&&(l=!0);if(l)break;a++}return a},y=document.createElement("thead");for(p in i)if(a.call(i,p)){o=i[p],x=document.createElement("tr"),0===parseInt(p)&&0!==f.length&&(A=document.createElement("th"),A.setAttribute("colspan",f.length),A.setAttribute("rowspan",i.length),x.appendChild(A)),A=document.createElement("th"),A.className="pvtAxisLabel",A.textContent=o,x.appendChild(A);for(c in u)a.call(u,c)&&(s=u[c],T=v(u,parseInt(c),parseInt(p)),-1!==T&&(A=document.createElement("th"),A.className="pvtColLabel",A.textContent=s[p],A.setAttribute("colspan",T),parseInt(p)===i.length-1&&0!==f.length&&A.setAttribute("rowspan",2),x.appendChild(A)));0===parseInt(p)&&(A=document.createElement("th"),A.className="pvtTotalLabel",A.innerHTML=n.localeStrings.totals,A.setAttribute("rowspan",i.length+(0===f.length?0:1)),x.appendChild(A)),y.appendChild(x)}if(0!==f.length){x=document.createElement("tr");for(c in f)a.call(f,c)&&(h=f[c],A=document.createElement("th"),A.className="pvtAxisLabel",A.textContent=h,x.appendChild(A));A=document.createElement("th"),0===i.length&&(A.className="pvtTotalLabel",A.innerHTML=n.localeStrings.totals),x.appendChild(A),y.appendChild(x)}d.appendChild(y),C=document.createElement("tbody");for(c in g)if(a.call(g,c)){m=g[c],x=document.createElement("tr");for(p in m)a.call(m,p)&&(N=m[p],T=v(g,parseInt(c),parseInt(p)),-1!==T&&(A=document.createElement("th"),A.className="pvtRowLabel",A.textContent=N,A.setAttribute("rowspan",T),parseInt(p)===f.length-1&&0!==i.length&&A.setAttribute("colspan",2),x.appendChild(A)));for(p in u)a.call(u,p)&&(s=u[p],r=e.getAggregator(m,s),S=r.value(),b=document.createElement("td"),b.className="pvtVal row"+c+" col"+p,b.textContent=r.format(S),b.setAttribute("data-value",S),x.appendChild(b));w=e.getAggregator(m,[]),S=w.value(),b=document.createElement("td"),b.className="pvtTotal rowTotal",b.textContent=w.format(S),b.setAttribute("data-value",S),b.setAttribute("data-for","row"+c),x.appendChild(b),C.appendChild(x)}x=document.createElement("tr"),A=document.createElement("th"),A.className="pvtTotalLabel",A.innerHTML=n.localeStrings.totals,A.setAttribute("colspan",f.length+(0===i.length?0:1)),x.appendChild(A);for(p in u)a.call(u,p)&&(s=u[p],w=e.getAggregator([],s),S=w.value(),b=document.createElement("td"),b.className="pvtTotal colTotal",b.textContent=w.format(S),b.setAttribute("data-value",S),b.setAttribute("data-for","col"+p),x.appendChild(b));return w=e.getAggregator([],[]),S=w.value(),b=document.createElement("td"),b.className="pvtGrandTotal",b.textContent=w.format(S),b.setAttribute("data-value",S),x.appendChild(b),C.appendChild(x),d.appendChild(C),d.setAttribute("data-numrows",g.length),d.setAttribute("data-numcols",u.length),d},t.fn.pivot=function(e,n){var r,a,i,u,l,c,p;r={cols:[],rows:[],vals:[],dataClass:o,filter:function(){return!0},aggregator:s.count()(),aggregatorName:"Count",sorters:function(){},derivedAttributes:{},renderer:g,rendererOptions:null,localeStrings:h.en.localeStrings},n=t.extend(r,n),c=null;try{l=new n.dataClass(e,n);try{c=n.renderer(l,n.rendererOptions)}catch(i){a=i,"undefined"!=typeof console&&null!==console&&console.error(a.stack),c=t("<span>").html(n.localeStrings.renderError)}}catch(u){a=u,"undefined"!=typeof console&&null!==console&&console.error(a.stack),c=t("<span>").html(n.localeStrings.computeError)}for(p=this[0];p.hasChildNodes();)p.removeChild(p.lastChild);return this.append(c)},t.fn.pivotUI=function(n,r,i,s){var u,l,c,d,m,g,v,C,b,A,y,w,x,N,S,T,F,E,D,k,I,R,O,M,K,L,q,U,V,j,H,B,P,J,_,z,G,Q;null==i&&(i=!1),null==s&&(s="en"),null==h[s]&&(s="en"),g={derivedAttributes:{},aggregators:h[s].aggregators,renderers:h[s].renderers,hiddenAttributes:[],menuLimit:200,cols:[],rows:[],vals:[],dataClass:o,exclusions:{},inclusions:{},unusedAttrsVertical:85,autoSortUnusedAttrs:!1,rendererOptions:{localeStrings:h[s].localeStrings},onRefresh:null,filter:function(){return!0},sorters:function(){},localeStrings:h[s].localeStrings},b=this.data("pivotUIOptions"),k=null==b||i?t.extend(g,r):b;try{m={},F=[],R=0,o.forEachRecord(n,k.derivedAttributes,function(t){var e,n,r,o;if(k.filter(t)){F.push(t);for(e in t)a.call(t,e)&&null==m[e]&&(m[e]={},R>0&&(m[e]["null"]=R));for(e in m)o=null!=(r=t[e])?r:"null",null==(n=m[e])[o]&&(n[o]=0),m[e][o]++;return R++}}),J=t("<table>",{"class":"pvtUi"}).attr("cellpadding",5),j=t("<td>"),V=t("<select>").addClass("pvtRenderer").appendTo(j).bind("change",function(){return q()}),O=k.renderers;for(Q in O)a.call(O,Q)&&t("<option>").val(Q).html(Q).appendTo(V);if(_=t("<td>").addClass("pvtAxisContainer pvtUnused"),H=function(){var t;t=[];for(u in m)e.call(k.hiddenAttributes,u)<0&&t.push(u);return t}(),G=!1,z="auto"===k.unusedAttrsVertical?120:parseInt(k.unusedAttrsVertical),!isNaN(z)){for(d=0,x=0,N=H.length;N>x;x++)u=H[x],d+=u.length;G=d>z}k.unusedAttrsVertical===!0||G?_.addClass("pvtVertList"):_.addClass("pvtHorizList"),A=function(n){var r,a,o,i,s,u,l,c,h,d,f,g,v,C,b,A,w;if(w=function(){var t;t=[];for(v in m[n])t.push(v);return t}(),u=!1,A=t("<div>").addClass("pvtFilterBox").hide(),A.append(t("<h4>").text(n+" ("+w.length+")")),w.length>k.menuLimit)A.append(t("<p>").html(k.localeStrings.tooMany));else for(a=t("<p>").appendTo(A),a.append(t("<button>",{type:"button"}).html(k.localeStrings.selectAll).bind("click",function(){return A.find("input:visible").prop("checked",!0)})),a.append(t("<button>",{type:"button"}).html(k.localeStrings.selectNone).bind("click",function(){return A.find("input:visible").prop("checked",!1)})),a.append(t("<br>")),a.append(t("<input>",{type:"text",placeholder:k.localeStrings.filterResults,"class":"pvtSearch"}).bind("keyup",function(){var e;return e=t(this).val().toLowerCase(),A.find(".pvtCheckContainer p").each(function(){var n;return n=t(this).text().toLowerCase().indexOf(e),-1!==n?t(this).show():t(this).hide()})})),o=t("<div>").addClass("pvtCheckContainer").appendTo(A),h=w.sort(p(k.sorters,n)),c=0,l=h.length;l>c;c++)C=h[c],b=m[n][C],i=t("<label>"),s=!1,k.inclusions[n]?s=e.call(k.inclusions[n],C)<0:k.exclusions[n]&&(s=e.call(k.exclusions[n],C)>=0),u||(u=s),t("<input>").attr("type","checkbox").addClass("pvtFilter").attr("checked",!s).data("filter",[n,C]).appendTo(i),i.append(t("<span>").text(C)),i.append(t("<span>").text(" ("+b+")")),o.append(t("<p>").append(i));return g=function(){var t;return t=A.find("[type='checkbox']").length-A.find("[type='checkbox']:checked").length,t>0?r.addClass("pvtFilteredAttribute"):r.removeClass("pvtFilteredAttribute"),w.length>k.menuLimit?A.toggle():A.toggle(0,q)},t("<p>").appendTo(A).append(t("<button>",{type:"button"}).text("OK").bind("click",g)),d=function(e){var n,r,a;return r=t(e.currentTarget).position(),n=r.left,a=r.top,A.css({left:n+10,top:a+10}).toggle(),A.find(".pvtSearch").val(""),A.find(".pvtCheckContainer p").show()},f=t("<span>").addClass("pvtTriangle").html(" &#x25BE;").bind("click",d),r=t("<li>").addClass("axis_"+y).append(t("<span>").addClass("pvtAttr").text(n).data("attrName",n).append(f)).bind("dblclick",d),u&&r.addClass("pvtFilteredAttribute"),_.append(r).append(A)};for(y in H)a.call(H,y)&&(c=H[y],A(c));B=t("<tr>").appendTo(J),l=t("<select>").addClass("pvtAggregator").bind("change",function(){return q()}),M=k.aggregators;for(Q in M)a.call(M,Q)&&l.append(t("<option>").val(Q).html(Q));for(t("<td>").addClass("pvtVals").appendTo(B).append(l).append(t("<br>")),t("<td>").addClass("pvtAxisContainer pvtHorizList pvtCols").appendTo(B),P=t("<tr>").appendTo(J),P.append(t("<td>").addClass("pvtAxisContainer pvtRows").attr("valign","top")),I=t("<td>").attr("valign","top").addClass("pvtRendererArea").appendTo(P),k.unusedAttrsVertical===!0||G?(J.find("tr:nth-child(1)").prepend(j),J.find("tr:nth-child(2)").prepend(_)):J.prepend(t("<tr>").append(j).append(_)),this.html(J),K=k.cols,E=0,S=K.length;S>E;E++)Q=K[E],this.find(".pvtCols").append(this.find(".axis_"+t.inArray(Q,H)));for(L=k.rows,D=0,T=L.length;T>D;D++)Q=L[D],this.find(".pvtRows").append(this.find(".axis_"+t.inArray(Q,H)));null!=k.aggregatorName&&this.find(".pvtAggregator").val(k.aggregatorName),null!=k.rendererName&&this.find(".pvtRenderer").val(k.rendererName),w=!0,U=function(n){return function(){var r,a,o,i,s,u,p,h,d,m,g,v,C,b;if(v={derivedAttributes:k.derivedAttributes,localeStrings:k.localeStrings,rendererOptions:k.rendererOptions,sorters:k.sorters,cols:[],rows:[],dataClass:k.dataClass},s=null!=(d=k.aggregators[l.val()]([])().numInputs)?d:0,b=[],n.find(".pvtRows li span.pvtAttr").each(function(){return v.rows.push(t(this).data("attrName"))}),n.find(".pvtCols li span.pvtAttr").each(function(){return v.cols.push(t(this).data("attrName"))}),n.find(".pvtVals select.pvtAttrDropdown").each(function(){return 0===s?t(this).remove():(s--,""!==t(this).val()?b.push(t(this).val()):void 0)}),0!==s)for(p=n.find(".pvtVals"),Q=h=0,m=s;m>=0?m>h:h>m;Q=m>=0?++h:--h){for(i=t("<select>").addClass("pvtAttrDropdown").append(t("<option>")).bind("change",function(){return q()}),g=0,o=H.length;o>g;g++)c=H[g],i.append(t("<option>").val(c).text(c));p.append(i)}return w&&(b=k.vals,y=0,n.find(".pvtVals select.pvtAttrDropdown").each(function(){return t(this).val(b[y]),y++}),w=!1),v.aggregatorName=l.val(),v.vals=b,v.aggregator=k.aggregators[l.val()](b),v.renderer=k.renderers[V.val()],r={},n.find("input.pvtFilter").not(":checked").each(function(){var e;return e=t(this).data("filter"),null!=r[e[0]]?r[e[0]].push(e[1]):r[e[0]]=[e[1]]}),a={},n.find("input.pvtFilter:checked").each(function(){var e;return e=t(this).data("filter"),null!=r[e[0]]?null!=a[e[0]]?a[e[0]].push(e[1]):a[e[0]]=[e[1]]:void 0}),v.filter=function(t){var n,a,o,i;if(!k.filter(t))return!1;for(a in r)if(n=r[a],o=""+(null!=(i=t[a])?i:"null"),e.call(n,o)>=0)return!1;return!0},I.pivot(F,v),u=t.extend(k,{cols:v.cols,rows:v.rows,vals:b,exclusions:r,inclusions:a,inclusionsInfo:a,aggregatorName:l.val(),rendererName:V.val()}),n.data("pivotUIOptions",u),k.autoSortUnusedAttrs&&(C=n.find("td.pvtUnused.pvtAxisContainer"),t(C).children("li").sort(function(e,n){return f(t(e).text(),t(n).text())}).appendTo(C)),I.css("opacity",1),null!=k.onRefresh?k.onRefresh(u):void 0}}(this),q=function(t){return function(){return I.css("opacity",.5),setTimeout(U,10)}}(this),q(),this.find(".pvtAxisContainer").sortable({update:function(t,e){return null==e.sender?q():void 0},connectWith:this.find(".pvtAxisContainer"),items:"li",placeholder:"pvtPlaceholder"})}catch(C){v=C,"undefined"!=typeof console&&null!==console&&console.error(v.stack),this.html(k.localeStrings.uiRenderError)}return this},t.fn.heatmap=function(e,n){var r,a,o,i,s,u,l,c,p,h,d;switch(null==e&&(e="heatmap"),c=this.data("numrows"),l=this.data("numcols"),r=null!=n&&null!=(p=n.heatmap)?p.colorScaleGenerator:void 0,null==r&&(r=function(t){var e,n;return n=Math.min.apply(Math,t),e=Math.max.apply(Math,t),function(t){var r;return r=255-Math.round(255*(t-n)/(e-n)),"rgb(255,"+r+","+r+")"}}),a=function(e){return function(n){var a,o,i;return o=function(r){return e.find(n).each(function(){var e;return e=t(this).data("value"),null!=e&&isFinite(e)?r(e,t(this)):void 0})},i=[],o(function(t){return i.push(t)}),a=r(i),o(function(t,e){return e.css("background-color",a(t))})}}(this),e){case"heatmap":a(".pvtVal");break;case"rowheatmap":for(o=s=0,h=c;h>=0?h>s:s>h;o=h>=0?++s:--s)a(".pvtVal.row"+o);break;case"colheatmap":for(i=u=0,d=l;d>=0?d>u:u>d;i=d>=0?++u:--u)a(".pvtVal.col"+i)}return a(".pvtTotal.rowTotal"),a(".pvtTotal.colTotal"),this},t.fn.barchart=function(){var e,n,r,a,o,i;for(o=this.data("numrows"),a=this.data("numcols"),e=function(e){return function(n){var r,a,o,i;return r=function(r){return e.find(n).each(function(){var e;return e=t(this).data("value"),null!=e&&isFinite(e)?r(e,t(this)):void 0})},i=[],r(function(t){return i.push(t)}),a=Math.max.apply(Math,i),o=function(t){return 100*t/(1.4*a)},r(function(e,n){var r,a;return r=n.text(),a=t("<div>").css({position:"relative",height:"55px"}),a.append(t("<div>").css({position:"absolute",bottom:0,left:0,right:0,height:o(e)+"%","background-color":"gray"})),a.append(t("<div>").text(r).css({position:"relative","padding-left":"5px","padding-right":"5px"})),n.css({padding:0,"padding-top":"5px","text-align":"center"}).html(a)})}}(this),n=r=0,i=o;i>=0?i>r:r>i;n=i>=0?++r:--r)e(".pvtVal.row"+n);return e(".pvtTotal.colTotal"),this}})}).call(this);
//# sourceMappingURL=pivot.min.js.map

@@ -26,4 +26,4 @@ var gulp = require('gulp'),

gulp.task('makeJs', function() {
gulp.src(['./*.coffee', './locales/*.coffee'])
gulp.src(['./*.coffee', './locales/*.coffee', './tests/*.coffee'])
//compile to js (and create map files)

@@ -34,5 +34,5 @@ .pipe(sourcemaps.init())

.pipe(gulp.dest('./dist'))
//minify js files as well
.pipe(filter('*.js'))//filter, to avoid doing this processing on the map files generated above
.pipe(filter('*.js'))//filter, to avoid doing this processing on the map files generated above
.pipe(rename({

@@ -51,3 +51,3 @@ suffix: '.min'

// get all the files to bump version in
return gulp.src(['./package.json', './bower.json', './pivottable.jquery.json'])
return gulp.src(['./package.json', './bower.json', './pivottable.jquery.json'])
// bump the version number in those files

@@ -74,3 +74,3 @@ .pipe(bump({type: importance}))

// read only one file to get the version number
.pipe(filter('package.json'))
.pipe(filter('package.json'))
.pipe(tag_version());

@@ -97,3 +97,3 @@ });

gulp.task('watch', function() {
gulp.watch('./*.coffee', ['makeJs']);
gulp.watch(['./*.coffee', './locales/*.coffee', './tests/*.coffee'], ['makeJs']);
gulp.watch('./dist/pivot.css', ['makeCss']);

@@ -100,0 +100,0 @@ });

{
"name": "pivottable",
"version": "2.3.0",
"version": "2.4.0",
"description": "Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop",

@@ -5,0 +5,0 @@ "main": "dist/pivot.js",

@@ -6,3 +6,3 @@ [![npm](http://nicolas.kruchten.com/pivottable/images/npm.svg)](https://www.npmjs.com/package/pivottable) [![cdnjs](http://nicolas.kruchten.com/pivottable/images/cdnjs.svg)](https://cdnjs.com/libraries/pivottable) [![tests](http://nicolas.kruchten.com/pivottable/images/tests.svg)](http://nicolas.kruchten.com/pivottable/tests/) [![license](http://nicolas.kruchten.com/pivottable/images/license.svg)](https://github.com/nicolaskruchten/pivottable/blob/master/LICENSE.md)

PivotTable.js is a Javascript Pivot Table library with drag'n'drop functionality built on top of jQuery/jQueryUI and originally written in CoffeeScript by [Nicolas Kruchten](http://nicolas.kruchten.com) at [Datacratic](http://datacratic.com).
PivotTable.js is a Javascript Pivot Table library with drag'n'drop functionality built on top of jQuery/jQueryUI and originally written in CoffeeScript by [Nicolas Kruchten](http://nicolas.kruchten.com) at [Datacratic](http://datacratic.com).

@@ -51,3 +51,3 @@ It is available under an MIT license from [CDNJS](https://cdnjs.com/libraries/pivottable) and [NPM](https://www.npmjs.com/package/pivottable) and [Bower](http://bower.io/) under the name `pivottable`.

PivotTable.js implements the [Universal Module Definition (UMD)](https://github.com/umdjs/umd) pattern and so should be compatible with most approaches to script loading and dependency management: direct script loading i.e. from [CDNJS](https://cdnjs.com/libraries/pivottable) or with [RequireJS](http://requirejs.org/), [Browserify](http://browserify.org/) etc. For the latter options, you can grab it from [NPM](https://www.npmjs.com/package/pivottable) with `npm install pivottable` or via [Bower](http://bower.io/) with `bower install pivottable`.
PivotTable.js implements the [Universal Module Definition (UMD)](https://github.com/umdjs/umd) pattern and so should be compatible with most approaches to script loading and dependency management: direct script loading i.e. from [CDNJS](https://cdnjs.com/libraries/pivottable) or with [RequireJS](http://requirejs.org/), [Browserify](http://browserify.org/) etc. For the latter options, you can grab it from [NPM](https://www.npmjs.com/package/pivottable) with `npm install pivottable` or via [Bower](http://bower.io/) with `bower install pivottable`.

@@ -54,0 +54,0 @@ If you are loading the scripts directly (as in the [examples](http://nicolas.kruchten.com/pivottable)), you need to:

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc