pivottable
Advanced tools
Comparing version 2.11.1 to 2.12.0
@@ -383,2 +383,92 @@ (function() { | ||
}); | ||
describe(".aggregatorTemplates", function() { | ||
var getVal, tpl; | ||
getVal = function(aggregator) { | ||
var pd; | ||
pd = new $.pivotUtilities.PivotData(fixtureData, { | ||
aggregator: aggregator | ||
}); | ||
return pd.getAggregator([], []).value(); | ||
}; | ||
tpl = $.pivotUtilities.aggregatorTemplates; | ||
describe(".count", function() { | ||
return it("works", function() { | ||
return expect(getVal(tpl.count()())).toBe(4); | ||
}); | ||
}); | ||
describe(".countUnique", function() { | ||
return it("works", function() { | ||
return expect(getVal(tpl.countUnique()(['gender']))).toBe(2); | ||
}); | ||
}); | ||
describe(".listUnique", function() { | ||
return it("works", function() { | ||
return expect(getVal(tpl.listUnique()(['gender']))).toBe('male,female'); | ||
}); | ||
}); | ||
describe(".average", function() { | ||
return it("works", function() { | ||
return expect(getVal(tpl.average()(['trials']))).toBe(103); | ||
}); | ||
}); | ||
describe(".sum", function() { | ||
return it("works", function() { | ||
return expect(getVal(tpl.sum()(['trials']))).toBe(412); | ||
}); | ||
}); | ||
describe(".min", function() { | ||
return it("works", function() { | ||
return expect(getVal(tpl.min()(['trials']))).toBe(95); | ||
}); | ||
}); | ||
describe(".max", function() { | ||
return it("works", function() { | ||
return expect(getVal(tpl.max()(['trials']))).toBe(112); | ||
}); | ||
}); | ||
describe(".first", function() { | ||
return it("works", function() { | ||
return expect(getVal(tpl.first()(['name']))).toBe('Carol'); | ||
}); | ||
}); | ||
describe(".last", function() { | ||
return it("works", function() { | ||
return expect(getVal(tpl.last()(['name']))).toBe('Nick'); | ||
}); | ||
}); | ||
describe(".average", function() { | ||
return it("works", function() { | ||
return expect(getVal(tpl.average()(['trials']))).toBe(103); | ||
}); | ||
}); | ||
describe(".median", function() { | ||
return it("works", function() { | ||
return expect(getVal(tpl.median()(['trials']))).toBe(102.5); | ||
}); | ||
}); | ||
describe(".quantile", function() { | ||
return it("works", function() { | ||
expect(getVal(tpl.quantile(0)(['trials']))).toBe(95); | ||
expect(getVal(tpl.quantile(0.1)(['trials']))).toBe(98.5); | ||
expect(getVal(tpl.quantile(0.25)(['trials']))).toBe(98.5); | ||
expect(getVal(tpl.quantile(1 / 3)(['trials']))).toBe(102); | ||
return expect(getVal(tpl.quantile(1)(['trials']))).toBe(112); | ||
}); | ||
}); | ||
describe(".var", function() { | ||
return it("works", function() { | ||
return expect(getVal(tpl["var"]()(['trials']))).toBe(48.666666666666686); | ||
}); | ||
}); | ||
describe(".stdev", function() { | ||
return it("works", function() { | ||
return expect(getVal(tpl.stdev()(['trials']))).toBe(6.976149845485451); | ||
}); | ||
}); | ||
return describe(".sumOverSum", function() { | ||
return it("works", function() { | ||
return expect(getVal(tpl.sumOverSum()(['successes', 'trials']))).toBe((12 + 25 + 30 + 14) / (95 + 102 + 103 + 112)); | ||
}); | ||
}); | ||
}); | ||
describe(".naturalSort()", function() { | ||
@@ -385,0 +475,0 @@ var naturalSort, sortedArr; |
@@ -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,l,s;for(i=0,c=0,l=e.getRowKeys(),r=0,a=l.length;a>r;r++)for(u=l[r],s=e.getColKeys(),n=0,o=s.length;o>n;n++)t=s[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(".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")}),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); | ||
//# sourceMappingURL=pivot_spec.min.js.map |
@@ -89,3 +89,3 @@ (function() { | ||
}, | ||
countUnique: function(formatter) { | ||
uniques: function(fn, formatter) { | ||
if (formatter == null) { | ||
@@ -107,3 +107,3 @@ formatter = usFmtInt; | ||
value: function() { | ||
return this.uniq.length; | ||
return fn(this.uniq); | ||
}, | ||
@@ -116,26 +116,2 @@ format: formatter, | ||
}, | ||
listUnique: function(sep) { | ||
return function(arg) { | ||
var attr; | ||
attr = arg[0]; | ||
return function(data, rowKey, colKey) { | ||
return { | ||
uniq: [], | ||
push: function(record) { | ||
var ref; | ||
if (ref = record[attr], indexOf.call(this.uniq, ref) < 0) { | ||
return this.uniq.push(record[attr]); | ||
} | ||
}, | ||
value: function() { | ||
return this.uniq.join(sep); | ||
}, | ||
format: function(x) { | ||
return x; | ||
}, | ||
numInputs: attr != null ? 0 : 1 | ||
}; | ||
}; | ||
}; | ||
}, | ||
sum: function(formatter) { | ||
@@ -165,3 +141,3 @@ if (formatter == null) { | ||
}, | ||
min: function(formatter) { | ||
extremes: function(mode, formatter) { | ||
if (formatter == null) { | ||
@@ -176,61 +152,22 @@ formatter = usFmt; | ||
val: null, | ||
push: function(record) { | ||
var ref, x; | ||
x = parseFloat(record[attr]); | ||
if (!isNaN(x)) { | ||
return this.val = Math.min(x, (ref = this.val) != null ? ref : x); | ||
} | ||
}, | ||
value: function() { | ||
return this.val; | ||
}, | ||
format: formatter, | ||
numInputs: attr != null ? 0 : 1 | ||
}; | ||
}; | ||
}; | ||
}, | ||
max: function(formatter) { | ||
if (formatter == null) { | ||
formatter = usFmt; | ||
} | ||
return function(arg) { | ||
var attr; | ||
attr = arg[0]; | ||
return function(data, rowKey, colKey) { | ||
return { | ||
val: null, | ||
push: function(record) { | ||
var ref, x; | ||
x = parseFloat(record[attr]); | ||
if (!isNaN(x)) { | ||
return this.val = Math.max(x, (ref = this.val) != null ? ref : x); | ||
} | ||
}, | ||
value: function() { | ||
return this.val; | ||
}, | ||
format: formatter, | ||
numInputs: attr != null ? 0 : 1 | ||
}; | ||
}; | ||
}; | ||
}, | ||
first: function(formatter) { | ||
if (formatter == null) { | ||
formatter = usFmt; | ||
} | ||
return function(arg) { | ||
var attr; | ||
attr = arg[0]; | ||
return function(data, rowKey, colKey) { | ||
return { | ||
val: null, | ||
sorter: getSort(data != null ? data.sorters : void 0, attr), | ||
push: function(record) { | ||
var ref, x; | ||
var ref, ref1, ref2, x; | ||
x = record[attr]; | ||
if (this.sorter(x, (ref = this.val) != null ? ref : x) <= 0) { | ||
return this.val = x; | ||
if (mode === "min" || mode === "max") { | ||
x = parseFloat(x); | ||
if (!isNaN(x)) { | ||
this.val = Math[mode](x, (ref = this.val) != null ? ref : x); | ||
} | ||
} | ||
if (mode === "first") { | ||
if (this.sorter(x, (ref1 = this.val) != null ? ref1 : x) <= 0) { | ||
this.val = x; | ||
} | ||
} | ||
if (mode === "last") { | ||
if (this.sorter(x, (ref2 = this.val) != null ? ref2 : x) >= 0) { | ||
return this.val = x; | ||
} | ||
} | ||
}, | ||
@@ -252,3 +189,3 @@ value: function() { | ||
}, | ||
last: function(formatter) { | ||
quantile: function(q, formatter) { | ||
if (formatter == null) { | ||
@@ -262,21 +199,22 @@ formatter = usFmt; | ||
return { | ||
val: null, | ||
sorter: getSort(data != null ? data.sorters : void 0, attr), | ||
vals: [], | ||
push: function(record) { | ||
var ref, x; | ||
x = record[attr]; | ||
if (this.sorter(x, (ref = this.val) != null ? ref : x) >= 0) { | ||
return this.val = x; | ||
var x; | ||
x = parseFloat(record[attr]); | ||
if (!isNaN(x)) { | ||
return this.vals.push(x); | ||
} | ||
}, | ||
value: function() { | ||
return this.val; | ||
}, | ||
format: function(x) { | ||
if (isNaN(x)) { | ||
return x; | ||
} else { | ||
return formatter(x); | ||
var i; | ||
if (this.vals.length === 0) { | ||
return null; | ||
} | ||
this.vals.sort(function(a, b) { | ||
return a - b; | ||
}); | ||
i = (this.vals.length - 1) * q; | ||
return (this.vals[Math.floor(i)] + this.vals[Math.ceil(i)]) / 2.0; | ||
}, | ||
format: formatter, | ||
numInputs: attr != null ? 0 : 1 | ||
@@ -287,3 +225,9 @@ }; | ||
}, | ||
average: function(formatter) { | ||
runningStat: function(mode, ddof, formatter) { | ||
if (mode == null) { | ||
mode = "mean"; | ||
} | ||
if (ddof == null) { | ||
ddof = 1; | ||
} | ||
if (formatter == null) { | ||
@@ -297,12 +241,37 @@ formatter = usFmt; | ||
return { | ||
sum: 0, | ||
len: 0, | ||
n: 0.0, | ||
m: 0.0, | ||
s: 0.0, | ||
push: function(record) { | ||
if (!isNaN(parseFloat(record[attr]))) { | ||
this.sum += parseFloat(record[attr]); | ||
return this.len++; | ||
var m_new, x; | ||
x = parseFloat(record[attr]); | ||
if (isNaN(x)) { | ||
return; | ||
} | ||
this.n += 1.0; | ||
if (this.n === 1.0) { | ||
return this.m = x; | ||
} else { | ||
m_new = this.m + (x - this.m) / this.n; | ||
this.s = this.s + (x - this.m) * (x - m_new); | ||
return this.m = m_new; | ||
} | ||
}, | ||
value: function() { | ||
return this.sum / this.len; | ||
if (mode === "mean") { | ||
if (this.n === 0) { | ||
return 0 / 0; | ||
} else { | ||
return this.m; | ||
} | ||
} | ||
if (this.n <= ddof) { | ||
return 0; | ||
} | ||
switch (mode) { | ||
case "var": | ||
return this.s / (this.n - ddof); | ||
case "stdev": | ||
return Math.sqrt(this.s / (this.n - ddof)); | ||
} | ||
}, | ||
@@ -407,2 +376,38 @@ format: formatter, | ||
}; | ||
aggregatorTemplates.countUnique = function(f) { | ||
return aggregatorTemplates.uniques((function(x) { | ||
return x.length; | ||
}), f); | ||
}; | ||
aggregatorTemplates.listUnique = function(s) { | ||
return aggregatorTemplates.uniques((function(x) { | ||
return x.join(s); | ||
}), (function(x) { | ||
return x; | ||
})); | ||
}; | ||
aggregatorTemplates.max = function(f) { | ||
return aggregatorTemplates.extremes('max', f); | ||
}; | ||
aggregatorTemplates.min = function(f) { | ||
return aggregatorTemplates.extremes('min', f); | ||
}; | ||
aggregatorTemplates.first = function(f) { | ||
return aggregatorTemplates.extremes('first', f); | ||
}; | ||
aggregatorTemplates.last = function(f) { | ||
return aggregatorTemplates.extremes('last', f); | ||
}; | ||
aggregatorTemplates.median = function(f) { | ||
return aggregatorTemplates.quantile(0.5, f); | ||
}; | ||
aggregatorTemplates.average = function(f) { | ||
return aggregatorTemplates.runningStat("mean", f); | ||
}; | ||
aggregatorTemplates["var"] = function(f) { | ||
return aggregatorTemplates.runningStat("var", f); | ||
}; | ||
aggregatorTemplates.stdev = function(f) { | ||
return aggregatorTemplates.runningStat("stdev", f); | ||
}; | ||
aggregators = (function(tpl) { | ||
@@ -416,2 +421,5 @@ return { | ||
"Average": tpl.average(usFmt), | ||
"Median": tpl.median(usFmt), | ||
"Sample Variance": tpl["var"](usFmt), | ||
"Sample Standard Deviation": tpl.stdev(usFmt), | ||
"Minimum": tpl.min(usFmt), | ||
@@ -1195,3 +1203,3 @@ "Maximum": tpl.max(usFmt), | ||
$.fn.pivotUI = function(input, inputOpts, overwrite, locale) { | ||
var a, aggregator, attr, attrLength, attrValues, colOrderArrow, defaults, e, existingOpts, fn, i, initialRender, l, len1, len2, len3, localeDefaults, localeStrings, materializedInput, n, o, opts, ordering, pivotTable, recordsProcessed, ref, ref1, ref2, ref3, refresh, refreshDelayed, renderer, rendererControl, rowOrderArrow, shownAttributes, tr1, tr2, uiTable, unused, unusedAttrsVerticalAutoCutoff, unusedAttrsVerticalAutoOverride, x; | ||
var a, aggregator, attr, attrLength, attrValues, colOrderArrow, defaults, e, existingOpts, fn1, i, initialRender, l, len1, len2, len3, localeDefaults, localeStrings, materializedInput, n, o, opts, ordering, pivotTable, recordsProcessed, ref, ref1, ref2, ref3, refresh, refreshDelayed, renderer, rendererControl, rowOrderArrow, shownAttributes, tr1, tr2, uiTable, unused, unusedAttrsVerticalAutoCutoff, unusedAttrsVerticalAutoOverride, x; | ||
if (overwrite == null) { | ||
@@ -1311,3 +1319,3 @@ overwrite = false; | ||
} | ||
fn = function(attr) { | ||
fn1 = function(attr) { | ||
var attrElem, checkContainer, closeFilterBox, controls, filterItem, filterItemExcluded, finalButtons, hasExcludedItem, len2, n, placeholder, ref1, sorter, triangleLink, v, value, valueCount, valueList, values; | ||
@@ -1446,3 +1454,3 @@ values = (function() { | ||
attr = shownAttributes[i]; | ||
fn(attr); | ||
fn1(attr); | ||
} | ||
@@ -1520,3 +1528,3 @@ tr1 = $("<tr>").appendTo(uiTable); | ||
return function() { | ||
var exclusions, inclusions, len4, newDropdown, numInputsToProcess, pivotUIOptions, pvtVals, q, ref4, ref5, s, subopts, unusedAttrsContainer, vals; | ||
var exclusions, inclusions, len4, newDropdown, numInputsToProcess, pivotUIOptions, pvtVals, ref4, ref5, subopts, t, u, unusedAttrsContainer, vals; | ||
subopts = { | ||
@@ -1551,8 +1559,8 @@ derivedAttributes: opts.derivedAttributes, | ||
pvtVals = _this.find(".pvtVals"); | ||
for (x = q = 0, ref5 = numInputsToProcess; 0 <= ref5 ? q < ref5 : q > ref5; x = 0 <= ref5 ? ++q : --q) { | ||
for (x = t = 0, ref5 = numInputsToProcess; 0 <= ref5 ? t < ref5 : t > ref5; x = 0 <= ref5 ? ++t : --t) { | ||
newDropdown = $("<select>").addClass('pvtAttrDropdown').append($("<option>")).bind("change", function() { | ||
return refresh(); | ||
}); | ||
for (s = 0, len4 = shownAttributes.length; s < len4; s++) { | ||
attr = shownAttributes[s]; | ||
for (u = 0, len4 = shownAttributes.length; u < len4; u++) { | ||
attr = shownAttributes[u]; | ||
newDropdown.append($("<option>").val(attr).text(attr)); | ||
@@ -1559,0 +1567,0 @@ } |
@@ -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,l,u,s,c,d,h,p,f,m,v,g,b,C,y,w,A,x,N,S;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}),N=m({digitsAfterDecimal:1,scaler:100,suffix:"%"}),l={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}}}},countUnique:function(t){return null==t&&(t=x),function(n){var r;return r=n[0],function(n,a,o){return{uniq:[],push:function(t){var n;return n=t[r],e.call(this.uniq,n)<0?this.uniq.push(t[r]):void 0},value:function(){return this.uniq.length},format:t,numInputs:null!=r?0:1}}}},listUnique:function(t){return function(n){var r;return r=n[0],function(n,a,o){return{uniq:[],push:function(t){var n;return n=t[r],e.call(this.uniq,n)<0?this.uniq.push(t[r]):void 0},value:function(){return this.uniq.join(t)},format:function(t){return t},numInputs:null!=r?0:1}}}},sum:function(t){return null==t&&(t=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}}}},min:function(t){return null==t&&(t=A),function(e){var n;return n=e[0],function(e,r,a){return{val:null,push:function(t){var e,r;return r=parseFloat(t[n]),isNaN(r)?void 0:this.val=Math.min(r,null!=(e=this.val)?e:r)},value:function(){return this.val},format:t,numInputs:null!=n?0:1}}}},max:function(t){return null==t&&(t=A),function(e){var n;return n=e[0],function(e,r,a){return{val:null,push:function(t){var e,r;return r=parseFloat(t[n]),isNaN(r)?void 0:this.val=Math.max(r,null!=(e=this.val)?e:r)},value:function(){return this.val},format:t,numInputs:null!=n?0:1}}}},first:function(t){return null==t&&(t=A),function(e){var n;return n=e[0],function(e,r,a){return{val:null,sorter:d(null!=e?e.sorters:void 0,n),push:function(t){var e,r;return r=t[n],this.sorter(r,null!=(e=this.val)?e:r)<=0?this.val=r:void 0},value:function(){return this.val},format:function(e){return isNaN(e)?e:t(e)},numInputs:null!=n?0:1}}}},last:function(t){return null==t&&(t=A),function(e){var n;return n=e[0],function(e,r,a){return{val:null,sorter:d(null!=e?e.sorters:void 0,n),push:function(t){var e,r;return r=t[n],this.sorter(r,null!=(e=this.val)?e:r)>=0?this.val=r:void 0},value:function(){return this.val},format:function(e){return isNaN(e)?e:t(e)},numInputs:null!=n?0:1}}}},average:function(t){return null==t&&(t=A),function(e){var n;return n=e[0],function(e,r,a){return{sum:0,len:0,push:function(t){return isNaN(parseFloat(t[n]))?void 0:(this.sum+=parseFloat(t[n]),this.len++)},value:function(){return this.sum/this.len},format:t,numInputs:null!=n?0:1}}}},sumOverSum:function(t){return null==t&&(t=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=N),function(){var a;return a=1<=arguments.length?n.call(arguments,0):[],function(n,o,i){return{selector:{total:[[],[]],row:[o,[]],col:[[],i]}[e],inner:t.apply(null,a)(n,o,i),push:function(t){return this.inner.push(t)},format:r,value:function(){return this.inner.value()/n.getAggregator.apply(n,this.selector).inner.value()},numInputs:t.apply(null,a)().numInputs}}}}},u=function(t){return{Count:t.count(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),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",N),"Sum as Fraction of Rows":t.fractionOf(t.sum(),"row",N),"Sum as Fraction of Columns":t.fractionOf(t.sum(),"col",N),"Count as Fraction of Total":t.fractionOf(t.count(),"total",N),"Count as Fraction of Rows":t.fractionOf(t.count(),"row",N),"Count as Fraction of Columns":t.fractionOf(t.count(),"col",N)}}(l),b={Table:function(t,e){return v(t,e)},"Table Barchart":function(e,n){return t(v(e,n)).barchart()},Heatmap:function(e,n){return t(v(e,n)).heatmap("heatmap",n)},"Row Heatmap":function(e,n){return t(v(e,n)).heatmap("rowheatmap",n)},"Col Heatmap":function(e,n){return t(v(e,n)).heatmap("colheatmap",n)}},h={en:{aggregators:u,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"],s=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],S=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=s),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 S(i["get"+o+"Month"]()+1);case"n":return r[i["get"+o+"Month"]()];case"d":return S(i["get"+o+"Date"]());case"w":return a[i["get"+o+"Day"]()];case"x":return i["get"+o+"Day"]();case"H":return S(i["get"+o+"Hours"]());case"M":return S(i["get"+o+"Minutes"]());case"S":return S(i["get"+o+"Seconds"]());default:return"%"+e}})}}},C=/(\d+)|(\D+)/g,g=/\d/,y=/^0/,f=function(t){return function(t,e){var n,r,a,o,i,l;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,l=+e,l>i)return-1;if(i>l)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(l)&&!isNaN(i))return-1;if(isNaN(i)&&!isNaN(l))return 1;if(n=String(t),a=String(e),n===a)return 0;if(!g.test(n)||!g.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 g.test(r)&&g.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,u,s,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:l.count()(),this.aggregatorName=null!=(o=n.aggregatorName)?o:"Count",this.colAttrs=null!=(i=n.cols)?i:[],this.rowAttrs=null!=(u=n.rows)?u:[],this.valAttrs=null!=(s=n.vals)?s:[],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,l,u,s,c,d,h,p,f,m,v;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(l in e)if(a.call(e,l)&&(i=e[l],l>0)){h={},p=e[0];for(u in p)a.call(p,u)&&(s=p[u],h[s]=i[u]);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 v=[],t("thead > tr > th",e).each(function(e){return v.push(t(this).text())}),t("tbody > tr",e).each(function(e){return h={},t("td",this).each(function(e){return h[v[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,l,u,s,c,d,h,p;for(e=[],h=[],u=this.colAttrs,a=0,o=u.length;o>a;a++)p=u[a],e.push(null!=(s=t[p])?s:"null");for(c=this.rowAttrs,l=0,i=c.length;i>l;l++)p=c[l],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:l,aggregators:u,renderers:b,derivers:c,locales:h,naturalSort:f,numberFormat:m,sortAs:w,PivotData:o},v=function(e,n){var r,o,i,l,u,s,c,d,h,p,f,m,v,g,b,C,y,w,A,x,N,S,T,k;s={table:{clickCallback:null},localeStrings:{totals:"Totals"}},n=t.extend(!0,{},s,n),i=e.colAttrs,m=e.rowAttrs,g=e.getRowKeys(),u=e.getColKeys(),n.table.clickCallback&&(c=function(t,r,o){var l,u,s;u={};for(s in i)a.call(i,s)&&(l=i[s],null!=o[s]&&(u[l]=o[s]));for(s in m)a.call(m,s)&&(l=m[s],null!=r[s]&&(u[l]=r[s]));return function(r){return n.table.clickCallback(r,t,u,e)}}),f=document.createElement("table"),f.className="pvtTable",b=function(t,e,n){var r,a,o,i,l,u,s,c;if(0!==e){for(i=!0,c=r=0,l=n;l>=0?l>=r:r>=l;c=l>=0?++r:--r)t[e-1][c]!==t[e][c]&&(i=!1);if(i)return-1}for(a=0;e+a<t.length;){for(s=!1,c=o=0,u=n;u>=0?u>=o:o>=u;c=u>=0?++o:--o)t[e][c]!==t[e+a][c]&&(s=!0);if(s)break;a++}return a},A=document.createElement("thead");for(h in i)if(a.call(i,h)){o=i[h],N=document.createElement("tr"),0===parseInt(h)&&0!==m.length&&(w=document.createElement("th"),w.setAttribute("colspan",m.length),w.setAttribute("rowspan",i.length),N.appendChild(w)),w=document.createElement("th"),w.className="pvtAxisLabel",w.textContent=o,N.appendChild(w);for(d in u)a.call(u,d)&&(l=u[d],k=b(u,parseInt(d),parseInt(h)),-1!==k&&(w=document.createElement("th"),w.className="pvtColLabel",w.textContent=l[h],w.setAttribute("colspan",k),parseInt(h)===i.length-1&&0!==m.length&&w.setAttribute("rowspan",2),N.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)),N.appendChild(w)),A.appendChild(N)}if(0!==m.length){N=document.createElement("tr");for(d in m)a.call(m,d)&&(p=m[d],w=document.createElement("th"),w.className="pvtAxisLabel",w.textContent=p,N.appendChild(w));w=document.createElement("th"),0===i.length&&(w.className="pvtTotalLabel",w.innerHTML=n.localeStrings.totals),N.appendChild(w),A.appendChild(N)}f.appendChild(A),C=document.createElement("tbody");for(d in g)if(a.call(g,d)){v=g[d],N=document.createElement("tr");for(h in v)a.call(v,h)&&(S=v[h],k=b(g,parseInt(d),parseInt(h)),-1!==k&&(w=document.createElement("th"),w.className="pvtRowLabel",w.textContent=S,w.setAttribute("rowspan",k),parseInt(h)===m.length-1&&0!==i.length&&w.setAttribute("colspan",2),N.appendChild(w)));for(h in u)a.call(u,h)&&(l=u[h],r=e.getAggregator(v,l),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,v,l)),N.appendChild(y));x=e.getAggregator(v,[]),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,v,[])),y.setAttribute("data-for","row"+d),N.appendChild(y),C.appendChild(N)}N=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)),N.appendChild(w);for(h in u)a.call(u,h)&&(l=u[h],x=e.getAggregator([],l),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,[],l)),y.setAttribute("data-for","col"+h),N.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,[],[])),N.appendChild(y),C.appendChild(N),f.appendChild(C),f.setAttribute("data-numrows",g.length),f.setAttribute("data-numcols",u.length),f},t.fn.pivot=function(e,n,r){var a,i,u,s,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:l.count()(),aggregatorName:"Count",sorters:{},derivedAttributes:{},renderer:v},s=t.extend(!0,{},h.en.localeStrings,h[r].localeStrings),u={rendererOptions:{localeStrings:s},localeStrings:s},c=t.extend(!0,{},u,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,l){var u,s,c,p,m,v,g,b,C,y,w,A,x,N,S,T,k,_,O,F,E,R,D,I,M,K,L,q,z,U,V,j,H,B,W,P,J,G,Q,Z,$,Y;null==i&&(i=!1),null==l&&(l="en"),null==h[l]&&(l="en"),g={derivedAttributes:{},aggregators:h[l].aggregators,renderers:h[l].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[l].localeStrings),k={rendererOptions:{localeStrings:_},localeStrings:_},C=this.data("pivotUIOptions"),R=null==C||i?t.extend(!0,{},k,t.extend({},g,r)):C;try{m={},O=[],M=0,o.forEachRecord(n,R.derivedAttributes,function(t){var e,n,r,o;if(R.filter(t)){O.push(t);for(e in t)a.call(t,e)&&null==m[e]&&(m[e]={},M>0&&(m[e]["null"]=M));for(e in m)o=null!=(r=t[e])?r:"null",null==(n=m[e])[o]&&(n[o]=0),m[e][o]++;return M++}}),G=t("<table>",{"class":"pvtUi"}).attr("cellpadding",5),H=t("<td>"),j=t("<select>").addClass("pvtRenderer").appendTo(H).bind("change",function(){return U()}),K=R.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(u in m)e.call(R.hiddenAttributes,u)<0&&t.push(u);return t}(),$=!1,Z="auto"===R.unusedAttrsVertical?120:parseInt(R.unusedAttrsVertical),!isNaN(Z)){for(p=0,x=0,N=W.length;N>x;x++)u=W[x],p+=u.length;$=p>Z}Q.addClass(R.unusedAttrsVertical===!0||$?"pvtVertList":"pvtHorizList"),y=function(n){var r,a,o,i,l,u,s,c,h,p,f,v,g,b,C,y,A,x,N;if(N=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("("+N.length+")"))),N.length>R.menuLimit)x.append(t("<p>").html(R.localeStrings.tooMany));else for(N.length>5&&(i=t("<p>").appendTo(x),g=d(R.sorters,n),f=R.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(g(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(R.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(R.localeStrings.selectNone).bind("click",function(){return x.find("input:visible:checked").prop("checked",!1).toggleClass("changed"),!1})),a=t("<div>").addClass("pvtCheckContainer").appendTo(x),v=N.sort(d(R.sorters,n)),p=0,h=v.length;h>p;p++)y=v[p],A=m[n][y],l=t("<label>"),u=!1,R.inclusions[n]?u=e.call(R.inclusions[n],y)<0:R.exclusions[n]&&(u=e.call(R.exclusions[n],y)>=0),c||(c=u),t("<input>").attr("type","checkbox").addClass("pvtFilter").attr("checked",!u).data("filter",[n,y]).appendTo(l).bind("change",function(){return t(this).toggleClass("changed")}),l.append(t("<span>").addClass("value").text(y)),l.append(t("<span>").addClass("count").text("("+A+")")),a.append(t("<p>").append(l));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()},s=t("<p>").appendTo(x),N.length<=R.menuLimit&&t("<button>",{type:"button"}).text(R.localeStrings.apply).appendTo(s).bind("click",function(){return x.find(".changed").removeClass("changed").length&&U(),o()}),t("<button>",{type:"button"}).text(R.localeStrings.cancel).appendTo(s).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(" ▾").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),s=t("<select>").addClass("pvtAggregator").bind("change",function(){return U()}),L=R.aggregators;for(Y in L)a.call(L,Y)&&s.append(t("<option>").val(Y).html(Y));for(D={key_a_to_z:{rowSymbol:"↕",colSymbol:"↔",next:"value_a_to_z"},value_a_to_z:{rowSymbol:"↓",colSymbol:"→",next:"value_z_to_a"},value_z_to_a:{rowSymbol:"↑",colSymbol:"←",next:"key_a_to_z"}},B=t("<a>",{role:"button"}).addClass("pvtRowOrder").data("order",R.rowOrder).html(D[R.rowOrder].rowSymbol).bind("click",function(){return t(this).data("order",D[t(this).data("order")].next),t(this).html(D[t(this).data("order")].rowSymbol),U()}),v=t("<a>",{role:"button"}).addClass("pvtColOrder").data("order",R.colOrder).html(D[R.colOrder].colSymbol).bind("click",function(){return t(this).data("order",D[t(this).data("order")].next),t(this).html(D[t(this).data("order")].colSymbol),U()}),t("<td>").addClass("pvtVals").appendTo(P).append(s).append(B).append(v).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")),I=t("<td>").attr("valign","top").addClass("pvtRendererArea").appendTo(J),R.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=R.cols,F=0,S=q.length;S>F;F++)Y=q[F],this.find(".pvtCols").append(this.find(".axis_"+t.inArray(Y,W)));for(z=R.rows,E=0,T=z.length;T>E;E++)Y=z[E],this.find(".pvtRows").append(this.find(".axis_"+t.inArray(Y,W)));null!=R.aggregatorName&&this.find(".pvtAggregator").val(R.aggregatorName),null!=R.rendererName&&this.find(".pvtRenderer").val(R.rendererName),A=!0,V=function(n){return function(){var r,a,o,i,l,u,d,h,p,m,g,b,C,y;if(b={derivedAttributes:R.derivedAttributes,localeStrings:R.localeStrings,rendererOptions:R.rendererOptions,sorters:R.sorters,cols:[],rows:[],dataClass:R.dataClass},l=null!=(p=R.aggregators[s.val()]([])().numInputs)?p:0,y=[],n.find(".pvtRows li span.pvtAttr").each(function(){return b.rows.push(t(this).data("attrName"))}),n.find(".pvtCols li span.pvtAttr").each(function(){return b.cols.push(t(this).data("attrName"))}),n.find(".pvtVals select.pvtAttrDropdown").each(function(){return 0===l?t(this).remove():(l--,""!==t(this).val()?y.push(t(this).val()):void 0)}),0!==l)for(d=n.find(".pvtVals"),Y=h=0,m=l;m>=0?m>h:h>m;Y=m>=0?++h:--h){for(i=t("<select>").addClass("pvtAttrDropdown").append(t("<option>")).bind("change",function(){return U()}),g=0,o=W.length;o>g;g++)c=W[g],i.append(t("<option>").val(c).text(c));d.append(i)}return A&&(y=R.vals,w=0,n.find(".pvtVals select.pvtAttrDropdown").each(function(){return t(this).val(y[w]),w++}),A=!1),b.aggregatorName=s.val(),b.vals=y,b.aggregator=R.aggregators[s.val()](y),b.renderer=R.renderers[j.val()],b.rowOrder=B.data("order"),b.colOrder=v.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}),b.filter=function(t){var n,a,o,i;if(!R.filter(t))return!1;for(a in r)if(n=r[a],o=""+(null!=(i=t[a])?i:"null"),e.call(n,o)>=0)return!1;return!0},I.pivot(O,b),u=t.extend({},R,{cols:b.cols,rows:b.rows,colOrder:b.colOrder,rowOrder:b.rowOrder,vals:y,exclusions:r,inclusions:a,inclusionsInfo:a,aggregatorName:s.val(),rendererName:j.val()}),n.data("pivotUIOptions",u),R.autoSortUnusedAttrs&&(C=n.find("td.pvtUnused.pvtAxisContainer"),t(C).children("li").sort(function(e,n){return f(t(e).text(),t(n).text())}).appendTo(C)),I.css("opacity",1),null!=R.onRefresh?R.onRefresh(u):void 0}}(this),U=function(t){return function(){return I.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(R.localeStrings.uiRenderError)}return this},t.fn.heatmap=function(e,n){var r,a,o,i,l,u,s,c,d,h,p;switch(null==e&&(e="heatmap"),c=this.data("numrows"),s=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=l=0,h=c;h>=0?h>l:l>h;o=h>=0?++l:--l)a(".pvtVal.row"+o);break;case"colheatmap":for(i=u=0,p=s;p>=0?p>u:u>p;i=p>=0?++u:--u)a(".pvtVal.col"+i)}return a(".pvtTotal.rowTotal"),a(".pvtTotal.colTotal"),this},t.fn.barchart=function(){var e,n,r,a,o,i;for(o=this.data("numrows"),a=this.data("numcols"),e=function(e){return function(n){var r,a,o,i;return r=function(r){return e.find(n).each(function(){var e;return e=t(this).data("value"),null!=e&&isFinite(e)?r(e,t(this)):void 0})},i=[],r(function(t){return i.push(t)}),a=Math.max.apply(Math,i),o=function(t){return 100*t/(1.4*a)},r(function(e,n){var r,a;return r=n.text(),a=t("<div>").css({position:"relative",height:"55px"}),a.append(t("<div>").css({position:"absolute",bottom:0,left:0,right:0,height:o(e)+"%","background-color":"gray"})),a.append(t("<div>").text(r).css({position:"relative","padding-left":"5px","padding-right":"5px"})),n.css({padding:0,"padding-top":"5px","text-align":"center"}).html(a)})}}(this),n=r=0,i=o;i>=0?i>r:r>i;n=i>=0?++r:--r)e(".pvtVal.row"+n);return e(".pvtTotal.colTotal"),this}})}).call(this); | ||
(function(){var t,e=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},n=[].slice,r=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty;(t=function(t){return"object"==typeof exports&&"object"==typeof module?t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){var o,i,s,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",t)},s["var"]=function(t){return s.runningStat("var",t)},s.stdev=function(t){return s.runningStat("stdev",t)},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"](A),"Sample Standard Deviation":t.stdev(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(" ▾").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:"↕",colSymbol:"↔",next:"value_a_to_z"},value_a_to_z:{rowSymbol:"↓",colSymbol:"→",next:"value_z_to_a"},value_z_to_a:{rowSymbol:"↑",colSymbol:"←",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); | ||
//# sourceMappingURL=pivot.min.js.map |
@@ -82,2 +82,2 @@ (function() { | ||
//# sourceMappingURL=pivot.pl.js.map | ||
//# sourceMappingURL=pivot.pl.js.map |
(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,i,t,o,r;return a=e.pivotUtilities.numberFormat,r=e.pivotUtilities.aggregatorTemplates,i=a({thousandsSep:" ",decimalSep:","}),t=a({digitsAfterDecimal:0,thousandsSep:" ",decimalSep:","}),o=a({digitsAfterDecimal:1,scaler:100,suffix:"%",thousandsSep:" ",decimalSep:","}),e.pivotUtilities.locales.pl={localeStrings:{renderError:"Wystąpił błąd podczas renderowania wyników PivotTable.",computeError:"Wystąpił błąd podczas obliczania wyników PivotTable.",uiRenderError:"Wystąpił błąd podczas renderowania UI PivotTable.",selectAll:"Zaznacz wszystko",selectNone:"Odznacz wszystkie",tooMany:"(za dużo do wylistowania)",filterResults:"Filtruj wartości",apply:"Zastosuj",cancel:"Anuluj",totals:"Podsumowanie",vs:"vs",by:"przez"},aggregators:{Liczba:r.count(t),"Liczba Unikatowych Wartości":r.countUnique(t),"Lista Unikatowych Wartości":r.listUnique(", "),Suma:r.sum(i),"Całkowita Suma":r.sum(t),"Średnia":r.average(i),Minimum:r.min(i),Maksimum:r.max(i),Pierwszy:r.first(i),Ostatni:r.last(i),"Suma po Sumie":r.sumOverSum(i),"80% Kres Dolny":r.sumOverSumBound80(!0,i),"80% Kres Górny":r.sumOverSumBound80(!1,i),"Suma jako Ułamek Całości":r.fractionOf(r.sum(),"total",o),"Suma jako Ułamek w Wierszach":r.fractionOf(r.sum(),"row",o),"Suma jako Ułamek w Kolumnach":r.fractionOf(r.sum(),"col",o),"Liczba jako Ułamek Całości":r.fractionOf(r.count(),"total",o),"Liczba jako Ułamek w Wierszach":r.fractionOf(r.count(),"row",o),"Liczba jako Ułamek w Kolumnach":r.fractionOf(r.count(),"col",o)},renderers:{Tabela:e.pivotUtilities.renderers.Table,"Tabela z Wykresem Słupkowym":e.pivotUtilities.renderers["Table Barchart"],"Mapa cieplna":e.pivotUtilities.renderers.Heatmap,"Mapa cieplna po Wierszach":e.pivotUtilities.renderers["Row Heatmap"],"Mapa cieplna po Kolumnach":e.pivotUtilities.renderers["Col Heatmap"]}}})}).call(this); | ||
//# sourceMappingURL=pivot.pl.min.js.map | ||
//# sourceMappingURL=pivot.pl.min.js.map |
{ | ||
"name": "pivottable", | ||
"version": "2.11.1", | ||
"version": "2.12.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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
834928
4577
16