UNPKG

pivottable

Version:

Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop

3 lines (2 loc) 1.07 kB
(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){return e.pivotUtilities.export_renderers={"TSV Export":function(t,n){var r,o,h,u,i,l,g,s,p,f,a,c,d,w,x,y,j,v,m,q,A,b,K,S,C;for(i={localeStrings:{}},n=e.extend(!0,{},i,n),S=t.getRowKeys(),0===S.length&&S.push([]),u=t.getColKeys(),0===u.length&&u.push([]),b=t.rowAttrs,o=t.colAttrs,m=[],q=[],l=0,f=b.length;l<f;l++)A=b[l],q.push(A);if(1===u.length&&0===u[0].length)q.push(t.aggregatorName);else for(g=0,a=u.length;g<a;g++)h=u[g],q.push(h.join("-"));for(m.push(q),s=0,c=S.length;s<c;s++){for(K=S[s],q=[],p=0,d=K.length;p<d;p++)v=K[p],q.push(v);for(y=0,w=u.length;y<w;y++)h=u[y],r=t.getAggregator(K,h),null!=r.value()?q.push(r.value()):q.push("");m.push(q)}for(C="",j=0,x=m.length;j<x;j++)v=m[j],C+=v.join("\t")+"\n";return e("<textarea>").text(C).css({width:e(window).width()/2+"px",height:e(window).height()/2+"px"})}}})}).call(this); //# sourceMappingURL=export_renderers.min.js.map