pivottable
Advanced tools
Comparing version 1.4.1 to 1.4.2
{ | ||
"name": "pivottable", | ||
"description": "Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"main": [ | ||
@@ -6,0 +6,0 @@ "dist/pivot.js", |
@@ -21,3 +21,3 @@ (function() { | ||
return function(pivotData, opts) { | ||
var agg, colKey, colKeys, columns, dataArray, datum, defaults, fullAggName, h, hAxisTitle, headers, i, j, len, len1, params, ref, renderArea, result, row, rowHeader, rowKey, rowKeys, tree2, vAxisTitle, x, y; | ||
var agg, colKey, colKeys, columns, dataArray, datum, defaults, fullAggName, h, hAxisTitle, headers, i, j, len, len1, params, ref, renderArea, result, row, rowHeader, rowKey, rowKeys, tree2, vAxisTitle, val, x, y; | ||
defaults = { | ||
@@ -88,3 +88,12 @@ localeStrings: { | ||
if (agg.value() != null) { | ||
row.push(agg.value()); | ||
val = agg.value(); | ||
if ($.isNumeric(val)) { | ||
if (val < 0) { | ||
row.push(parseFloat(val.toPrecision(3))); | ||
} else { | ||
row.push(parseFloat(val.toFixed(3))); | ||
} | ||
} else { | ||
row.push(val); | ||
} | ||
} else { | ||
@@ -91,0 +100,0 @@ row.push(null); |
@@ -1,2 +0,2 @@ | ||
(function(){var t;(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 e;return e=function(e){return null==e&&(e={}),function(r,n){var a,o,i,l,u,s,c,p,h,g,d,f,y,v,j,w,x,b,m,A,k,C,q,N,S,B,F;if(c={localeStrings:{vs:"vs",by:"by"},c3:{width:function(){return t(window).width()/1.4},height:function(){return t(window).height()/1.4}}},n=t.extend(c,n),null==e.type&&(e.type="line"),q=r.getRowKeys(),0===q.length&&q.push([]),i=r.getColKeys(),0===i.length&&i.push([]),d=function(){var t,e,r;for(r=[],t=0,e=i.length;e>t;t++)h=i[t],r.push(h.join("-"));return r}(),p=r.aggregatorName,r.valAttrs.length&&(p+="("+r.valAttrs.join(", ")+")"),"scatter"===e.type){u=[],g=r.colAttrs.join("-"),S=r.rowAttrs.join("-"),x=r.tree;for(F in x){N=x[F];for(B in N)a=N[B],s={},s[g]=parseFloat(B),s[S]=parseFloat(F),s.tooltip=a.format(a.value()),u.push(s)}}else{for(l=[],f=0,v=q.length;v>f;f++){for(C=q[f],k=C.join("-"),A=[""===k?r.aggregatorName:k],y=0,j=i.length;j>y;y++)o=i[y],a=r.getAggregator(C,o),A.push(null!=a.value()?a.value():null);l.push(A)}S=r.aggregatorName+(r.valAttrs.length?"("+r.valAttrs.join(", ")+")":""),g=r.colAttrs.join("-")}return w={size:{height:n.c3.height(),width:n.c3.width()},axis:{y:{label:S},x:{label:g}},data:{type:e.type},tooltip:{grouped:!1}},"scatter"===e.type?(w.data.x=g,w.axis.x.tick={fit:!1},w.data.json=u,w.data.keys={value:[g,S]},w.legend={show:!1},w.tooltip.format={title:function(){return p},name:function(){return""},value:function(t,e,r,n){return u[n].tooltip}}):(w.axis.x.type="category",w.axis.x.categories=d,w.data.columns=l),null!=e.stacked&&(w.data.groups=[function(){var t,e,r;for(r=[],t=0,e=q.length;e>t;t++)B=q[t],r.push(B.join("-"));return r}()]),b=t("<div>",{style:"display:none;"}).appendTo(t("body")),m=t("<div>").appendTo(b),w.bindto=m[0],c3.generate(w),m.detach(),b.remove(),m}},t.pivotUtilities.c3_renderers={"Line Chart":e(),"Bar Chart":e({type:"bar"}),"Stacked Bar Chart":e({type:"bar",stacked:!0}),"Area Chart":e({type:"area",stacked:!0}),"Scatter Chart":e({type:"scatter"})}})}).call(this); | ||
(function(){var t;(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 e;return e=function(e){return null==e&&(e={}),function(r,a){var n,o,i,l,u,s,c,p,h,d,g,f,y,v,j,x,m,w,b,A,k,C,F,N,q,S,B,K;if(c={localeStrings:{vs:"vs",by:"by"},c3:{width:function(){return t(window).width()/1.4},height:function(){return t(window).height()/1.4}}},a=t.extend(c,a),null==e.type&&(e.type="line"),F=r.getRowKeys(),0===F.length&&F.push([]),i=r.getColKeys(),0===i.length&&i.push([]),g=function(){var t,e,r;for(r=[],t=0,e=i.length;e>t;t++)h=i[t],r.push(h.join("-"));return r}(),p=r.aggregatorName,r.valAttrs.length&&(p+="("+r.valAttrs.join(", ")+")"),"scatter"===e.type){u=[],d=r.colAttrs.join("-"),q=r.rowAttrs.join("-"),m=r.tree;for(K in m){N=m[K];for(B in N)n=N[B],s={},s[d]=parseFloat(B),s[q]=parseFloat(K),s.tooltip=n.format(n.value()),u.push(s)}}else{for(l=[],f=0,v=F.length;v>f;f++){for(C=F[f],k=C.join("-"),A=[""===k?r.aggregatorName:k],y=0,j=i.length;j>y;y++)o=i[y],n=r.getAggregator(C,o),null!=n.value()?(S=n.value(),A.push(t.isNumeric(S)?0>S?parseFloat(S.toPrecision(3)):parseFloat(S.toFixed(3)):S)):A.push(null);l.push(A)}q=r.aggregatorName+(r.valAttrs.length?"("+r.valAttrs.join(", ")+")":""),d=r.colAttrs.join("-")}return x={size:{height:a.c3.height(),width:a.c3.width()},axis:{y:{label:q},x:{label:d}},data:{type:e.type},tooltip:{grouped:!1}},"scatter"===e.type?(x.data.x=d,x.axis.x.tick={fit:!1},x.data.json=u,x.data.keys={value:[d,q]},x.legend={show:!1},x.tooltip.format={title:function(){return p},name:function(){return""},value:function(t,e,r,a){return u[a].tooltip}}):(x.axis.x.type="category",x.axis.x.categories=g,x.data.columns=l),null!=e.stacked&&(x.data.groups=[function(){var t,e,r;for(r=[],t=0,e=F.length;e>t;t++)B=F[t],r.push(B.join("-"));return r}()]),w=t("<div>",{style:"display:none;"}).appendTo(t("body")),b=t("<div>").appendTo(w),x.bindto=b[0],c3.generate(x),b.detach(),w.remove(),b}},t.pivotUtilities.c3_renderers={"Line Chart":e(),"Bar Chart":e({type:"bar"}),"Stacked Bar Chart":e({type:"bar",stacked:!0}),"Area Chart":e({type:"area",stacked:!0}),"Scatter Chart":e({type:"scatter"})}})}).call(this); | ||
//# sourceMappingURL=c3_renderers.min.js.map |
@@ -18,3 +18,3 @@ (function() { | ||
return function(pivotData, opts) { | ||
var agg, colKey, colKeys, dataArray, dataTable, defaults, fullAggName, groupByTitle, h, hAxisTitle, headers, i, j, k, len, len1, numCharsInHAxis, options, ref, result, row, rowKey, rowKeys, title, tree2, v, vAxisTitle, wrapper, x, y; | ||
var agg, colKey, colKeys, dataArray, dataTable, defaults, fullAggName, groupByTitle, h, hAxisTitle, headers, i, j, k, len, len1, numCharsInHAxis, options, ref, result, row, rowKey, rowKeys, title, tree2, v, vAxisTitle, val, wrapper, x, y; | ||
defaults = { | ||
@@ -89,3 +89,12 @@ localeStrings: { | ||
if (agg.value() != null) { | ||
row.push(agg.value()); | ||
val = agg.value(); | ||
if ($.isNumeric(val)) { | ||
if (val < 0) { | ||
row.push(parseFloat(val.toPrecision(3))); | ||
} else { | ||
row.push(parseFloat(val.toFixed(3))); | ||
} | ||
} else { | ||
row.push(val); | ||
} | ||
} else { | ||
@@ -92,0 +101,0 @@ row.push(null); |
@@ -1,2 +0,2 @@ | ||
(function(){var t;(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 e;return e=function(e,r){return function(n,o){var a,i,l,h,u,s,g,d,c,f,p,v,C,w,A,y,j,m,b,S,x,z,T,k,q,D,L,B,F,K;if(s={localeStrings:{vs:"vs",by:"by"},gchart:{width:function(){return t(window).width()/1.4},height:function(){return t(window).height()/1.4}}},o=t.extend(s,o),T=n.getRowKeys(),0===T.length&&T.push([]),l=n.getColKeys(),0===l.length&&l.push([]),g=n.aggregatorName,n.valAttrs.length&&(g+="("+n.valAttrs.join(", ")+")"),p=function(){var t,e,r;for(r=[],t=0,e=T.length;e>t;t++)c=T[t],r.push(c.join("-"));return r}(),p.unshift(""),j=0,"ScatterChart"===e){h=[],b=n.tree;for(K in b){q=b[K];for(F in q)a=q[F],h.push([parseFloat(F),parseFloat(K),g+": \n"+a.format(a.value())])}u=new google.visualization.DataTable,u.addColumn("number",n.colAttrs.join("-")),u.addColumn("number",n.rowAttrs.join("-")),u.addColumn({type:"string",role:"tooltip"}),u.addRows(h),f=n.colAttrs.join("-"),L=n.rowAttrs.join("-"),k=""}else{for(h=[p],v=0,A=l.length;A>v;v++){for(i=l[v],x=[i.join("-")],j+=x[0].length,C=0,y=T.length;y>C;C++)z=T[C],a=n.getAggregator(z,i),x.push(null!=a.value()?a.value():null);h.push(x)}u=google.visualization.arrayToDataTable(h),k=L=g,f=n.colAttrs.join("-"),""!==f&&(k+=" "+o.localeStrings.vs+" "+f),d=n.rowAttrs.join("-"),""!==d&&(k+=" "+o.localeStrings.by+" "+d)}m={width:o.gchart.width(),height:o.gchart.height(),title:k,hAxis:{title:f,slantedText:j>50},vAxis:{title:L},tooltip:{textStyle:{fontName:"Arial",fontSize:12}}},"ColumnChart"===e&&(m.vAxis.minValue=0),"ScatterChart"===e?(m.legend={position:"none"},m.chartArea={width:"80%",height:"80%"}):2===h[0].length&&""===h[0][1]&&(m.legend={position:"none"});for(w in r)D=r[w],m[w]=D;return S=t("<div>").css({width:"100%",height:"100%"}),B=new google.visualization.ChartWrapper({dataTable:u,chartType:e,options:m}),B.draw(S[0]),S.bind("dblclick",function(){var t;return t=new google.visualization.ChartEditor,google.visualization.events.addListener(t,"ok",function(){return t.getChartWrapper().draw(S[0])}),t.openDialog(B)}),S}},t.pivotUtilities.gchart_renderers={"Line Chart":e("LineChart"),"Bar Chart":e("ColumnChart"),"Stacked Bar Chart":e("ColumnChart",{isStacked:!0}),"Area Chart":e("AreaChart",{isStacked:!0}),"Scatter Chart":e("ScatterChart")}})}).call(this); | ||
(function(){var t;(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 e;return e=function(e,r){return function(n,o){var i,a,l,h,s,u,g,d,c,f,p,v,C,w,A,m,y,j,b,S,x,z,T,k,F,q,D,L,N,B,K;if(u={localeStrings:{vs:"vs",by:"by"},gchart:{width:function(){return t(window).width()/1.4},height:function(){return t(window).height()/1.4}}},o=t.extend(u,o),T=n.getRowKeys(),0===T.length&&T.push([]),l=n.getColKeys(),0===l.length&&l.push([]),g=n.aggregatorName,n.valAttrs.length&&(g+="("+n.valAttrs.join(", ")+")"),p=function(){var t,e,r;for(r=[],t=0,e=T.length;e>t;t++)c=T[t],r.push(c.join("-"));return r}(),p.unshift(""),y=0,"ScatterChart"===e){h=[],b=n.tree;for(K in b){F=b[K];for(B in F)i=F[B],h.push([parseFloat(B),parseFloat(K),g+": \n"+i.format(i.value())])}s=new google.visualization.DataTable,s.addColumn("number",n.colAttrs.join("-")),s.addColumn("number",n.rowAttrs.join("-")),s.addColumn({type:"string",role:"tooltip"}),s.addRows(h),f=n.colAttrs.join("-"),D=n.rowAttrs.join("-"),k=""}else{for(h=[p],v=0,A=l.length;A>v;v++){for(a=l[v],x=[a.join("-")],y+=x[0].length,C=0,m=T.length;m>C;C++)z=T[C],i=n.getAggregator(z,a),null!=i.value()?(L=i.value(),x.push(t.isNumeric(L)?0>L?parseFloat(L.toPrecision(3)):parseFloat(L.toFixed(3)):L)):x.push(null);h.push(x)}s=google.visualization.arrayToDataTable(h),k=D=g,f=n.colAttrs.join("-"),""!==f&&(k+=" "+o.localeStrings.vs+" "+f),d=n.rowAttrs.join("-"),""!==d&&(k+=" "+o.localeStrings.by+" "+d)}j={width:o.gchart.width(),height:o.gchart.height(),title:k,hAxis:{title:f,slantedText:y>50},vAxis:{title:D},tooltip:{textStyle:{fontName:"Arial",fontSize:12}}},"ColumnChart"===e&&(j.vAxis.minValue=0),"ScatterChart"===e?(j.legend={position:"none"},j.chartArea={width:"80%",height:"80%"}):2===h[0].length&&""===h[0][1]&&(j.legend={position:"none"});for(w in r)q=r[w],j[w]=q;return S=t("<div>").css({width:"100%",height:"100%"}),N=new google.visualization.ChartWrapper({dataTable:s,chartType:e,options:j}),N.draw(S[0]),S.bind("dblclick",function(){var t;return t=new google.visualization.ChartEditor,google.visualization.events.addListener(t,"ok",function(){return t.getChartWrapper().draw(S[0])}),t.openDialog(N)}),S}},t.pivotUtilities.gchart_renderers={"Line Chart":e("LineChart"),"Bar Chart":e("ColumnChart"),"Stacked Bar Chart":e("ColumnChart",{isStacked:!0}),"Area Chart":e("AreaChart",{isStacked:!0}),"Scatter Chart":e("ScatterChart")}})}).call(this); | ||
//# sourceMappingURL=gchart_renderers.min.js.map |
{ | ||
"name": "pivottable", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop", | ||
@@ -5,0 +5,0 @@ "main": "dist/pivot.js", |
@@ -14,3 +14,3 @@ { | ||
], | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"author": { | ||
@@ -17,0 +17,0 @@ "name": "Nicolas Kruchten", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
630830
2862