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.13.0 to 2.14.0

README.md

26

dist/c3_renderers.js

@@ -21,3 +21,3 @@ (function() {

return function(pivotData, opts) {
var agg, attrs, base, base1, base2, base3, base4, base5, c, categories, colKey, colKeys, columns, dataColumns, defaults, fullAggName, groupByTitle, h, hAxisTitle, headers, i, j, k, l, len, len1, len2, len3, len4, m, numCharsInHAxis, numSeries, params, ref, ref1, ref2, ref3, renderArea, result, rotationAngle, row, rowHeader, rowKey, rowKeys, s, scatterData, series, title, titleText, vAxisTitle, val, vals, x, xs;
var agg, attrs, base, base1, base2, base3, base4, base5, base6, c, categories, colKey, colKeys, columns, dataColumns, defaults, formatter, fullAggName, groupByTitle, h, hAxisTitle, headers, i, j, k, l, len, len1, len2, len3, len4, m, numCharsInHAxis, numSeries, params, ref, ref1, ref2, ref3, renderArea, result, rotationAngle, row, rowHeader, rowKey, rowKeys, s, scatterData, series, title, titleText, vAxisTitle, val, vals, x, xs;
defaults = {

@@ -110,3 +110,3 @@ localeStrings: {

scatterData.x[series].push((ref3 = vals[1]) != null ? ref3 : 0);
scatterData.t[series].push(agg.format(agg.value()));
scatterData.t[series].push(agg.value());
}

@@ -133,7 +133,3 @@ }

if (isFinite(val)) {
if (val < 1) {
row.push(val.toPrecision(3));
} else {
row.push(val.toFixed(3));
}
row.push(val);
} else {

@@ -165,2 +161,3 @@ row.push(null);

title.text(titleText);
formatter = pivotData.getAggregator([], []).format;
params = {

@@ -170,3 +167,4 @@ axis: {

y: {
label: vAxisTitle
label: vAxisTitle,
tick: {}
},

@@ -221,3 +219,3 @@ x: {

value: function(a, b, c, d) {
return scatterData.t[c][d];
return formatter(scatterData.t[c][d]);
}

@@ -227,2 +225,12 @@ };

params.axis.x.type = 'category';
if ((base6 = params.axis.y.tick).format == null) {
base6.format = function(v) {
return formatter(v);
};
}
params.tooltip.format = {
value: function(v) {
return formatter(v);
}
};
if (chartOpts.horizontal) {

@@ -229,0 +237,0 @@ categories = (function() {

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

(function(){var t;(t=function(t){return"object"==typeof exports&&"object"==typeof module?t(require("jquery"),require("c3")):"function"==typeof define&&define.amd?define(["jquery","c3"],t):t(jQuery,c3)})(function(t,e){var n;return n=function(n){return null==n&&(n={}),function(r,a){var o,l,i,s,c,u,h,d,g,p,f,y,x,v,b,j,z,w,A,k,m,C,S,q,B,F,H,_,K,T,L,N,P,Q,R,U,W,D,E,G,I,J,M,O,V,X,Y,Z,$,tt,et,nt,rt,at;if(b={localeStrings:{vs:"vs",by:"by"},c3:{}},a=t.extend(!0,{},b,a),null==(i=a.c3).size&&(i.size={}),null==(s=a.c3.size).width&&(s.width=window.innerWidth/1.4),null==(c=a.c3.size).height&&(c.height=window.innerHeight/1.4-50),null==n.type&&(n.type="line"),null==n.horizontal&&(n.horizontal=!1),null==n.stacked&&(n.stacked=!1),O=r.getRowKeys(),0===O.length&&O.push([]),y=r.getColKeys(),0===y.length&&y.push([]),k=function(){var t,e,n;for(n=[],t=0,e=y.length;e>t;t++)w=y[t],n.push(w.join("-"));return n}(),G=0,j=r.aggregatorName,r.valAttrs.length&&(j+="("+r.valAttrs.join(", ")+")"),"scatter"===n.type)for(X={x:{},y:{},t:{}},l=r.rowAttrs.concat(r.colAttrs),tt=null!=(Q=l[0])?Q:"",A=null!=(R=l[1])?R:"",z=l.slice(2).join("-"),$=tt,""!==A&&($+=" "+a.localeStrings.vs+" "+A),""!==z&&($+=" "+a.localeStrings.by+" "+z),m=0,B=O.length;B>m;m++)for(M=O[m],C=0,F=y.length;F>C;C++)f=y[C],o=r.getAggregator(M,f),null!=o.value()&&(nt=M.concat(f),Y=nt.slice(2).join("-"),""===Y&&(Y="series"),null==(u=X.x)[Y]&&(u[Y]=[]),null==(h=X.y)[Y]&&(h[Y]=[]),null==(d=X.t)[Y]&&(d[Y]=[]),X.y[Y].push(null!=(U=nt[0])?U:0),X.x[Y].push(null!=(W=nt[1])?W:0),X.t[Y].push(o.format(o.value())));else{for(L=0,S=0,H=k.length;H>S;S++)rt=k[S],L+=rt.length;for(L>50&&(G=45),x=[],q=0,_=O.length;_>q;q++){for(M=O[q],J=M.join("-"),I=[""===J?j:J],T=0,K=y.length;K>T;T++)f=y[T],et=parseFloat(r.getAggregator(M,f).value()),I.push(isFinite(et)?1>et?et.toPrecision(3):et.toFixed(3):null);x.push(I)}tt=j,n.horizontal?(A=r.rowAttrs.join("-"),z=r.colAttrs.join("-")):(A=r.colAttrs.join("-"),z=r.rowAttrs.join("-")),$=j,""!==A&&($+=" "+a.localeStrings.vs+" "+A),""!==z&&($+=" "+a.localeStrings.by+" "+z)}if(Z=t("<p>",{style:"text-align: center; font-weight: bold"}),Z.text($),P={axis:{rotated:n.horizontal,y:{label:tt},x:{label:A,tick:{rotate:G,multiline:!1}}},data:{type:n.type,order:null},tooltip:{grouped:!1},color:{pattern:["#3366cc","#dc3912","#ff9900","#109618","#990099","#0099c6","#dd4477","#66aa00","#b82e2e","#316395","#994499","#22aa99","#aaaa11","#6633cc","#e67300","#8b0707","#651067","#329262","#5574a6","#3b3eac"]}},P=t.extend(!0,{},P,a.c3),"scatter"===n.type){at={},N=0,v=[];for(V in X.x)N+=1,at[V]=V+"_x",v.push([V+"_x"].concat(X.x[V])),v.push([V].concat(X.y[V]));P.data.xs=at,P.data.columns=v,P.axis.x.tick={fit:!1},1===N&&(P.legend={show:!1}),P.tooltip.format={title:function(){return j},name:function(){return""},value:function(t,e,n,r){return X.t[n][r]}}}else P.axis.x.type="category",n.horizontal?(p=function(){var t,e,n;for(n=[],e=0,t=x.length;t>e;e++)g=x[e],n.push(g.shift());return n}(),1===p.length&&p[0]===j&&(p=[""]),P.axis.x.categories=p,1===k.length&&""===k[0]&&(k=[j]),x.unshift(k),P.data.rows=x):(P.axis.x.categories=k,P.data.columns=x);return n.stacked&&(P.data.groups=n.horizontal?[function(){var t,e,n;for(n=[],e=0,t=y.length;t>e;e++)rt=y[e],n.push(rt.join("-"));return n}()]:[function(){var t,e,n;for(n=[],e=0,t=O.length;t>e;e++)rt=O[e],n.push(rt.join("-"));return n}()]),D=t("<div>",{style:"display:none;"}).appendTo(t("body")),E=t("<div>").appendTo(D),P.bindto=E[0],e.generate(P),E.detach(),D.remove(),t("<div>").append(Z,E)}},t.pivotUtilities.c3_renderers={"Horizontal Bar Chart":n({type:"bar",horizontal:!0}),"Horizontal Stacked Bar Chart":n({type:"bar",stacked:!0,horizontal:!0}),"Bar Chart":n({type:"bar"}),"Stacked Bar Chart":n({type:"bar",stacked:!0}),"Line Chart":n(),"Area Chart":n({type:"area",stacked:!0}),"Scatter Chart":n({type:"scatter"})}})}).call(this);
(function(){var t;(t=function(t){return"object"==typeof exports&&"object"==typeof module?t(require("jquery"),require("c3")):"function"==typeof define&&define.amd?define(["jquery","c3"],t):t(jQuery,c3)})(function(t,e){var n;return n=function(n){return null==n&&(n={}),function(r,a){var o,l,i,c,s,u,h,g,p,d,f,y,x,v,b,j,z,m,w,k,A,C,S,q,B,H,_,F,K,T,L,N,Q,R,U,W,D,E,G,I,J,M,O,P,V,X,Y,Z,$,tt,et,nt,rt,at,ot,lt;if(j={localeStrings:{vs:"vs",by:"by"},c3:{}},a=t.extend(!0,{},j,a),null==(i=a.c3).size&&(i.size={}),null==(c=a.c3.size).width&&(c.width=window.innerWidth/1.4),null==(s=a.c3.size).height&&(s.height=window.innerHeight/1.4-50),null==n.type&&(n.type="line"),null==n.horizontal&&(n.horizontal=!1),null==n.stacked&&(n.stacked=!1),X=r.getRowKeys(),0===X.length&&X.push([]),x=r.getColKeys(),0===x.length&&x.push([]),C=function(){var t,e,n;for(n=[],t=0,e=x.length;e>t;t++)k=x[t],n.push(k.join("-"));return n}(),M=0,m=r.aggregatorName,r.valAttrs.length&&(m+="("+r.valAttrs.join(", ")+")"),"scatter"===n.type)for(Z={x:{},y:{},t:{}},l=r.rowAttrs.concat(r.colAttrs),nt=null!=(W=l[0])?W:"",A=null!=(D=l[1])?D:"",w=l.slice(2).join("-"),et=nt,""!==A&&(et+=" "+a.localeStrings.vs+" "+A),""!==w&&(et+=" "+a.localeStrings.by+" "+w),S=0,_=X.length;_>S;S++)for(V=X[S],q=0,F=x.length;F>q;q++)y=x[q],o=r.getAggregator(V,y),null!=o.value()&&(at=V.concat(y),$=at.slice(2).join("-"),""===$&&($="series"),null==(u=Z.x)[$]&&(u[$]=[]),null==(h=Z.y)[$]&&(h[$]=[]),null==(g=Z.t)[$]&&(g[$]=[]),Z.y[$].push(null!=(E=at[0])?E:0),Z.x[$].push(null!=(G=at[1])?G:0),Z.t[$].push(o.value()));else{for(Q=0,B=0,K=C.length;K>B;B++)ot=C[B],Q+=ot.length;for(Q>50&&(M=45),v=[],H=0,T=X.length;T>H;H++){for(V=X[H],P=V.join("-"),O=[""===P?m:P],N=0,L=x.length;L>N;N++)y=x[N],rt=parseFloat(r.getAggregator(V,y).value()),O.push(isFinite(rt)?rt:null);v.push(O)}nt=m,n.horizontal?(A=r.rowAttrs.join("-"),w=r.colAttrs.join("-")):(A=r.colAttrs.join("-"),w=r.rowAttrs.join("-")),et=m,""!==A&&(et+=" "+a.localeStrings.vs+" "+A),""!==w&&(et+=" "+a.localeStrings.by+" "+w)}if(tt=t("<p>",{style:"text-align: center; font-weight: bold"}),tt.text(et),z=r.getAggregator([],[]).format,U={axis:{rotated:n.horizontal,y:{label:nt,tick:{}},x:{label:A,tick:{rotate:M,multiline:!1}}},data:{type:n.type,order:null},tooltip:{grouped:!1},color:{pattern:["#3366cc","#dc3912","#ff9900","#109618","#990099","#0099c6","#dd4477","#66aa00","#b82e2e","#316395","#994499","#22aa99","#aaaa11","#6633cc","#e67300","#8b0707","#651067","#329262","#5574a6","#3b3eac"]}},U=t.extend(!0,{},U,a.c3),"scatter"===n.type){lt={},R=0,b=[];for(Y in Z.x)R+=1,lt[Y]=Y+"_x",b.push([Y+"_x"].concat(Z.x[Y])),b.push([Y].concat(Z.y[Y]));U.data.xs=lt,U.data.columns=b,U.axis.x.tick={fit:!1},1===R&&(U.legend={show:!1}),U.tooltip.format={title:function(){return m},name:function(){return""},value:function(t,e,n,r){return z(Z.t[n][r])}}}else U.axis.x.type="category",null==(p=U.axis.y.tick).format&&(p.format=function(t){return z(t)}),U.tooltip.format={value:function(t){return z(t)}},n.horizontal?(f=function(){var t,e,n;for(n=[],e=0,t=v.length;t>e;e++)d=v[e],n.push(d.shift());return n}(),1===f.length&&f[0]===m&&(f=[""]),U.axis.x.categories=f,1===C.length&&""===C[0]&&(C=[m]),v.unshift(C),U.data.rows=v):(U.axis.x.categories=C,U.data.columns=v);return n.stacked&&(U.data.groups=n.horizontal?[function(){var t,e,n;for(n=[],e=0,t=x.length;t>e;e++)ot=x[e],n.push(ot.join("-"));return n}()]:[function(){var t,e,n;for(n=[],e=0,t=X.length;t>e;e++)ot=X[e],n.push(ot.join("-"));return n}()]),I=t("<div>",{style:"display:none;"}).appendTo(t("body")),J=t("<div>").appendTo(I),U.bindto=J[0],e.generate(U),J.detach(),I.remove(),t("<div>").append(tt,J)}},t.pivotUtilities.c3_renderers={"Horizontal Bar Chart":n({type:"bar",horizontal:!0}),"Horizontal Stacked Bar Chart":n({type:"bar",stacked:!0,horizontal:!0}),"Bar Chart":n({type:"bar"}),"Stacked Bar Chart":n({type:"bar",stacked:!0}),"Line Chart":n(),"Area Chart":n({type:"area",stacked:!0}),"Scatter Chart":n({type:"scatter"})}})}).call(this);
//# sourceMappingURL=c3_renderers.min.js.map

@@ -545,3 +545,3 @@ (function() {

});
it("scales and rounds", function() {
return it("scales and rounds", function() {
var nf;

@@ -554,13 +554,2 @@ nf = numberFormat({

});
return it("shows and hides zero", function() {
var nf;
nf = numberFormat({
showZero: true
});
expect(nf(0)).toEqual("0.00");
nf = numberFormat({
showZero: false
});
return expect(nf(0)).toEqual("");
});
});

@@ -567,0 +556,0 @@ return describe(".derivers", function() {

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

(function(){var t,e;t=[["name","gender","colour","birthday","trials","successes"],["Nick","male","blue","1982-11-07",103,12],["Jane","female","red","1982-11-08",95,25],["John","male","blue","1982-12-08",112,30],["Carol","female","yellow","1983-12-08",102,14]],e=[{name:"Nick",colour:"red",age:34},{name:"Jane",gender:"female"},{name:"John",gender:"male",age:12},{name:"Jim",gender:null,age:12}],describe("$.pivotUI()",function(){return describe("with no rows/cols, default count aggregator, default TableRenderer",function(){var e;return e=null,beforeEach(function(r){return e=$("<div>").pivotUI(t,{onRefresh:r})}),it("has all the basic UI elements",function(t){return expect(e.find("td.pvtAxisContainer").length).toBe(3),expect(e.find("td.pvtRendererArea").length).toBe(1),expect(e.find("td.pvtVals").length).toBe(1),expect(e.find("select.pvtRenderer").length).toBe(1),expect(e.find("select.pvtAggregator").length).toBe(1),expect(e.find("span.pvtAttr").length).toBe(6),t()}),it("reflects its inputs",function(t){return expect(e.find("td.pvtUnused span.pvtAttr").length).toBe(6),expect(e.find("select.pvtRenderer").val()).toBe("Table"),expect(e.find("select.pvtAggregator").val()).toBe("Count"),t()}),it("renders a table",function(t){return expect(e.find("table.pvtTable").length).toBe(1),t()}),describe("its renderer output",function(){return it("has the correct type and number of cells",function(t){return expect(e.find("th.pvtTotalLabel").length).toBe(1),expect(e.find("td.pvtGrandTotal").length).toBe(1),t()}),it("has the correct textual representation",function(t){return expect(e.find("table.pvtTable").text()).toBe(["Totals","4"].join("")),t()}),it("has a correct grand total with data value",function(t){return expect(e.find("td.pvtGrandTotal").text()).toBe("4"),expect(e.find("td.pvtGrandTotal").data("value")).toBe(4),t()})})}),describe("with rows/cols, sum-over-sum aggregator, Heatmap renderer",function(){var e;return e=null,beforeEach(function(r){return e=$("<div>").pivotUI(t,{rows:["gender"],cols:["colour"],aggregatorName:"Sum over Sum",vals:["successes","trials"],rendererName:"Heatmap",onRefresh:r})}),it("has all the basic UI elements",function(t){return expect(e.find("td.pvtAxisContainer").length).toBe(3),expect(e.find("td.pvtRendererArea").length).toBe(1),expect(e.find("td.pvtVals").length).toBe(1),expect(e.find("select.pvtRenderer").length).toBe(1),expect(e.find("select.pvtAggregator").length).toBe(1),expect(e.find("span.pvtAttr").length).toBe(6),t()}),it("reflects its inputs",function(t){return expect(e.find("td.pvtUnused span.pvtAttr").length).toBe(4),expect(e.find("td.pvtRows span.pvtAttr").length).toBe(1),expect(e.find("td.pvtCols span.pvtAttr").length).toBe(1),expect(e.find("select.pvtRenderer").val()).toBe("Heatmap"),expect(e.find("select.pvtAggregator").val()).toBe("Sum over Sum"),t()}),it("renders a table",function(t){return expect(e.find("table.pvtTable").length).toBe(1),t()}),describe("its renderer output",function(){return it("has the correct type and number of cells",function(t){return expect(e.find("th.pvtAxisLabel").length).toBe(2),expect(e.find("th.pvtRowLabel").length).toBe(2),expect(e.find("th.pvtColLabel").length).toBe(3),expect(e.find("th.pvtTotalLabel").length).toBe(2),expect(e.find("td.pvtVal").length).toBe(6),expect(e.find("td.pvtTotal").length).toBe(5),expect(e.find("td.pvtGrandTotal").length).toBe(1),t()}),it("has the correct textual representation",function(t){return expect(e.find("table.pvtTable").text()).toBe(["colour","blue","red","yellow","Totals","gender","female","0.26","0.14","0.20","male","0.20","0.20","Totals","0.20","0.26","0.14","0.20"].join("")),t()}),it("has a correct spot-checked cell with data value",function(t){return expect(e.find("td.col0.row1").text()).toBe("0.20"),expect(e.find("td.col0.row1").data("value")).toBe(42/215),t()})})}),describe("with ragged input",function(){var t;return t=$("<div>").pivotUI(e,{rows:["gender"],cols:["age"]}),it("renders a table with the correct textual representation",function(){return expect(t.find("table.pvtTable").text()).toBe(["age","12","34","null","Totals","gender","female","1","1","male","1","1","null","1","1","2","Totals","2","1","1","4"].join(""))})})}),describe("$.pivot()",function(){return describe("with no rows/cols, default count aggregator, default TableRenderer",function(){var e;return e=$("<div>").pivot(t),it("renders a table",function(){return expect(e.find("table.pvtTable").length).toBe(1)}),describe("its renderer output",function(){return it("has the correct textual representation",function(){return expect(e.find("table.pvtTable").text()).toBe(["Totals","4"].join(""))}),it("has a correct grand total with data value",function(){return expect(e.find("td.pvtGrandTotal").text()).toBe("4"),expect(e.find("td.pvtGrandTotal").data("value")).toBe(4)})})}),describe("with rows/cols, sum aggregator, derivedAttributes, filter and sorters",function(){var e,r,n,a,o;return n=$.pivotUtilities,a=n.sortAs,r=n.derivers,e=n.aggregators,o=$("<div>").pivot(t,{rows:["gender"],cols:["birthyear"],aggregator:e.Sum(["trialbins"]),filter:function(t){return"Nick"!==t.name},derivedAttributes:{birthyear:r.dateFormat("birthday","%y"),trialbins:r.bin("trials",10)},sorters:function(t){return"gender"===t?a(["male","female"]):void 0}}),it("renders a table with the correct textual representation",function(){return expect(o.find("table.pvtTable").text()).toBe(["birthyear","1982","1983","Totals","gender","male","110.00","110.00","female","90.00","100.00","190.00","Totals","200.00","100.00","300.00"].join(""))})}),describe("with rows/cols, fraction-of aggregator",function(){var e,r;return e=$.pivotUtilities.aggregators,r=$("<div>").pivot(t,{rows:["gender"],aggregator:e["Sum as Fraction of Total"](["trials"])}),it("renders a table with the correct textual representation",function(){return expect(r.find("table.pvtTable").text()).toBe(["gender","Totals","female","47.8%","male","52.2%","Totals","100.0%"].join(""))})}),describe("with rows/cols, custom aggregator, custom renderer with options",function(){var e,r,n;return e=null,r=null,n=$("<div>").pivot(t,{rows:["name","colour"],cols:["trials","successes"],aggregator:function(){return{count2x:0,push:function(){return this.count2x+=2},value:function(){return this.count2x},format:function(t){return"formatted "+t}}},renderer:function(t,n){return e=t,r=n,$("<div>").addClass(n.greeting).text("world")},rendererOptions:{greeting:"hithere"}}),it("renders the custom renderer as per options",function(){return expect(n.find("div.hithere").length).toBe(1)}),describe("its received PivotData object",function(){return it("has a correct grand total value and format for custom aggregator",function(){var t,r;return t=e.getAggregator([],[]),r=t.value(),expect(r).toBe(8),expect(t.format(r)).toBe("formatted 8")})})}),describe("with ragged input",function(){var t;return t=$("<div>").pivot(e,{rows:["gender"],cols:["age"]}),it("renders a table with the correct textual representation",function(){return expect(t.find("table.pvtTable").text()).toBe(["age","12","34","null","Totals","gender","female","1","1","male","1","1","null","1","1","2","Totals","2","1","1","4"].join(""))})})}),describe("$.pivotUtilities",function(){return describe(".PivotData()",function(){var e;return e={aggregator:$.pivotUtilities.aggregators["Sum over Sum"](["a","b"])},describe("with no options",function(){var t,e;return t=[["a","b"],[1,2],[3,4]],e=new $.pivotUtilities.PivotData(t),it("has the correct grand total value",function(){return expect(e.getAggregator([],[]).value()).toBe(2)})}),describe("with array-of-array input",function(){var t,r;return t=[["a","b"],[1,2],[3,4]],r=new $.pivotUtilities.PivotData(t,e),it("has the correct grand total value",function(){return expect(r.getAggregator([],[]).value()).toBe(4/6)})}),describe("with array-of-object input",function(){var t,r;return t=[{a:1,b:2},{a:3,b:4}],r=new $.pivotUtilities.PivotData(t,e),it("has the correct grand total value",function(){return expect(r.getAggregator([],[]).value()).toBe(4/6)})}),describe("with ragged array-of-object input",function(){var t,r;return r=[{a:1},{b:4},{a:3,b:2}],t=new $.pivotUtilities.PivotData(r,e),it("has the correct grand total value",function(){return expect(t.getAggregator([],[]).value()).toBe(4/6)})}),describe("with function input",function(){var t,r;return t=function(t){return t({a:1,b:2}),t({a:3,b:4})},r=new $.pivotUtilities.PivotData(t,e),it("has the correct grand total value",function(){return expect(r.getAggregator([],[]).value()).toBe(4/6)})}),describe("with jQuery table element input",function(){var t,r;return r=$("<table>\n <thead>\n <tr> <th>a</th><th>b</th> </tr>\n </thead>\n <tbody>\n <tr> <td>1</td> <td>2</td> </tr>\n <tr> <td>3</td> <td>4</td> </tr>\n </tbody>\n</table>"),t=new $.pivotUtilities.PivotData(r,e),it("has the correct grand total value",function(){return expect(t.getAggregator([],[]).value()).toBe(4/6)})}),describe("with rows/cols",function(){var e;return e=new $.pivotUtilities.PivotData(t,{rows:["name","colour"],cols:["trials","successes"]}),it("has correctly-ordered row keys",function(){return expect(e.getRowKeys()).toEqual([["Carol","yellow"],["Jane","red"],["John","blue"],["Nick","blue"]])}),it("has correctly-ordered col keys",function(){return expect(e.getColKeys()).toEqual([[95,25],[102,14],[103,12],[112,30]])}),it("can be iterated over",function(){var t,r,n,a,o,i,c,u,s,l;for(i=0,c=0,s=e.getRowKeys(),r=0,a=s.length;a>r;r++)for(u=s[r],l=e.getColKeys(),n=0,o=l.length;o>n;n++)t=l[n],null!=e.getAggregator(u,t).value()?i++:c++;return expect(i).toBe(4),expect(c).toBe(12)}),it("returns matching records",function(){var t;return t=[],e.forEachMatchingRecord({gender:"male"},function(e){return t.push(e.name)}),expect(t).toEqual(["Nick","John"])}),it("has a correct spot-checked aggregator",function(){var t,r;return t=e.getAggregator(["Carol","yellow"],[102,14]),r=t.value(),expect(r).toBe(1),expect(t.format(r)).toBe("1")}),it("has a correct grand total aggregator",function(){var t,r;return t=e.getAggregator([],[]),r=t.value(),expect(r).toBe(4),expect(t.format(r)).toBe("4")})})}),describe(".aggregatorTemplates",function(){var e,r;return e=function(e){var r;return r=new $.pivotUtilities.PivotData(t,{aggregator:e}),r.getAggregator([],[]).value()},r=$.pivotUtilities.aggregatorTemplates,describe(".count",function(){return it("works",function(){return expect(e(r.count()())).toBe(4)})}),describe(".countUnique",function(){return it("works",function(){return expect(e(r.countUnique()(["gender"]))).toBe(2)})}),describe(".listUnique",function(){return it("works",function(){return expect(e(r.listUnique()(["gender"]))).toBe("male,female")})}),describe(".average",function(){return it("works",function(){return expect(e(r.average()(["trials"]))).toBe(103)})}),describe(".sum",function(){return it("works",function(){return expect(e(r.sum()(["trials"]))).toBe(412)})}),describe(".min",function(){return it("works",function(){return expect(e(r.min()(["trials"]))).toBe(95)})}),describe(".max",function(){return it("works",function(){return expect(e(r.max()(["trials"]))).toBe(112)})}),describe(".first",function(){return it("works",function(){return expect(e(r.first()(["name"]))).toBe("Carol")})}),describe(".last",function(){return it("works",function(){return expect(e(r.last()(["name"]))).toBe("Nick")})}),describe(".average",function(){return it("works",function(){return expect(e(r.average()(["trials"]))).toBe(103)})}),describe(".median",function(){return it("works",function(){return expect(e(r.median()(["trials"]))).toBe(102.5)})}),describe(".quantile",function(){return it("works",function(){return expect(e(r.quantile(0)(["trials"]))).toBe(95),expect(e(r.quantile(.1)(["trials"]))).toBe(98.5),expect(e(r.quantile(.25)(["trials"]))).toBe(98.5),expect(e(r.quantile(1/3)(["trials"]))).toBe(102),expect(e(r.quantile(1)(["trials"]))).toBe(112)})}),describe(".var",function(){return it("works",function(){return expect(e(r["var"]()(["trials"]))).toBe(48.666666666666686)})}),describe(".stdev",function(){return it("works",function(){return expect(e(r.stdev()(["trials"]))).toBe(6.976149845485451)})}),describe(".sumOverSum",function(){return it("works",function(){return expect(e(r.sumOverSum()(["successes","trials"]))).toBe(81/412)})})}),describe(".naturalSort()",function(){var t,e;return t=$.pivotUtilities.naturalSort,e=[null,0/0,-(1/0),"-Infinity",-3,"-3",-2,"-2",-1,"-1",0,"2e-1",1,"01","1",2,"002","002e0","02","2","2e-0",3,10,"10","11","12","1e2","112",1/0,"Infinity","1a","2a","12a","20a","A","A","NaN","a","a","a01","a012","a02","a1","a2","a12","a12","a21","a21","b","c","d","null"],it("sorts naturally (null, NaN, numbers & numbery strings, Alphanum for text strings)",function(){return expect(e.slice().sort(t)).toEqual(e)})}),describe(".sortAs()",function(){var t;return t=$.pivotUtilities.sortAs,it("sorts with unknown values sorted at the end",function(){return expect([5,2,3,4,1].sort(t([4,3,2]))).toEqual([4,3,2,1,5])}),it("sorts lowercase after uppercase",function(){return expect(["Ab","aA","aa","ab"].sort(t(["Ab","Aa"]))).toEqual(["Ab","ab","aa","aA"])})}),describe(".numberFormat()",function(){var t;return t=$.pivotUtilities.numberFormat,it("formats numbers",function(){var e;return e=t(),expect(e(1234567.89123456)).toEqual("1,234,567.89")}),it("formats booleans",function(){var e;return e=t(),expect(e(!0)).toEqual("1.00")}),it("formats numbers in strings",function(){var e;return e=t(),expect(e("1234567.89123456")).toEqual("1,234,567.89")}),it("doesn't formats strings",function(){var e;return e=t(),expect(e("hi there")).toEqual("")}),it("doesn't formats objects",function(){var e;return e=t(),expect(e({a:1})).toEqual("")}),it("formats percentages",function(){var e;return e=t({scaler:100,suffix:"%"}),expect(e(.12345)).toEqual("12.35%")}),it("adds separators",function(){var e;return e=t({thousandsSep:"a",decimalSep:"b"}),expect(e(1234567.89123456)).toEqual("1a234a567b89")}),it("adds prefixes and suffixes",function(){var e;return e=t({prefix:"a",suffix:"b"}),expect(e(1234567.89123456)).toEqual("a1,234,567.89b")}),it("scales and rounds",function(){var e;return e=t({digitsAfterDecimal:3,scaler:1e3}),expect(e(1234567.89123456)).toEqual("1,234,567,891.235")}),it("shows and hides zero",function(){var e;return e=t({showZero:!0}),expect(e(0)).toEqual("0.00"),e=t({showZero:!1}),expect(e(0)).toEqual("")})}),describe(".derivers",function(){return describe(".dateFormat()",function(){var t;return t=$.pivotUtilities.derivers.dateFormat("x","abc % %% %%% %a %y %m %n %d %w %x %H %M %S",!0),it("formats date objects",function(){return expect(t({x:new Date("2015-01-02T23:43:11Z")})).toBe("abc % %% %%% %a 2015 01 Jan 02 Fri 5 23 43 11")}),it("formats input parsed by Date.parse()",function(){return expect(t({x:"2015-01-02T23:43:11Z"})).toBe("abc % %% %%% %a 2015 01 Jan 02 Fri 5 23 43 11"),expect(t({x:"bla"})).toBe("")})}),describe(".bin()",function(){var t;return t=$.pivotUtilities.derivers.bin("x",10),it("bins numbers",function(){return expect(t({x:11})).toBe(10),expect(t({x:9})).toBe(0),expect(t({x:111})).toBe(110)}),it("bins booleans",function(){return expect(t({x:!0})).toBe(0)}),it("bins negative numbers",function(){return expect(t({x:-12})).toBe(-10)}),it("doesn't bin strings",function(){return expect(t({x:"a"})).toBeNaN()}),it("doesn't bin objects",function(){return expect(t({x:{a:1}})).toBeNaN()})})})})}).call(this);
(function(){var t,e;t=[["name","gender","colour","birthday","trials","successes"],["Nick","male","blue","1982-11-07",103,12],["Jane","female","red","1982-11-08",95,25],["John","male","blue","1982-12-08",112,30],["Carol","female","yellow","1983-12-08",102,14]],e=[{name:"Nick",colour:"red",age:34},{name:"Jane",gender:"female"},{name:"John",gender:"male",age:12},{name:"Jim",gender:null,age:12}],describe("$.pivotUI()",function(){return describe("with no rows/cols, default count aggregator, default TableRenderer",function(){var e;return e=null,beforeEach(function(r){return e=$("<div>").pivotUI(t,{onRefresh:r})}),it("has all the basic UI elements",function(t){return expect(e.find("td.pvtAxisContainer").length).toBe(3),expect(e.find("td.pvtRendererArea").length).toBe(1),expect(e.find("td.pvtVals").length).toBe(1),expect(e.find("select.pvtRenderer").length).toBe(1),expect(e.find("select.pvtAggregator").length).toBe(1),expect(e.find("span.pvtAttr").length).toBe(6),t()}),it("reflects its inputs",function(t){return expect(e.find("td.pvtUnused span.pvtAttr").length).toBe(6),expect(e.find("select.pvtRenderer").val()).toBe("Table"),expect(e.find("select.pvtAggregator").val()).toBe("Count"),t()}),it("renders a table",function(t){return expect(e.find("table.pvtTable").length).toBe(1),t()}),describe("its renderer output",function(){return it("has the correct type and number of cells",function(t){return expect(e.find("th.pvtTotalLabel").length).toBe(1),expect(e.find("td.pvtGrandTotal").length).toBe(1),t()}),it("has the correct textual representation",function(t){return expect(e.find("table.pvtTable").text()).toBe(["Totals","4"].join("")),t()}),it("has a correct grand total with data value",function(t){return expect(e.find("td.pvtGrandTotal").text()).toBe("4"),expect(e.find("td.pvtGrandTotal").data("value")).toBe(4),t()})})}),describe("with rows/cols, sum-over-sum aggregator, Heatmap renderer",function(){var e;return e=null,beforeEach(function(r){return e=$("<div>").pivotUI(t,{rows:["gender"],cols:["colour"],aggregatorName:"Sum over Sum",vals:["successes","trials"],rendererName:"Heatmap",onRefresh:r})}),it("has all the basic UI elements",function(t){return expect(e.find("td.pvtAxisContainer").length).toBe(3),expect(e.find("td.pvtRendererArea").length).toBe(1),expect(e.find("td.pvtVals").length).toBe(1),expect(e.find("select.pvtRenderer").length).toBe(1),expect(e.find("select.pvtAggregator").length).toBe(1),expect(e.find("span.pvtAttr").length).toBe(6),t()}),it("reflects its inputs",function(t){return expect(e.find("td.pvtUnused span.pvtAttr").length).toBe(4),expect(e.find("td.pvtRows span.pvtAttr").length).toBe(1),expect(e.find("td.pvtCols span.pvtAttr").length).toBe(1),expect(e.find("select.pvtRenderer").val()).toBe("Heatmap"),expect(e.find("select.pvtAggregator").val()).toBe("Sum over Sum"),t()}),it("renders a table",function(t){return expect(e.find("table.pvtTable").length).toBe(1),t()}),describe("its renderer output",function(){return it("has the correct type and number of cells",function(t){return expect(e.find("th.pvtAxisLabel").length).toBe(2),expect(e.find("th.pvtRowLabel").length).toBe(2),expect(e.find("th.pvtColLabel").length).toBe(3),expect(e.find("th.pvtTotalLabel").length).toBe(2),expect(e.find("td.pvtVal").length).toBe(6),expect(e.find("td.pvtTotal").length).toBe(5),expect(e.find("td.pvtGrandTotal").length).toBe(1),t()}),it("has the correct textual representation",function(t){return expect(e.find("table.pvtTable").text()).toBe(["colour","blue","red","yellow","Totals","gender","female","0.26","0.14","0.20","male","0.20","0.20","Totals","0.20","0.26","0.14","0.20"].join("")),t()}),it("has a correct spot-checked cell with data value",function(t){return expect(e.find("td.col0.row1").text()).toBe("0.20"),expect(e.find("td.col0.row1").data("value")).toBe(42/215),t()})})}),describe("with ragged input",function(){var t;return t=$("<div>").pivotUI(e,{rows:["gender"],cols:["age"]}),it("renders a table with the correct textual representation",function(){return expect(t.find("table.pvtTable").text()).toBe(["age","12","34","null","Totals","gender","female","1","1","male","1","1","null","1","1","2","Totals","2","1","1","4"].join(""))})})}),describe("$.pivot()",function(){return describe("with no rows/cols, default count aggregator, default TableRenderer",function(){var e;return e=$("<div>").pivot(t),it("renders a table",function(){return expect(e.find("table.pvtTable").length).toBe(1)}),describe("its renderer output",function(){return it("has the correct textual representation",function(){return expect(e.find("table.pvtTable").text()).toBe(["Totals","4"].join(""))}),it("has a correct grand total with data value",function(){return expect(e.find("td.pvtGrandTotal").text()).toBe("4"),expect(e.find("td.pvtGrandTotal").data("value")).toBe(4)})})}),describe("with rows/cols, sum aggregator, derivedAttributes, filter and sorters",function(){var e,r,n,a,o;return n=$.pivotUtilities,a=n.sortAs,r=n.derivers,e=n.aggregators,o=$("<div>").pivot(t,{rows:["gender"],cols:["birthyear"],aggregator:e.Sum(["trialbins"]),filter:function(t){return"Nick"!==t.name},derivedAttributes:{birthyear:r.dateFormat("birthday","%y"),trialbins:r.bin("trials",10)},sorters:function(t){return"gender"===t?a(["male","female"]):void 0}}),it("renders a table with the correct textual representation",function(){return expect(o.find("table.pvtTable").text()).toBe(["birthyear","1982","1983","Totals","gender","male","110.00","110.00","female","90.00","100.00","190.00","Totals","200.00","100.00","300.00"].join(""))})}),describe("with rows/cols, fraction-of aggregator",function(){var e,r;return e=$.pivotUtilities.aggregators,r=$("<div>").pivot(t,{rows:["gender"],aggregator:e["Sum as Fraction of Total"](["trials"])}),it("renders a table with the correct textual representation",function(){return expect(r.find("table.pvtTable").text()).toBe(["gender","Totals","female","47.8%","male","52.2%","Totals","100.0%"].join(""))})}),describe("with rows/cols, custom aggregator, custom renderer with options",function(){var e,r,n;return e=null,r=null,n=$("<div>").pivot(t,{rows:["name","colour"],cols:["trials","successes"],aggregator:function(){return{count2x:0,push:function(){return this.count2x+=2},value:function(){return this.count2x},format:function(t){return"formatted "+t}}},renderer:function(t,n){return e=t,r=n,$("<div>").addClass(n.greeting).text("world")},rendererOptions:{greeting:"hithere"}}),it("renders the custom renderer as per options",function(){return expect(n.find("div.hithere").length).toBe(1)}),describe("its received PivotData object",function(){return it("has a correct grand total value and format for custom aggregator",function(){var t,r;return t=e.getAggregator([],[]),r=t.value(),expect(r).toBe(8),expect(t.format(r)).toBe("formatted 8")})})}),describe("with ragged input",function(){var t;return t=$("<div>").pivot(e,{rows:["gender"],cols:["age"]}),it("renders a table with the correct textual representation",function(){return expect(t.find("table.pvtTable").text()).toBe(["age","12","34","null","Totals","gender","female","1","1","male","1","1","null","1","1","2","Totals","2","1","1","4"].join(""))})})}),describe("$.pivotUtilities",function(){return describe(".PivotData()",function(){var e;return e={aggregator:$.pivotUtilities.aggregators["Sum over Sum"](["a","b"])},describe("with no options",function(){var t,e;return t=[["a","b"],[1,2],[3,4]],e=new $.pivotUtilities.PivotData(t),it("has the correct grand total value",function(){return expect(e.getAggregator([],[]).value()).toBe(2)})}),describe("with array-of-array input",function(){var t,r;return t=[["a","b"],[1,2],[3,4]],r=new $.pivotUtilities.PivotData(t,e),it("has the correct grand total value",function(){return expect(r.getAggregator([],[]).value()).toBe(4/6)})}),describe("with array-of-object input",function(){var t,r;return t=[{a:1,b:2},{a:3,b:4}],r=new $.pivotUtilities.PivotData(t,e),it("has the correct grand total value",function(){return expect(r.getAggregator([],[]).value()).toBe(4/6)})}),describe("with ragged array-of-object input",function(){var t,r;return r=[{a:1},{b:4},{a:3,b:2}],t=new $.pivotUtilities.PivotData(r,e),it("has the correct grand total value",function(){return expect(t.getAggregator([],[]).value()).toBe(4/6)})}),describe("with function input",function(){var t,r;return t=function(t){return t({a:1,b:2}),t({a:3,b:4})},r=new $.pivotUtilities.PivotData(t,e),it("has the correct grand total value",function(){return expect(r.getAggregator([],[]).value()).toBe(4/6)})}),describe("with jQuery table element input",function(){var t,r;return r=$("<table>\n <thead>\n <tr> <th>a</th><th>b</th> </tr>\n </thead>\n <tbody>\n <tr> <td>1</td> <td>2</td> </tr>\n <tr> <td>3</td> <td>4</td> </tr>\n </tbody>\n</table>"),t=new $.pivotUtilities.PivotData(r,e),it("has the correct grand total value",function(){return expect(t.getAggregator([],[]).value()).toBe(4/6)})}),describe("with rows/cols",function(){var e;return e=new $.pivotUtilities.PivotData(t,{rows:["name","colour"],cols:["trials","successes"]}),it("has correctly-ordered row keys",function(){return expect(e.getRowKeys()).toEqual([["Carol","yellow"],["Jane","red"],["John","blue"],["Nick","blue"]])}),it("has correctly-ordered col keys",function(){return expect(e.getColKeys()).toEqual([[95,25],[102,14],[103,12],[112,30]])}),it("can be iterated over",function(){var t,r,n,a,o,i,c,u,s,l;for(i=0,c=0,s=e.getRowKeys(),r=0,a=s.length;a>r;r++)for(u=s[r],l=e.getColKeys(),n=0,o=l.length;o>n;n++)t=l[n],null!=e.getAggregator(u,t).value()?i++:c++;return expect(i).toBe(4),expect(c).toBe(12)}),it("returns matching records",function(){var t;return t=[],e.forEachMatchingRecord({gender:"male"},function(e){return t.push(e.name)}),expect(t).toEqual(["Nick","John"])}),it("has a correct spot-checked aggregator",function(){var t,r;return t=e.getAggregator(["Carol","yellow"],[102,14]),r=t.value(),expect(r).toBe(1),expect(t.format(r)).toBe("1")}),it("has a correct grand total aggregator",function(){var t,r;return t=e.getAggregator([],[]),r=t.value(),expect(r).toBe(4),expect(t.format(r)).toBe("4")})})}),describe(".aggregatorTemplates",function(){var e,r;return e=function(e){var r;return r=new $.pivotUtilities.PivotData(t,{aggregator:e}),r.getAggregator([],[]).value()},r=$.pivotUtilities.aggregatorTemplates,describe(".count",function(){return it("works",function(){return expect(e(r.count()())).toBe(4)})}),describe(".countUnique",function(){return it("works",function(){return expect(e(r.countUnique()(["gender"]))).toBe(2)})}),describe(".listUnique",function(){return it("works",function(){return expect(e(r.listUnique()(["gender"]))).toBe("male,female")})}),describe(".average",function(){return it("works",function(){return expect(e(r.average()(["trials"]))).toBe(103)})}),describe(".sum",function(){return it("works",function(){return expect(e(r.sum()(["trials"]))).toBe(412)})}),describe(".min",function(){return it("works",function(){return expect(e(r.min()(["trials"]))).toBe(95)})}),describe(".max",function(){return it("works",function(){return expect(e(r.max()(["trials"]))).toBe(112)})}),describe(".first",function(){return it("works",function(){return expect(e(r.first()(["name"]))).toBe("Carol")})}),describe(".last",function(){return it("works",function(){return expect(e(r.last()(["name"]))).toBe("Nick")})}),describe(".average",function(){return it("works",function(){return expect(e(r.average()(["trials"]))).toBe(103)})}),describe(".median",function(){return it("works",function(){return expect(e(r.median()(["trials"]))).toBe(102.5)})}),describe(".quantile",function(){return it("works",function(){return expect(e(r.quantile(0)(["trials"]))).toBe(95),expect(e(r.quantile(.1)(["trials"]))).toBe(98.5),expect(e(r.quantile(.25)(["trials"]))).toBe(98.5),expect(e(r.quantile(1/3)(["trials"]))).toBe(102),expect(e(r.quantile(1)(["trials"]))).toBe(112)})}),describe(".var",function(){return it("works",function(){return expect(e(r["var"]()(["trials"]))).toBe(48.666666666666686)})}),describe(".stdev",function(){return it("works",function(){return expect(e(r.stdev()(["trials"]))).toBe(6.976149845485451)})}),describe(".sumOverSum",function(){return it("works",function(){return expect(e(r.sumOverSum()(["successes","trials"]))).toBe(81/412)})})}),describe(".naturalSort()",function(){var t,e;return t=$.pivotUtilities.naturalSort,e=[null,0/0,-(1/0),"-Infinity",-3,"-3",-2,"-2",-1,"-1",0,"2e-1",1,"01","1",2,"002","002e0","02","2","2e-0",3,10,"10","11","12","1e2","112",1/0,"Infinity","1a","2a","12a","20a","A","A","NaN","a","a","a01","a012","a02","a1","a2","a12","a12","a21","a21","b","c","d","null"],it("sorts naturally (null, NaN, numbers & numbery strings, Alphanum for text strings)",function(){return expect(e.slice().sort(t)).toEqual(e)})}),describe(".sortAs()",function(){var t;return t=$.pivotUtilities.sortAs,it("sorts with unknown values sorted at the end",function(){return expect([5,2,3,4,1].sort(t([4,3,2]))).toEqual([4,3,2,1,5])}),it("sorts lowercase after uppercase",function(){return expect(["Ab","aA","aa","ab"].sort(t(["Ab","Aa"]))).toEqual(["Ab","ab","aa","aA"])})}),describe(".numberFormat()",function(){var t;return t=$.pivotUtilities.numberFormat,it("formats numbers",function(){var e;return e=t(),expect(e(1234567.89123456)).toEqual("1,234,567.89")}),it("formats booleans",function(){var e;return e=t(),expect(e(!0)).toEqual("1.00")}),it("formats numbers in strings",function(){var e;return e=t(),expect(e("1234567.89123456")).toEqual("1,234,567.89")}),it("doesn't formats strings",function(){var e;return e=t(),expect(e("hi there")).toEqual("")}),it("doesn't formats objects",function(){var e;return e=t(),expect(e({a:1})).toEqual("")}),it("formats percentages",function(){var e;return e=t({scaler:100,suffix:"%"}),expect(e(.12345)).toEqual("12.35%")}),it("adds separators",function(){var e;return e=t({thousandsSep:"a",decimalSep:"b"}),expect(e(1234567.89123456)).toEqual("1a234a567b89")}),it("adds prefixes and suffixes",function(){var e;return e=t({prefix:"a",suffix:"b"}),expect(e(1234567.89123456)).toEqual("a1,234,567.89b")}),it("scales and rounds",function(){var e;return e=t({digitsAfterDecimal:3,scaler:1e3}),expect(e(1234567.89123456)).toEqual("1,234,567,891.235")})}),describe(".derivers",function(){return describe(".dateFormat()",function(){var t;return t=$.pivotUtilities.derivers.dateFormat("x","abc % %% %%% %a %y %m %n %d %w %x %H %M %S",!0),it("formats date objects",function(){return expect(t({x:new Date("2015-01-02T23:43:11Z")})).toBe("abc % %% %%% %a 2015 01 Jan 02 Fri 5 23 43 11")}),it("formats input parsed by Date.parse()",function(){return expect(t({x:"2015-01-02T23:43:11Z"})).toBe("abc % %% %%% %a 2015 01 Jan 02 Fri 5 23 43 11"),expect(t({x:"bla"})).toBe("")})}),describe(".bin()",function(){var t;return t=$.pivotUtilities.derivers.bin("x",10),it("bins numbers",function(){return expect(t({x:11})).toBe(10),expect(t({x:9})).toBe(0),expect(t({x:111})).toBe(110)}),it("bins booleans",function(){return expect(t({x:!0})).toBe(0)}),it("bins negative numbers",function(){return expect(t({x:-12})).toBe(-10)}),it("doesn't bin strings",function(){return expect(t({x:"a"})).toBeNaN()}),it("doesn't bin objects",function(){return expect(t({x:{a:1}})).toBeNaN()})})})})}).call(this);
//# sourceMappingURL=pivot_spec.min.js.map

@@ -44,4 +44,3 @@ (function() {

prefix: "",
suffix: "",
showZero: false
suffix: ""
};

@@ -54,5 +53,2 @@ opts = $.extend({}, defaults, opts);

}
if (x === 0 && !opts.showZero) {
return "";
}
result = addSeparators((opts.scaler * x).toFixed(opts.digitsAfterDecimal), opts.thousandsSep, opts.decimalSep);

@@ -59,0 +55,0 @@ return "" + opts.prefix + result + opts.suffix;

@@ -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,l,u,c,h,d,p,f,m,g,v,b,C,y,w,A,x,S,N;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):""}},A=m(),x=m({digitsAfterDecimal:0}),S=m({digitsAfterDecimal:1,scaler:100,suffix:"%"}),s={count:function(t){return null==t&&(t=x),function(){return function(e,n,r){return{count:0,push:function(){return this.count++},value:function(){return this.count},format:t}}}},uniques:function(t,n){return null==n&&(n=x),function(r){var a;return a=r[0],function(r,o,i){return{uniq:[],push:function(t){var n;return n=t[a],e.call(this.uniq,n)<0?this.uniq.push(t[a]):void 0},value:function(){return t(this.uniq)},format:n,numInputs:null!=a?0:1}}}},sum:function(t){return null==t&&(t=A),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}}}},extremes:function(t,e){return null==e&&(e=A),function(n){var r;return r=n[0],function(n,a,o){return{val:null,sorter:h(null!=n?n.sorters:void 0,r),push:function(e){var n,a,o,i;return i=e[r],("min"===t||"max"===t)&&(i=parseFloat(i),isNaN(i)||(this.val=Math[t](i,null!=(n=this.val)?n:i))),"first"===t&&this.sorter(i,null!=(a=this.val)?a:i)<=0&&(this.val=i),"last"===t&&this.sorter(i,null!=(o=this.val)?o:i)>=0?this.val=i:void 0},value:function(){return this.val},format:function(t){return isNaN(t)?t:e(t)},numInputs:null!=r?0:1}}}},quantile:function(t,e){return null==e&&(e=A),function(n){var r;return r=n[0],function(n,a,o){return{vals:[],push:function(t){var e;return e=parseFloat(t[r]),isNaN(e)?void 0:this.vals.push(e)},value:function(){var e;return 0===this.vals.length?null:(this.vals.sort(function(t,e){return t-e}),e=(this.vals.length-1)*t,(this.vals[Math.floor(e)]+this.vals[Math.ceil(e)])/2)},format:e,numInputs:null!=r?0:1}}}},runningStat:function(t,e,n){return null==t&&(t="mean"),null==e&&(e=1),null==n&&(n=A),function(r){var a;return a=r[0],function(r,o,i){return{n:0,m:0,s:0,push:function(t){var e,n;return n=parseFloat(t[a]),isNaN(n)?void 0:(this.n+=1,1===this.n?this.m=n:(e=this.m+(n-this.m)/this.n,this.s=this.s+(n-this.m)*(n-e),this.m=e))},value:function(){if("mean"===t)return 0===this.n?0/0:this.m;if(this.n<=e)return 0;switch(t){case"var":return this.s/(this.n-e);case"stdev":return Math.sqrt(this.s/(this.n-e))}},format:n,numInputs:null!=a?0:1}}}},sumOverSum:function(t){return null==t&&(t=A),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=A),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=S),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}}}}},s.countUnique=function(t){return s.uniques(function(t){return t.length},t)},s.listUnique=function(t){return s.uniques(function(e){return e.join(t)},function(t){return t})},s.max=function(t){return s.extremes("max",t)},s.min=function(t){return s.extremes("min",t)},s.first=function(t){return s.extremes("first",t)},s.last=function(t){return s.extremes("last",t)},s.median=function(t){return s.quantile(.5,t)},s.average=function(t){return s.runningStat("mean",1,t)},s["var"]=function(t,e){return s.runningStat("var",t,e)},s.stdev=function(t,e){return s.runningStat("stdev",t,e)},l=function(t){return{Count:t.count(x),"Count Unique Values":t.countUnique(x),"List Unique Values":t.listUnique(", "),Sum:t.sum(A),"Integer Sum":t.sum(x),Average:t.average(A),Median:t.median(A),"Sample Variance":t["var"](1,A),"Sample Standard Deviation":t.stdev(1,A),Minimum:t.min(A),Maximum:t.max(A),First:t.first(A),Last:t.last(A),"Sum over Sum":t.sumOverSum(A),"80% Upper Bound":t.sumOverSumBound80(!0,A),"80% Lower Bound":t.sumOverSumBound80(!1,A),"Sum as Fraction of Total":t.fractionOf(t.sum(),"total",S),"Sum as Fraction of Rows":t.fractionOf(t.sum(),"row",S),"Sum as Fraction of Columns":t.fractionOf(t.sum(),"col",S),"Count as Fraction of Total":t.fractionOf(t.count(),"total",S),"Count as Fraction of Rows":t.fractionOf(t.count(),"row",S),"Count as Fraction of Columns":t.fractionOf(t.count(),"col",S)}}(s),b={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)}},d={en:{aggregators:l,renderers:b,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 values",apply:"Apply",cancel:"Cancel",totals:"Totals",vs:"vs",by:"by"}}},p=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],u=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],N=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=p),null==a&&(a=u),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 N(i["get"+o+"Month"]()+1);case"n":return r[i["get"+o+"Month"]()];case"d":return N(i["get"+o+"Date"]());case"w":return a[i["get"+o+"Day"]()];case"x":return i["get"+o+"Day"]();case"H":return N(i["get"+o+"Hours"]());case"M":return N(i["get"+o+"Minutes"]());case"S":return N(i["get"+o+"Seconds"]());default:return"%"+e}})}}},C=/(\d+)|(\D+)/g,v=/\d/,y=/^0/,f=function(t){return function(t,e){var n,r,a,o,i,s;if(null!=e&&null==t)return-1;if(null!=t&&null==e)return 1;if("number"==typeof t&&isNaN(t))return-1;if("number"==typeof e&&isNaN(e))return 1;if(i=+t,s=+e,s>i)return-1;if(i>s)return 1;if("number"==typeof t&&"number"!=typeof e)return-1;if("number"==typeof e&&"number"!=typeof t)return 1;if("number"==typeof t&&"number"==typeof e)return 0;if(isNaN(s)&&!isNaN(i))return-1;if(isNaN(i)&&!isNaN(s))return 1;if(n=String(t),a=String(e),n===a)return 0;if(!v.test(n)||!v.test(a))return n>a?1:-1;for(n=n.match(C),a=a.match(C);n.length&&a.length;)if(r=n.shift(),o=a.shift(),r!==o)return v.test(r)&&v.test(o)?r.replace(y,".0")-o.replace(y,".0"):r>o?1:-1;return n.length-a.length}}(this),w=function(t){var e,n,r,a;r={},n={};for(e in t)a=t[e],r[a]=e,"string"==typeof a&&(n[a.toLowerCase()]=e);return function(t,e){return null!=r[t]&&null!=r[e]?r[t]-r[e]:null!=r[t]?-1:null!=r[e]?1:null!=n[t]&&null!=n[e]?n[t]-n[e]:null!=n[t]?-1:null!=n[e]?1:f(t,e)}},h=function(e,n){var r;if(null!=e)if(t.isFunction(e)){if(r=e(n),t.isFunction(r))return r}else if(null!=e[n])return e[n];return f},o=function(){function e(t,n){var a,o,i,l,u,c,h,d,p,f;null==n&&(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.input=t,this.aggregator=null!=(a=n.aggregator)?a:s.count()(),this.aggregatorName=null!=(o=n.aggregatorName)?o:"Count",this.colAttrs=null!=(i=n.cols)?i:[],this.rowAttrs=null!=(l=n.rows)?l:[],this.valAttrs=null!=(u=n.vals)?u:[],this.sorters=null!=(c=n.sorters)?c:{},this.rowOrder=null!=(h=n.rowOrder)?h:"key_a_to_z",this.colOrder=null!=(d=n.colOrder)?d:"key_a_to_z",this.derivedAttributes=null!=(p=n.derivedAttributes)?p:{},this.filter=null!=(f=n.filter)?f:function(){return!0},this.tree={},this.rowKeys=[],this.colKeys=[],this.rowTotals={},this.colTotals={},this.allTotal=this.aggregator(this,[],[]),this.sorted=!1,e.forEachRecord(this.input,this.derivedAttributes,function(t){return function(e){return t.filter(e)?t.processRecord(e):void 0}}(this))}return e.forEachRecord=function(e,n,r){var o,i,s,l,u,c,h,d,p,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)){d={},p=e[0];for(l in p)a.call(p,l)&&(u=p[l],d[u]=i[l]);f.push(o(d))}return f}for(m=[],c=0,h=e.length;h>c;c++)d=e[c],m.push(o(d));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 d={},t("td",this).each(function(e){return d[g[e]]=t(this).text()}),o(d)});throw new Error("unknown input format")},e.prototype.forEachMatchingRecord=function(t,n){return e.forEachRecord(this.input,this.derivedAttributes,function(e){return function(r){var a,o,i;if(e.filter(r)){for(a in t)if(i=t[a],i!==(null!=(o=r[a])?o:"null"))return;return n(r)}}}(this))},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(h(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(){var t;if(!this.sorted){switch(this.sorted=!0,t=function(t){return function(e,n){return t.getAggregator(e,n).value()}}(this),this.rowOrder){case"value_a_to_z":this.rowKeys.sort(function(e){return function(e,n){return f(t(e,[]),t(n,[]))}}(this));break;case"value_z_to_a":this.rowKeys.sort(function(e){return function(e,n){return-f(t(e,[]),t(n,[]))}}(this));break;default:this.rowKeys.sort(this.arrSort(this.rowAttrs))}switch(this.colOrder){case"value_a_to_z":return this.colKeys.sort(function(e){return function(e,n){return f(t([],e),t([],n))}}(this));case"value_z_to_a":return this.colKeys.sort(function(e){return function(e,n){return-f(t([],e),t([],n))}}(this));default:return 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,l,u,c,h,d,p;for(e=[],d=[],l=this.colAttrs,a=0,o=l.length;o>a;a++)p=l[a],e.push(null!=(u=t[p])?u:"null");for(c=this.rowAttrs,s=0,i=c.length;i>s;s++)p=c[s],d.push(null!=(h=t[p])?h:"null");return r=d.join(String.fromCharCode(0)),n=e.join(String.fromCharCode(0)),this.allTotal.push(t),0!==d.length&&(this.rowTotals[r]||(this.rowKeys.push(d),this.rowTotals[r]=this.aggregator(this,d,[])),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!==d.length?(this.tree[r]||(this.tree[r]={}),this.tree[r][n]||(this.tree[r][n]=this.aggregator(this,d,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:l,renderers:b,derivers:c,locales:d,naturalSort:f,numberFormat:m,sortAs:w,PivotData:o},g=function(e,n){var r,o,i,s,l,u,c,h,d,p,f,m,g,v,b,C,y,w,A,x,S,N,T,k;u={table:{clickCallback:null},localeStrings:{totals:"Totals"}},n=t.extend(!0,{},u,n),i=e.colAttrs,m=e.rowAttrs,v=e.getRowKeys(),l=e.getColKeys(),n.table.clickCallback&&(c=function(t,r,o){var s,l,u;l={};for(u in i)a.call(i,u)&&(s=i[u],null!=o[u]&&(l[s]=o[u]));for(u in m)a.call(m,u)&&(s=m[u],null!=r[u]&&(l[s]=r[u]));return function(r){return n.table.clickCallback(r,t,l,e)}}),f=document.createElement("table"),f.className="pvtTable",b=function(t,e,n){var r,a,o,i,s,l,u,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(u=!1,c=o=0,l=n;l>=0?l>=o:o>=l;c=l>=0?++o:--o)t[e][c]!==t[e+a][c]&&(u=!0);if(u)break;a++}return a},A=document.createElement("thead");for(d in i)if(a.call(i,d)){o=i[d],S=document.createElement("tr"),0===parseInt(d)&&0!==m.length&&(w=document.createElement("th"),w.setAttribute("colspan",m.length),w.setAttribute("rowspan",i.length),S.appendChild(w)),w=document.createElement("th"),w.className="pvtAxisLabel",w.textContent=o,S.appendChild(w);for(h in l)a.call(l,h)&&(s=l[h],k=b(l,parseInt(h),parseInt(d)),-1!==k&&(w=document.createElement("th"),w.className="pvtColLabel",w.textContent=s[d],w.setAttribute("colspan",k),parseInt(d)===i.length-1&&0!==m.length&&w.setAttribute("rowspan",2),S.appendChild(w)));0===parseInt(d)&&(w=document.createElement("th"),w.className="pvtTotalLabel",w.innerHTML=n.localeStrings.totals,w.setAttribute("rowspan",i.length+(0===m.length?0:1)),S.appendChild(w)),A.appendChild(S)}if(0!==m.length){S=document.createElement("tr");for(h in m)a.call(m,h)&&(p=m[h],w=document.createElement("th"),w.className="pvtAxisLabel",w.textContent=p,S.appendChild(w));w=document.createElement("th"),0===i.length&&(w.className="pvtTotalLabel",w.innerHTML=n.localeStrings.totals),S.appendChild(w),A.appendChild(S)}f.appendChild(A),C=document.createElement("tbody");for(h in v)if(a.call(v,h)){g=v[h],S=document.createElement("tr");for(d in g)a.call(g,d)&&(N=g[d],k=b(v,parseInt(h),parseInt(d)),-1!==k&&(w=document.createElement("th"),w.className="pvtRowLabel",w.textContent=N,w.setAttribute("rowspan",k),parseInt(d)===m.length-1&&0!==i.length&&w.setAttribute("colspan",2),S.appendChild(w)));for(d in l)a.call(l,d)&&(s=l[d],r=e.getAggregator(g,s),T=r.value(),y=document.createElement("td"),y.className="pvtVal row"+h+" col"+d,y.textContent=r.format(T),y.setAttribute("data-value",T),null!=c&&(y.onclick=c(T,g,s)),S.appendChild(y));x=e.getAggregator(g,[]),T=x.value(),y=document.createElement("td"),y.className="pvtTotal rowTotal",y.textContent=x.format(T),y.setAttribute("data-value",T),null!=c&&(y.onclick=c(T,g,[])),y.setAttribute("data-for","row"+h),S.appendChild(y),C.appendChild(S)}S=document.createElement("tr"),w=document.createElement("th"),w.className="pvtTotalLabel",w.innerHTML=n.localeStrings.totals,w.setAttribute("colspan",m.length+(0===i.length?0:1)),S.appendChild(w);for(d in l)a.call(l,d)&&(s=l[d],x=e.getAggregator([],s),T=x.value(),y=document.createElement("td"),y.className="pvtTotal colTotal",y.textContent=x.format(T),y.setAttribute("data-value",T),null!=c&&(y.onclick=c(T,[],s)),y.setAttribute("data-for","col"+d),S.appendChild(y));return x=e.getAggregator([],[]),T=x.value(),y=document.createElement("td"),y.className="pvtGrandTotal",y.textContent=x.format(T),y.setAttribute("data-value",T),null!=c&&(y.onclick=c(T,[],[])),S.appendChild(y),C.appendChild(S),f.appendChild(C),f.setAttribute("data-numrows",v.length),f.setAttribute("data-numcols",l.length),f},t.fn.pivot=function(e,n,r){var a,i,l,u,c,h,p,f;null==r&&(r="en"),null==d[r]&&(r="en"),a={cols:[],rows:[],vals:[],rowOrder:"key_a_to_z",colOrder:"key_a_to_z",dataClass:o,filter:function(){return!0},aggregator:s.count()(),aggregatorName:"Count",sorters:{},derivedAttributes:{},renderer:g},u=t.extend(!0,{},d.en.localeStrings,d[r].localeStrings),l={rendererOptions:{localeStrings:u},localeStrings:u},c=t.extend(!0,{},l,t.extend({},a,n)),p=null;try{h=new c.dataClass(e,c);try{p=c.renderer(h,c.rendererOptions)}catch(m){i=m,"undefined"!=typeof console&&null!==console&&console.error(i.stack),p=t("<span>").html(c.localeStrings.renderError)}}catch(m){i=m,"undefined"!=typeof console&&null!==console&&console.error(i.stack),p=t("<span>").html(c.localeStrings.computeError)}for(f=this[0];f.hasChildNodes();)f.removeChild(f.lastChild);return this.append(p)},t.fn.pivotUI=function(n,r,i,s){var l,u,c,p,m,g,v,b,C,y,w,A,x,S,N,T,k,_,O,F,E,D,M,R,I,K,L,q,z,U,V,j,H,B,W,P,J,G,Q,Z,$,Y;null==i&&(i=!1),null==s&&(s="en"),null==d[s]&&(s="en"),v={derivedAttributes:{},aggregators:d[s].aggregators,renderers:d[s].renderers,hiddenAttributes:[],menuLimit:500,cols:[],rows:[],vals:[],rowOrder:"key_a_to_z",colOrder:"key_a_to_z",dataClass:o,exclusions:{},inclusions:{},unusedAttrsVertical:85,autoSortUnusedAttrs:!1,onRefresh:null,filter:function(){return!0},sorters:{}},_=t.extend(!0,{},d.en.localeStrings,d[s].localeStrings),k={rendererOptions:{localeStrings:_},localeStrings:_},C=this.data("pivotUIOptions"),D=null==C||i?t.extend(!0,{},k,t.extend({},v,r)):C;try{m={},O=[],I=0,o.forEachRecord(n,D.derivedAttributes,function(t){var e,n,r,o;if(D.filter(t)){O.push(t);for(e in t)a.call(t,e)&&null==m[e]&&(m[e]={},I>0&&(m[e]["null"]=I));for(e in m)o=null!=(r=t[e])?r:"null",null==(n=m[e])[o]&&(n[o]=0),m[e][o]++;return I++}}),G=t("<table>",{"class":"pvtUi"}).attr("cellpadding",5),H=t("<td>"),j=t("<select>").addClass("pvtRenderer").appendTo(H).bind("change",function(){return U()}),K=D.renderers;for(Y in K)a.call(K,Y)&&t("<option>").val(Y).html(Y).appendTo(j);if(Q=t("<td>").addClass("pvtAxisContainer pvtUnused"),W=function(){var t;t=[];for(l in m)e.call(D.hiddenAttributes,l)<0&&t.push(l);return t}(),$=!1,Z="auto"===D.unusedAttrsVertical?120:parseInt(D.unusedAttrsVertical),!isNaN(Z)){for(p=0,x=0,S=W.length;S>x;x++)l=W[x],p+=l.length;$=p>Z}Q.addClass(D.unusedAttrsVertical===!0||$?"pvtVertList":"pvtHorizList"),y=function(n){var r,a,o,i,s,l,u,c,d,p,f,g,v,b,C,y,A,x,S;if(S=function(){var t;t=[];for(C in m[n])t.push(C);return t}(),c=!1,x=t("<div>").addClass("pvtFilterBox").hide(),x.append(t("<h4>").append(t("<span>").text(n),t("<span>").addClass("count").text("("+S.length+")"))),S.length>D.menuLimit)x.append(t("<p>").html(D.localeStrings.tooMany));else for(S.length>5&&(i=t("<p>").appendTo(x),v=h(D.sorters,n),f=D.localeStrings.filterResults,t("<input>",{type:"text"}).appendTo(i).attr({placeholder:f,"class":"pvtSearch"}).bind("keyup",function(){var n,r,a;return a=t(this).val().toLowerCase().trim(),r=function(t,n){return function(r){var o,i;return o=a.substring(t.length).trim(),0===o.length?!0:(i=Math.sign(v(r.toLowerCase(),o)),e.call(n,i)>=0)}},n=a.startsWith(">=")?r(">=",[1,0]):a.startsWith("<=")?r("<=",[-1,0]):a.startsWith(">")?r(">",[1]):a.startsWith("<")?r("<",[-1]):a.startsWith("~")?function(t){return 0===a.substring(1).trim().length?!0:t.toLowerCase().match(a.substring(1))}:function(t){return-1!==t.toLowerCase().indexOf(a)},x.find(".pvtCheckContainer p label span.value").each(function(){return n(t(this).text())?t(this).parent().parent().show():t(this).parent().parent().hide()})}),i.append(t("<br>")),t("<button>",{type:"button"}).appendTo(i).html(D.localeStrings.selectAll).bind("click",function(){return x.find("input:visible:not(:checked)").prop("checked",!0).toggleClass("changed"),!1}),t("<button>",{type:"button"}).appendTo(i).html(D.localeStrings.selectNone).bind("click",function(){return x.find("input:visible:checked").prop("checked",!1).toggleClass("changed"),!1})),a=t("<div>").addClass("pvtCheckContainer").appendTo(x),g=S.sort(h(D.sorters,n)),p=0,d=g.length;d>p;p++)y=g[p],A=m[n][y],s=t("<label>"),l=!1,D.inclusions[n]?l=e.call(D.inclusions[n],y)<0:D.exclusions[n]&&(l=e.call(D.exclusions[n],y)>=0),c||(c=l),t("<input>").attr("type","checkbox").addClass("pvtFilter").attr("checked",!l).data("filter",[n,y]).appendTo(s).bind("change",function(){return t(this).toggleClass("changed")}),s.append(t("<span>").addClass("value").text(y)),s.append(t("<span>").addClass("count").text("("+A+")")),a.append(t("<p>").append(s));return o=function(){return x.find("[type='checkbox']").length>x.find("[type='checkbox']:checked").length?r.addClass("pvtFilteredAttribute"):r.removeClass("pvtFilteredAttribute"),x.find(".pvtSearch").val(""),x.find(".pvtCheckContainer p").show(),x.hide()},u=t("<p>").appendTo(x),S.length<=D.menuLimit&&t("<button>",{type:"button"}).text(D.localeStrings.apply).appendTo(u).bind("click",function(){return x.find(".changed").removeClass("changed").length&&U(),o()}),t("<button>",{type:"button"}).text(D.localeStrings.cancel).appendTo(u).bind("click",function(){return x.find(".changed:checked").removeClass("changed").prop("checked",!1),x.find(".changed:not(:checked)").removeClass("changed").prop("checked",!0),o()}),b=t("<span>").addClass("pvtTriangle").html(" &#x25BE;").bind("click",function(e){var n,r,a;return r=t(e.currentTarget).position(),n=r.left,a=r.top,x.css({left:n+10,top:a+10}).show()}),r=t("<li>").addClass("axis_"+w).append(t("<span>").addClass("pvtAttr").text(n).data("attrName",n).append(b)),c&&r.addClass("pvtFilteredAttribute"),Q.append(r).append(x)};for(w in W)a.call(W,w)&&(c=W[w],y(c));P=t("<tr>").appendTo(G),u=t("<select>").addClass("pvtAggregator").bind("change",function(){return U()}),L=D.aggregators;for(Y in L)a.call(L,Y)&&u.append(t("<option>").val(Y).html(Y));for(M={key_a_to_z:{rowSymbol:"&varr;",colSymbol:"&harr;",next:"value_a_to_z"},value_a_to_z:{rowSymbol:"&darr;",colSymbol:"&rarr;",next:"value_z_to_a"},value_z_to_a:{rowSymbol:"&uarr;",colSymbol:"&larr;",next:"key_a_to_z"}},B=t("<a>",{role:"button"}).addClass("pvtRowOrder").data("order",D.rowOrder).html(M[D.rowOrder].rowSymbol).bind("click",function(){return t(this).data("order",M[t(this).data("order")].next),t(this).html(M[t(this).data("order")].rowSymbol),U()}),g=t("<a>",{role:"button"}).addClass("pvtColOrder").data("order",D.colOrder).html(M[D.colOrder].colSymbol).bind("click",function(){return t(this).data("order",M[t(this).data("order")].next),t(this).html(M[t(this).data("order")].colSymbol),U()}),t("<td>").addClass("pvtVals").appendTo(P).append(u).append(B).append(g).append(t("<br>")),t("<td>").addClass("pvtAxisContainer pvtHorizList pvtCols").appendTo(P),J=t("<tr>").appendTo(G),J.append(t("<td>").addClass("pvtAxisContainer pvtRows").attr("valign","top")),R=t("<td>").attr("valign","top").addClass("pvtRendererArea").appendTo(J),D.unusedAttrsVertical===!0||$?(G.find("tr:nth-child(1)").prepend(H),G.find("tr:nth-child(2)").prepend(Q)):G.prepend(t("<tr>").append(H).append(Q)),this.html(G),q=D.cols,F=0,N=q.length;N>F;F++)Y=q[F],this.find(".pvtCols").append(this.find(".axis_"+t.inArray(Y,W)));for(z=D.rows,E=0,T=z.length;T>E;E++)Y=z[E],this.find(".pvtRows").append(this.find(".axis_"+t.inArray(Y,W)));null!=D.aggregatorName&&this.find(".pvtAggregator").val(D.aggregatorName),null!=D.rendererName&&this.find(".pvtRenderer").val(D.rendererName),A=!0,V=function(n){return function(){var r,a,o,i,s,l,h,d,p,m,v,b,C,y;if(m={derivedAttributes:D.derivedAttributes,localeStrings:D.localeStrings,rendererOptions:D.rendererOptions,sorters:D.sorters,cols:[],rows:[],dataClass:D.dataClass},s=null!=(d=D.aggregators[u.val()]([])().numInputs)?d:0,y=[],n.find(".pvtRows li span.pvtAttr").each(function(){return m.rows.push(t(this).data("attrName"))}),n.find(".pvtCols li span.pvtAttr").each(function(){return m.cols.push(t(this).data("attrName"))}),n.find(".pvtVals select.pvtAttrDropdown").each(function(){return 0===s?t(this).remove():(s--,""!==t(this).val()?y.push(t(this).val()):void 0)}),0!==s)for(h=n.find(".pvtVals"),Y=v=0,p=s;p>=0?p>v:v>p;Y=p>=0?++v:--v){for(i=t("<select>").addClass("pvtAttrDropdown").append(t("<option>")).bind("change",function(){return U()}),b=0,o=W.length;o>b;b++)c=W[b],i.append(t("<option>").val(c).text(c));h.append(i)}return A&&(y=D.vals,w=0,n.find(".pvtVals select.pvtAttrDropdown").each(function(){return t(this).val(y[w]),w++}),A=!1),m.aggregatorName=u.val(),m.vals=y,m.aggregator=D.aggregators[u.val()](y),m.renderer=D.renderers[j.val()],m.rowOrder=B.data("order"),m.colOrder=g.data("order"),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}),m.filter=function(t){var n,a,o,i;if(!D.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},R.pivot(O,m),l=t.extend({},D,{cols:m.cols,rows:m.rows,colOrder:m.colOrder,rowOrder:m.rowOrder,vals:y,exclusions:r,inclusions:a,inclusionsInfo:a,aggregatorName:u.val(),rendererName:j.val()}),n.data("pivotUIOptions",l),D.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)),R.css("opacity",1),null!=D.onRefresh?D.onRefresh(l):void 0}}(this),U=function(t){return function(){return R.css("opacity",.5),setTimeout(V,10)}}(this),U(),this.find(".pvtAxisContainer").sortable({update:function(t,e){return null==e.sender?U():void 0},connectWith:this.find(".pvtAxisContainer"),items:"li",placeholder:"pvtPlaceholder"})}catch(X){b=X,"undefined"!=typeof console&&null!==console&&console.error(b.stack),this.html(D.localeStrings.uiRenderError)}return this},t.fn.heatmap=function(e,n){var r,a,o,i,s,l,u,c,h,d,p;switch(null==e&&(e="heatmap"),c=this.data("numrows"),u=this.data("numcols"),r=null!=n&&null!=(h=n.heatmap)?h.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,d=c;d>=0?d>s:s>d;o=d>=0?++s:--s)a(".pvtVal.row"+o);break;case"colheatmap":for(i=l=0,p=u;p>=0?p>l:l>p;i=p>=0?++l:--l)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,l,u,c,d,h,p,f,m,g,v,b,C,y,w,A,x,S,N;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:""},e=t.extend({},n,e),function(t){var n;return isNaN(t)||!isFinite(t)?"":(n=i((e.scaler*t).toFixed(e.digitsAfterDecimal),e.thousandsSep,e.decimalSep),""+e.prefix+n+e.suffix)}},A=m(),x=m({digitsAfterDecimal:0}),S=m({digitsAfterDecimal:1,scaler:100,suffix:"%"}),s={count:function(t){return null==t&&(t=x),function(){return function(e,n,r){return{count:0,push:function(){return this.count++},value:function(){return this.count},format:t}}}},uniques:function(t,n){return null==n&&(n=x),function(r){var a;return a=r[0],function(r,o,i){return{uniq:[],push:function(t){var n;return n=t[a],e.call(this.uniq,n)<0?this.uniq.push(t[a]):void 0},value:function(){return t(this.uniq)},format:n,numInputs:null!=a?0:1}}}},sum:function(t){return null==t&&(t=A),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}}}},extremes:function(t,e){return null==e&&(e=A),function(n){var r;return r=n[0],function(n,a,o){return{val:null,sorter:d(null!=n?n.sorters:void 0,r),push:function(e){var n,a,o,i;return i=e[r],("min"===t||"max"===t)&&(i=parseFloat(i),isNaN(i)||(this.val=Math[t](i,null!=(n=this.val)?n:i))),"first"===t&&this.sorter(i,null!=(a=this.val)?a:i)<=0&&(this.val=i),"last"===t&&this.sorter(i,null!=(o=this.val)?o:i)>=0?this.val=i:void 0},value:function(){return this.val},format:function(t){return isNaN(t)?t:e(t)},numInputs:null!=r?0:1}}}},quantile:function(t,e){return null==e&&(e=A),function(n){var r;return r=n[0],function(n,a,o){return{vals:[],push:function(t){var e;return e=parseFloat(t[r]),isNaN(e)?void 0:this.vals.push(e)},value:function(){var e;return 0===this.vals.length?null:(this.vals.sort(function(t,e){return t-e}),e=(this.vals.length-1)*t,(this.vals[Math.floor(e)]+this.vals[Math.ceil(e)])/2)},format:e,numInputs:null!=r?0:1}}}},runningStat:function(t,e,n){return null==t&&(t="mean"),null==e&&(e=1),null==n&&(n=A),function(r){var a;return a=r[0],function(r,o,i){return{n:0,m:0,s:0,push:function(t){var e,n;return n=parseFloat(t[a]),isNaN(n)?void 0:(this.n+=1,1===this.n?this.m=n:(e=this.m+(n-this.m)/this.n,this.s=this.s+(n-this.m)*(n-e),this.m=e))},value:function(){if("mean"===t)return 0===this.n?0/0:this.m;if(this.n<=e)return 0;switch(t){case"var":return this.s/(this.n-e);case"stdev":return Math.sqrt(this.s/(this.n-e))}},format:n,numInputs:null!=a?0:1}}}},sumOverSum:function(t){return null==t&&(t=A),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=A),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=S),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}}}}},s.countUnique=function(t){return s.uniques(function(t){return t.length},t)},s.listUnique=function(t){return s.uniques(function(e){return e.join(t)},function(t){return t})},s.max=function(t){return s.extremes("max",t)},s.min=function(t){return s.extremes("min",t)},s.first=function(t){return s.extremes("first",t)},s.last=function(t){return s.extremes("last",t)},s.median=function(t){return s.quantile(.5,t)},s.average=function(t){return s.runningStat("mean",1,t)},s["var"]=function(t,e){return s.runningStat("var",t,e)},s.stdev=function(t,e){return s.runningStat("stdev",t,e)},l=function(t){return{Count:t.count(x),"Count Unique Values":t.countUnique(x),"List Unique Values":t.listUnique(", "),Sum:t.sum(A),"Integer Sum":t.sum(x),Average:t.average(A),Median:t.median(A),"Sample Variance":t["var"](1,A),"Sample Standard Deviation":t.stdev(1,A),Minimum:t.min(A),Maximum:t.max(A),First:t.first(A),Last:t.last(A),"Sum over Sum":t.sumOverSum(A),"80% Upper Bound":t.sumOverSumBound80(!0,A),"80% Lower Bound":t.sumOverSumBound80(!1,A),"Sum as Fraction of Total":t.fractionOf(t.sum(),"total",S),"Sum as Fraction of Rows":t.fractionOf(t.sum(),"row",S),"Sum as Fraction of Columns":t.fractionOf(t.sum(),"col",S),"Count as Fraction of Total":t.fractionOf(t.count(),"total",S),"Count as Fraction of Rows":t.fractionOf(t.count(),"row",S),"Count as Fraction of Columns":t.fractionOf(t.count(),"col",S)}}(s),b={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:l,renderers:b,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 values",apply:"Apply",cancel:"Cancel",totals:"Totals",vs:"vs",by:"by"}}},p=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],u=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],N=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=p),null==a&&(a=u),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 N(i["get"+o+"Month"]()+1);case"n":return r[i["get"+o+"Month"]()];case"d":return N(i["get"+o+"Date"]());case"w":return a[i["get"+o+"Day"]()];case"x":return i["get"+o+"Day"]();case"H":return N(i["get"+o+"Hours"]());case"M":return N(i["get"+o+"Minutes"]());case"S":return N(i["get"+o+"Seconds"]());default:return"%"+e}})}}},C=/(\d+)|(\D+)/g,v=/\d/,y=/^0/,f=function(t){return function(t,e){var n,r,a,o,i,s;if(null!=e&&null==t)return-1;if(null!=t&&null==e)return 1;if("number"==typeof t&&isNaN(t))return-1;if("number"==typeof e&&isNaN(e))return 1;if(i=+t,s=+e,s>i)return-1;if(i>s)return 1;if("number"==typeof t&&"number"!=typeof e)return-1;if("number"==typeof e&&"number"!=typeof t)return 1;if("number"==typeof t&&"number"==typeof e)return 0;if(isNaN(s)&&!isNaN(i))return-1;if(isNaN(i)&&!isNaN(s))return 1;if(n=String(t),a=String(e),n===a)return 0;if(!v.test(n)||!v.test(a))return n>a?1:-1;for(n=n.match(C),a=a.match(C);n.length&&a.length;)if(r=n.shift(),o=a.shift(),r!==o)return v.test(r)&&v.test(o)?r.replace(y,".0")-o.replace(y,".0"):r>o?1:-1;return n.length-a.length}}(this),w=function(t){var e,n,r,a;r={},n={};for(e in t)a=t[e],r[a]=e,"string"==typeof a&&(n[a.toLowerCase()]=e);return function(t,e){return null!=r[t]&&null!=r[e]?r[t]-r[e]:null!=r[t]?-1:null!=r[e]?1:null!=n[t]&&null!=n[e]?n[t]-n[e]:null!=n[t]?-1:null!=n[e]?1:f(t,e)}},d=function(e,n){var r;if(null!=e)if(t.isFunction(e)){if(r=e(n),t.isFunction(r))return r}else if(null!=e[n])return e[n];return f},o=function(){function e(t,n){var a,o,i,l,u,c,d,h,p,f;null==n&&(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.input=t,this.aggregator=null!=(a=n.aggregator)?a:s.count()(),this.aggregatorName=null!=(o=n.aggregatorName)?o:"Count",this.colAttrs=null!=(i=n.cols)?i:[],this.rowAttrs=null!=(l=n.rows)?l:[],this.valAttrs=null!=(u=n.vals)?u:[],this.sorters=null!=(c=n.sorters)?c:{},this.rowOrder=null!=(d=n.rowOrder)?d:"key_a_to_z",this.colOrder=null!=(h=n.colOrder)?h:"key_a_to_z",this.derivedAttributes=null!=(p=n.derivedAttributes)?p:{},this.filter=null!=(f=n.filter)?f:function(){return!0},this.tree={},this.rowKeys=[],this.colKeys=[],this.rowTotals={},this.colTotals={},this.allTotal=this.aggregator(this,[],[]),this.sorted=!1,e.forEachRecord(this.input,this.derivedAttributes,function(t){return function(e){return t.filter(e)?t.processRecord(e):void 0}}(this))}return e.forEachRecord=function(e,n,r){var o,i,s,l,u,c,d,h,p,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={},p=e[0];for(l in p)a.call(p,l)&&(u=p[l],h[u]=i[l]);f.push(o(h))}return f}for(m=[],c=0,d=e.length;d>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.forEachMatchingRecord=function(t,n){return e.forEachRecord(this.input,this.derivedAttributes,function(e){return function(r){var a,o,i;if(e.filter(r)){for(a in t)if(i=t[a],i!==(null!=(o=r[a])?o:"null"))return;return n(r)}}}(this))},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(d(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(){var t;if(!this.sorted){switch(this.sorted=!0,t=function(t){return function(e,n){return t.getAggregator(e,n).value()}}(this),this.rowOrder){case"value_a_to_z":this.rowKeys.sort(function(e){return function(e,n){return f(t(e,[]),t(n,[]))}}(this));break;case"value_z_to_a":this.rowKeys.sort(function(e){return function(e,n){return-f(t(e,[]),t(n,[]))}}(this));break;default:this.rowKeys.sort(this.arrSort(this.rowAttrs))}switch(this.colOrder){case"value_a_to_z":return this.colKeys.sort(function(e){return function(e,n){return f(t([],e),t([],n))}}(this));case"value_z_to_a":return this.colKeys.sort(function(e){return function(e,n){return-f(t([],e),t([],n))}}(this));default:return 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,l,u,c,d,h,p;for(e=[],h=[],l=this.colAttrs,a=0,o=l.length;o>a;a++)p=l[a],e.push(null!=(u=t[p])?u:"null");for(c=this.rowAttrs,s=0,i=c.length;i>s;s++)p=c[s],h.push(null!=(d=t[p])?d:"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:l,renderers:b,derivers:c,locales:h,naturalSort:f,numberFormat:m,sortAs:w,PivotData:o},g=function(e,n){var r,o,i,s,l,u,c,d,h,p,f,m,g,v,b,C,y,w,A,x,S,N,T,k;u={table:{clickCallback:null},localeStrings:{totals:"Totals"}},n=t.extend(!0,{},u,n),i=e.colAttrs,m=e.rowAttrs,v=e.getRowKeys(),l=e.getColKeys(),n.table.clickCallback&&(c=function(t,r,o){var s,l,u;l={};for(u in i)a.call(i,u)&&(s=i[u],null!=o[u]&&(l[s]=o[u]));for(u in m)a.call(m,u)&&(s=m[u],null!=r[u]&&(l[s]=r[u]));return function(r){return n.table.clickCallback(r,t,l,e)}}),f=document.createElement("table"),f.className="pvtTable",b=function(t,e,n){var r,a,o,i,s,l,u,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(u=!1,c=o=0,l=n;l>=0?l>=o:o>=l;c=l>=0?++o:--o)t[e][c]!==t[e+a][c]&&(u=!0);if(u)break;a++}return a},A=document.createElement("thead");for(h in i)if(a.call(i,h)){o=i[h],S=document.createElement("tr"),0===parseInt(h)&&0!==m.length&&(w=document.createElement("th"),w.setAttribute("colspan",m.length),w.setAttribute("rowspan",i.length),S.appendChild(w)),w=document.createElement("th"),w.className="pvtAxisLabel",w.textContent=o,S.appendChild(w);for(d in l)a.call(l,d)&&(s=l[d],k=b(l,parseInt(d),parseInt(h)),-1!==k&&(w=document.createElement("th"),w.className="pvtColLabel",w.textContent=s[h],w.setAttribute("colspan",k),parseInt(h)===i.length-1&&0!==m.length&&w.setAttribute("rowspan",2),S.appendChild(w)));0===parseInt(h)&&(w=document.createElement("th"),w.className="pvtTotalLabel",w.innerHTML=n.localeStrings.totals,w.setAttribute("rowspan",i.length+(0===m.length?0:1)),S.appendChild(w)),A.appendChild(S)}if(0!==m.length){S=document.createElement("tr");for(d in m)a.call(m,d)&&(p=m[d],w=document.createElement("th"),w.className="pvtAxisLabel",w.textContent=p,S.appendChild(w));w=document.createElement("th"),0===i.length&&(w.className="pvtTotalLabel",w.innerHTML=n.localeStrings.totals),S.appendChild(w),A.appendChild(S)}f.appendChild(A),C=document.createElement("tbody");for(d in v)if(a.call(v,d)){g=v[d],S=document.createElement("tr");for(h in g)a.call(g,h)&&(N=g[h],k=b(v,parseInt(d),parseInt(h)),-1!==k&&(w=document.createElement("th"),w.className="pvtRowLabel",w.textContent=N,w.setAttribute("rowspan",k),parseInt(h)===m.length-1&&0!==i.length&&w.setAttribute("colspan",2),S.appendChild(w)));for(h in l)a.call(l,h)&&(s=l[h],r=e.getAggregator(g,s),T=r.value(),y=document.createElement("td"),y.className="pvtVal row"+d+" col"+h,y.textContent=r.format(T),y.setAttribute("data-value",T),null!=c&&(y.onclick=c(T,g,s)),S.appendChild(y));x=e.getAggregator(g,[]),T=x.value(),y=document.createElement("td"),y.className="pvtTotal rowTotal",y.textContent=x.format(T),y.setAttribute("data-value",T),null!=c&&(y.onclick=c(T,g,[])),y.setAttribute("data-for","row"+d),S.appendChild(y),C.appendChild(S)}S=document.createElement("tr"),w=document.createElement("th"),w.className="pvtTotalLabel",w.innerHTML=n.localeStrings.totals,w.setAttribute("colspan",m.length+(0===i.length?0:1)),S.appendChild(w);for(h in l)a.call(l,h)&&(s=l[h],x=e.getAggregator([],s),T=x.value(),y=document.createElement("td"),y.className="pvtTotal colTotal",y.textContent=x.format(T),y.setAttribute("data-value",T),null!=c&&(y.onclick=c(T,[],s)),y.setAttribute("data-for","col"+h),S.appendChild(y));return x=e.getAggregator([],[]),T=x.value(),y=document.createElement("td"),y.className="pvtGrandTotal",y.textContent=x.format(T),y.setAttribute("data-value",T),null!=c&&(y.onclick=c(T,[],[])),S.appendChild(y),C.appendChild(S),f.appendChild(C),f.setAttribute("data-numrows",v.length),f.setAttribute("data-numcols",l.length),f},t.fn.pivot=function(e,n,r){var a,i,l,u,c,d,p,f;null==r&&(r="en"),null==h[r]&&(r="en"),a={cols:[],rows:[],vals:[],rowOrder:"key_a_to_z",colOrder:"key_a_to_z",dataClass:o,filter:function(){return!0},aggregator:s.count()(),aggregatorName:"Count",sorters:{},derivedAttributes:{},renderer:g},u=t.extend(!0,{},h.en.localeStrings,h[r].localeStrings),l={rendererOptions:{localeStrings:u},localeStrings:u},c=t.extend(!0,{},l,t.extend({},a,n)),p=null;try{d=new c.dataClass(e,c);try{p=c.renderer(d,c.rendererOptions)}catch(m){i=m,"undefined"!=typeof console&&null!==console&&console.error(i.stack),p=t("<span>").html(c.localeStrings.renderError)}}catch(m){i=m,"undefined"!=typeof console&&null!==console&&console.error(i.stack),p=t("<span>").html(c.localeStrings.computeError)}for(f=this[0];f.hasChildNodes();)f.removeChild(f.lastChild);return this.append(p)},t.fn.pivotUI=function(n,r,i,s){var l,u,c,p,m,g,v,b,C,y,w,A,x,S,N,T,k,_,O,F,E,D,M,R,I,K,L,q,z,U,V,j,H,B,W,P,J,G,Q,$,Y,X;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:500,cols:[],rows:[],vals:[],rowOrder:"key_a_to_z",colOrder:"key_a_to_z",dataClass:o,exclusions:{},inclusions:{},unusedAttrsVertical:85,autoSortUnusedAttrs:!1,onRefresh:null,filter:function(){return!0},sorters:{}},_=t.extend(!0,{},h.en.localeStrings,h[s].localeStrings),k={rendererOptions:{localeStrings:_},localeStrings:_},C=this.data("pivotUIOptions"),D=null==C||i?t.extend(!0,{},k,t.extend({},v,r)):C;try{m={},O=[],I=0,o.forEachRecord(n,D.derivedAttributes,function(t){var e,n,r,o;if(D.filter(t)){O.push(t);for(e in t)a.call(t,e)&&null==m[e]&&(m[e]={},I>0&&(m[e]["null"]=I));for(e in m)o=null!=(r=t[e])?r:"null",null==(n=m[e])[o]&&(n[o]=0),m[e][o]++;return I++}}),G=t("<table>",{"class":"pvtUi"}).attr("cellpadding",5),H=t("<td>"),j=t("<select>").addClass("pvtRenderer").appendTo(H).bind("change",function(){return U()}),K=D.renderers;for(X in K)a.call(K,X)&&t("<option>").val(X).html(X).appendTo(j);if(Q=t("<td>").addClass("pvtAxisContainer pvtUnused"),W=function(){var t;t=[];for(l in m)e.call(D.hiddenAttributes,l)<0&&t.push(l);return t}(),Y=!1,$="auto"===D.unusedAttrsVertical?120:parseInt(D.unusedAttrsVertical),!isNaN($)){for(p=0,x=0,S=W.length;S>x;x++)l=W[x],p+=l.length;Y=p>$}Q.addClass(D.unusedAttrsVertical===!0||Y?"pvtVertList":"pvtHorizList"),y=function(n){var r,a,o,i,s,l,u,c,h,p,f,g,v,b,C,y,A,x,S;if(S=function(){var t;t=[];for(C in m[n])t.push(C);return t}(),c=!1,x=t("<div>").addClass("pvtFilterBox").hide(),x.append(t("<h4>").append(t("<span>").text(n),t("<span>").addClass("count").text("("+S.length+")"))),S.length>D.menuLimit)x.append(t("<p>").html(D.localeStrings.tooMany));else for(S.length>5&&(i=t("<p>").appendTo(x),v=d(D.sorters,n),f=D.localeStrings.filterResults,t("<input>",{type:"text"}).appendTo(i).attr({placeholder:f,"class":"pvtSearch"}).bind("keyup",function(){var n,r,a;return a=t(this).val().toLowerCase().trim(),r=function(t,n){return function(r){var o,i;return o=a.substring(t.length).trim(),0===o.length?!0:(i=Math.sign(v(r.toLowerCase(),o)),e.call(n,i)>=0)}},n=a.startsWith(">=")?r(">=",[1,0]):a.startsWith("<=")?r("<=",[-1,0]):a.startsWith(">")?r(">",[1]):a.startsWith("<")?r("<",[-1]):a.startsWith("~")?function(t){return 0===a.substring(1).trim().length?!0:t.toLowerCase().match(a.substring(1))}:function(t){return-1!==t.toLowerCase().indexOf(a)},x.find(".pvtCheckContainer p label span.value").each(function(){return n(t(this).text())?t(this).parent().parent().show():t(this).parent().parent().hide()})}),i.append(t("<br>")),t("<button>",{type:"button"}).appendTo(i).html(D.localeStrings.selectAll).bind("click",function(){return x.find("input:visible:not(:checked)").prop("checked",!0).toggleClass("changed"),!1}),t("<button>",{type:"button"}).appendTo(i).html(D.localeStrings.selectNone).bind("click",function(){return x.find("input:visible:checked").prop("checked",!1).toggleClass("changed"),!1})),a=t("<div>").addClass("pvtCheckContainer").appendTo(x),g=S.sort(d(D.sorters,n)),p=0,h=g.length;h>p;p++)y=g[p],A=m[n][y],s=t("<label>"),l=!1,D.inclusions[n]?l=e.call(D.inclusions[n],y)<0:D.exclusions[n]&&(l=e.call(D.exclusions[n],y)>=0),c||(c=l),t("<input>").attr("type","checkbox").addClass("pvtFilter").attr("checked",!l).data("filter",[n,y]).appendTo(s).bind("change",function(){return t(this).toggleClass("changed")}),s.append(t("<span>").addClass("value").text(y)),s.append(t("<span>").addClass("count").text("("+A+")")),a.append(t("<p>").append(s));return o=function(){return x.find("[type='checkbox']").length>x.find("[type='checkbox']:checked").length?r.addClass("pvtFilteredAttribute"):r.removeClass("pvtFilteredAttribute"),x.find(".pvtSearch").val(""),x.find(".pvtCheckContainer p").show(),x.hide()},u=t("<p>").appendTo(x),S.length<=D.menuLimit&&t("<button>",{type:"button"}).text(D.localeStrings.apply).appendTo(u).bind("click",function(){return x.find(".changed").removeClass("changed").length&&U(),o()}),t("<button>",{type:"button"}).text(D.localeStrings.cancel).appendTo(u).bind("click",function(){return x.find(".changed:checked").removeClass("changed").prop("checked",!1),x.find(".changed:not(:checked)").removeClass("changed").prop("checked",!0),o()}),b=t("<span>").addClass("pvtTriangle").html(" &#x25BE;").bind("click",function(e){var n,r,a;return r=t(e.currentTarget).position(),n=r.left,a=r.top,x.css({left:n+10,top:a+10}).show()}),r=t("<li>").addClass("axis_"+w).append(t("<span>").addClass("pvtAttr").text(n).data("attrName",n).append(b)),c&&r.addClass("pvtFilteredAttribute"),Q.append(r).append(x)};for(w in W)a.call(W,w)&&(c=W[w],y(c));P=t("<tr>").appendTo(G),u=t("<select>").addClass("pvtAggregator").bind("change",function(){return U()}),L=D.aggregators;for(X in L)a.call(L,X)&&u.append(t("<option>").val(X).html(X));for(M={key_a_to_z:{rowSymbol:"&varr;",colSymbol:"&harr;",next:"value_a_to_z"},value_a_to_z:{rowSymbol:"&darr;",colSymbol:"&rarr;",next:"value_z_to_a"},value_z_to_a:{rowSymbol:"&uarr;",colSymbol:"&larr;",next:"key_a_to_z"}},B=t("<a>",{role:"button"}).addClass("pvtRowOrder").data("order",D.rowOrder).html(M[D.rowOrder].rowSymbol).bind("click",function(){return t(this).data("order",M[t(this).data("order")].next),t(this).html(M[t(this).data("order")].rowSymbol),U()}),g=t("<a>",{role:"button"}).addClass("pvtColOrder").data("order",D.colOrder).html(M[D.colOrder].colSymbol).bind("click",function(){return t(this).data("order",M[t(this).data("order")].next),t(this).html(M[t(this).data("order")].colSymbol),U()}),t("<td>").addClass("pvtVals").appendTo(P).append(u).append(B).append(g).append(t("<br>")),t("<td>").addClass("pvtAxisContainer pvtHorizList pvtCols").appendTo(P),J=t("<tr>").appendTo(G),J.append(t("<td>").addClass("pvtAxisContainer pvtRows").attr("valign","top")),R=t("<td>").attr("valign","top").addClass("pvtRendererArea").appendTo(J),D.unusedAttrsVertical===!0||Y?(G.find("tr:nth-child(1)").prepend(H),G.find("tr:nth-child(2)").prepend(Q)):G.prepend(t("<tr>").append(H).append(Q)),this.html(G),q=D.cols,F=0,N=q.length;N>F;F++)X=q[F],this.find(".pvtCols").append(this.find(".axis_"+t.inArray(X,W)));for(z=D.rows,E=0,T=z.length;T>E;E++)X=z[E],this.find(".pvtRows").append(this.find(".axis_"+t.inArray(X,W)));null!=D.aggregatorName&&this.find(".pvtAggregator").val(D.aggregatorName),null!=D.rendererName&&this.find(".pvtRenderer").val(D.rendererName),A=!0,V=function(n){return function(){var r,a,o,i,s,l,d,h,p,m,v,b,C,y;if(m={derivedAttributes:D.derivedAttributes,localeStrings:D.localeStrings,rendererOptions:D.rendererOptions,sorters:D.sorters,cols:[],rows:[],dataClass:D.dataClass},s=null!=(h=D.aggregators[u.val()]([])().numInputs)?h:0,y=[],n.find(".pvtRows li span.pvtAttr").each(function(){return m.rows.push(t(this).data("attrName"))}),n.find(".pvtCols li span.pvtAttr").each(function(){return m.cols.push(t(this).data("attrName"))}),n.find(".pvtVals select.pvtAttrDropdown").each(function(){return 0===s?t(this).remove():(s--,""!==t(this).val()?y.push(t(this).val()):void 0)}),0!==s)for(d=n.find(".pvtVals"),X=v=0,p=s;p>=0?p>v:v>p;X=p>=0?++v:--v){for(i=t("<select>").addClass("pvtAttrDropdown").append(t("<option>")).bind("change",function(){return U()}),b=0,o=W.length;o>b;b++)c=W[b],i.append(t("<option>").val(c).text(c));d.append(i)}return A&&(y=D.vals,w=0,n.find(".pvtVals select.pvtAttrDropdown").each(function(){return t(this).val(y[w]),w++}),A=!1),m.aggregatorName=u.val(),m.vals=y,m.aggregator=D.aggregators[u.val()](y),m.renderer=D.renderers[j.val()],m.rowOrder=B.data("order"),m.colOrder=g.data("order"),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}),m.filter=function(t){var n,a,o,i;if(!D.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},R.pivot(O,m),l=t.extend({},D,{cols:m.cols,rows:m.rows,colOrder:m.colOrder,rowOrder:m.rowOrder,vals:y,exclusions:r,inclusions:a,inclusionsInfo:a,aggregatorName:u.val(),rendererName:j.val()}),n.data("pivotUIOptions",l),D.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)),R.css("opacity",1),null!=D.onRefresh?D.onRefresh(l):void 0}}(this),U=function(t){return function(){return R.css("opacity",.5),setTimeout(V,10)}}(this),U(),this.find(".pvtAxisContainer").sortable({update:function(t,e){return null==e.sender?U():void 0},connectWith:this.find(".pvtAxisContainer"),items:"li",placeholder:"pvtPlaceholder"})}catch(Z){b=Z,"undefined"!=typeof console&&null!==console&&console.error(b.stack),this.html(D.localeStrings.uiRenderError)}return this},t.fn.heatmap=function(e,n){var r,a,o,i,s,l,u,c,d,h,p;switch(null==e&&(e="heatmap"),c=this.data("numrows"),u=this.data("numcols"),r=null!=n&&null!=(d=n.heatmap)?d.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=l=0,p=u;p>=0?p>l:l>p;i=p>=0?++l:--l)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

@@ -40,5 +40,5 @@ (function() {

localeStrings: {
renderError: "Ocorreu um error ao renderizar os resultados da Tabela Dinãmica.",
computeError: "Ocorreu um error ao computar os resultados da Tabela Dinãmica.",
uiRenderError: "Ocorreu um error ao renderizar a interface da Tabela Dinãmica.",
renderError: "Ocorreu um error ao renderizar os resultados da Tabela Dinâmica.",
computeError: "Ocorreu um error ao computar os resultados da Tabela Dinâmica.",
uiRenderError: "Ocorreu um error ao renderizar a interface da Tabela Dinâmica.",
selectAll: "Selecionar Tudo",

@@ -49,2 +49,4 @@ selectNone: "Selecionar Nenhum",

totals: "Totais",
apply: "Aplicar",
cancel: "Cancelar",
vs: "vs",

@@ -62,2 +64,4 @@ by: "por"

"Máximo": tpl.max(frFmt),
"Primeiro": tpl.first(frFmt),
"Último": tpl.last(frFmt),
"Soma sobre Soma": tpl.sumOverSum(frFmt),

@@ -64,0 +68,0 @@ "Limite Superior a 80%": tpl.sumOverSumBound80(true, frFmt),

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

(function(){var e;(e=function(e){return"object"==typeof exports&&"object"==typeof module?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){var a,r,o,t,i,s,n,l,c;return n=e.pivotUtilities.numberFormat,c=e.pivotUtilities.aggregatorTemplates,l=e.pivotUtilities.renderers,s=e.pivotUtilities.gchart_renderers,r=e.pivotUtilities.d3_renderers,a=e.pivotUtilities.c3_renderers,o=n({thousandsSep:".",decimalSep:","}),t=n({digitsAfterDecimal:0,thousandsSep:".",decimalSep:","}),i=n({digitsAfterDecimal:2,scaler:100,suffix:"%",thousandsSep:".",decimalSep:","}),e.pivotUtilities.locales.pt={localeStrings:{renderError:"Ocorreu um error ao renderizar os resultados da Tabela Dinãmica.",computeError:"Ocorreu um error ao computar os resultados da Tabela Dinãmica.",uiRenderError:"Ocorreu um error ao renderizar a interface da Tabela Dinãmica.",selectAll:"Selecionar Tudo",selectNone:"Selecionar Nenhum",tooMany:"(demais para listar)",filterResults:"Filtrar resultados",totals:"Totais",vs:"vs",by:"por"},aggregators:{Contagem:c.count(t),"Contagem de Valores únicos":c.countUnique(t),"Lista de Valores únicos":c.listUnique(", "),Soma:c.sum(o),"Soma de Inteiros":c.sum(t),"Média":c.average(o),"Mínimo":c.min(o),"Máximo":c.max(o),"Soma sobre Soma":c.sumOverSum(o),"Limite Superior a 80%":c.sumOverSumBound80(!0,o),"Limite Inferior a 80%":c.sumOverSumBound80(!1,o),"Soma como Fração do Total":c.fractionOf(c.sum(),"total",i),"Soma como Fração da Linha":c.fractionOf(c.sum(),"row",i),"Soma como Fração da Coluna":c.fractionOf(c.sum(),"col",i),"Contagem como Fração do Total":c.fractionOf(c.count(),"total",i),"Contagem como Fração da Linha":c.fractionOf(c.count(),"row",i),"Contagem como Fração da Coluna":c.fractionOf(c.count(),"col",i)},renderers:{Tabela:l.Table,"Tabela com Barras":l["Table Barchart"],"Mapa de Calor":l.Heatmap,"Mapa de Calor por Linhas":l["Row Heatmap"],"Mapa de Calor por Colunas":l["Col Heatmap"]}},s&&(e.pivotUtilities.locales.pt.gchart_renderers={"Gráfico de Linhas":s["Line Chart"],"Gráfico de Barras":s["Bar Chart"],"Gráfico de Barras Empilhadas":s["Stacked Bar Chart"],"Gráfico de Área":s["Area Chart"]}),r&&(e.pivotUtilities.locales.pt.d3_renderers={"Mapa de Árvore":r.Treemap}),a&&(e.pivotUtilities.locales.pt.c3_renderers={"Gráfico de Linhas":a["Line Chart"],"Gráfico de Barras":a["Bar Chart"],"Gráfico de Barras Empilhadas":a["Stacked Bar Chart"],"Gráfico de Área":a["Area Chart"]}),e.pivotUtilities.locales.pt})}).call(this);
(function(){var a;(a=function(a){return"object"==typeof exports&&"object"==typeof module?a(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)})(function(a){var e,r,o,i,t,s,l,n,c;return l=a.pivotUtilities.numberFormat,c=a.pivotUtilities.aggregatorTemplates,n=a.pivotUtilities.renderers,s=a.pivotUtilities.gchart_renderers,r=a.pivotUtilities.d3_renderers,e=a.pivotUtilities.c3_renderers,o=l({thousandsSep:".",decimalSep:","}),i=l({digitsAfterDecimal:0,thousandsSep:".",decimalSep:","}),t=l({digitsAfterDecimal:2,scaler:100,suffix:"%",thousandsSep:".",decimalSep:","}),a.pivotUtilities.locales.pt={localeStrings:{renderError:"Ocorreu um error ao renderizar os resultados da Tabela Dinâmica.",computeError:"Ocorreu um error ao computar os resultados da Tabela Dinâmica.",uiRenderError:"Ocorreu um error ao renderizar a interface da Tabela Dinâmica.",selectAll:"Selecionar Tudo",selectNone:"Selecionar Nenhum",tooMany:"(demais para listar)",filterResults:"Filtrar resultados",totals:"Totais",apply:"Aplicar",cancel:"Cancelar",vs:"vs",by:"por"},aggregators:{Contagem:c.count(i),"Contagem de Valores únicos":c.countUnique(i),"Lista de Valores únicos":c.listUnique(", "),Soma:c.sum(o),"Soma de Inteiros":c.sum(i),"Média":c.average(o),"Mínimo":c.min(o),"Máximo":c.max(o),Primeiro:c.first(o),"Último":c.last(o),"Soma sobre Soma":c.sumOverSum(o),"Limite Superior a 80%":c.sumOverSumBound80(!0,o),"Limite Inferior a 80%":c.sumOverSumBound80(!1,o),"Soma como Fração do Total":c.fractionOf(c.sum(),"total",t),"Soma como Fração da Linha":c.fractionOf(c.sum(),"row",t),"Soma como Fração da Coluna":c.fractionOf(c.sum(),"col",t),"Contagem como Fração do Total":c.fractionOf(c.count(),"total",t),"Contagem como Fração da Linha":c.fractionOf(c.count(),"row",t),"Contagem como Fração da Coluna":c.fractionOf(c.count(),"col",t)},renderers:{Tabela:n.Table,"Tabela com Barras":n["Table Barchart"],"Mapa de Calor":n.Heatmap,"Mapa de Calor por Linhas":n["Row Heatmap"],"Mapa de Calor por Colunas":n["Col Heatmap"]}},s&&(a.pivotUtilities.locales.pt.gchart_renderers={"Gráfico de Linhas":s["Line Chart"],"Gráfico de Barras":s["Bar Chart"],"Gráfico de Barras Empilhadas":s["Stacked Bar Chart"],"Gráfico de Área":s["Area Chart"]}),r&&(a.pivotUtilities.locales.pt.d3_renderers={"Mapa de Árvore":r.Treemap}),e&&(a.pivotUtilities.locales.pt.c3_renderers={"Gráfico de Linhas":e["Line Chart"],"Gráfico de Barras":e["Bar Chart"],"Gráfico de Barras Empilhadas":e["Stacked Bar Chart"],"Gráfico de Área":e["Area Chart"]}),a.pivotUtilities.locales.pt})}).call(this);
//# sourceMappingURL=pivot.pt.min.js.map
{
"name": "pivottable",
"version": "2.13.0",
"version": "2.14.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",

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