From c54a876d8de7d4efaecc1e30f51f8af3ed8bde3a Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Wed, 20 Sep 2017 17:36:49 -0400 Subject: [PATCH] compiling recent changes --- dist/c3_renderers.min.js.map | 2 +- dist/pivot.js | 80 +++++++++++++++++++++++++++--------- dist/pivot.js.map | 2 +- dist/pivot.min.js | 2 +- dist/pivot.min.js.map | 2 +- 5 files changed, 65 insertions(+), 23 deletions(-) diff --git a/dist/c3_renderers.min.js.map b/dist/c3_renderers.min.js.map index dd487af2..af15192d 100644 --- a/dist/c3_renderers.min.js.map +++ b/dist/c3_renderers.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["/source/c3_renderers.coffee","c3_renderers.min.js"],"names":["callWithJQuery","pivotModule","exports","module","require","define","amd","jQuery","c3","$","makeC3Chart","chartOpts","pivotData","opts","agg","attrs","base","base1","base2","base3","base4","base5","base6","c","categories","colKey","colKeys","columns","dataColumns","defaults","formatter","fullAggName","groupByTitle","h","hAxisTitle","headers","i","j","k","l","len","len1","len2","len3","len4","m","numCharsInHAxis","numSeries","params","ref","ref1","ref2","ref3","renderArea","result","rotationAngle","row","rowHeader","rowKey","rowKeys","s","scatterData","series","title","titleText","vAxisTitle","val","vals","x","xs","localeStrings","vs","by","extend","size","width","window","innerWidth","height","innerHeight","type","horizontal","stacked","getRowKeys","length","push","getColKeys","results","join","aggregatorName","valAttrs","y","t","rowAttrs","concat","colAttrs","slice","getAggregator","value","parseFloat","isFinite","style","text","format","axis","rotated","label","tick","rotate","multiline","data","order","tooltip","grouped","color","pattern","fit","legend","show","name","a","b","d","v","len5","n","shift","unshift","rows","groups","appendTo","bindto","generate","detach","remove","append","pivotUtilities","c3_renderers","Horizontal Bar Chart","Horizontal Stacked Bar Chart","Bar Chart","Stacked Bar Chart","Line Chart","Area Chart","Scatter Chart","call","this"],"mappings":"CAAA,WAAA,GAAAA,IAAAA,EAAiB,SAACC,GACd,MAAqB,gBAAlBC,UAAgD,gBAAjBC,QAC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AAY,IAC7D0D,+BAAgCjI,GAAYsE,KAAM,MAAOE,SAAS,EAAMD,YAAY,IACpF2D,YAAalI,GAAYsE,KAAM,QAC/B6D,oBAAqBnI,GAAYsE,KAAM,MAAOE,SAAS,IACvD4D,aAAcpI,IACdqI,aAAcrI,GAAYsE,KAAM,OAAQE,SAAS,IACjD8D,gBAAiBtI,GAAYsE,KAAM,iBC6IxCiE,KAAKC","file":"c3_renderers.min.js","sourcesContent":["callWithJQuery = (pivotModule) ->\n if typeof exports is \"object\" and typeof module is \"object\" # CommonJS\n pivotModule require(\"jquery\"), require(\"c3\")\n else if typeof define is \"function\" and define.amd # AMD\n define [\"jquery\", \"c3\"], pivotModule\n # Plain browser env\n else\n pivotModule jQuery, c3\n\ncallWithJQuery ($, c3) ->\n\n makeC3Chart = (chartOpts = {}) -> (pivotData, opts) ->\n defaults =\n localeStrings: {vs: \"vs\", by: \"by\"}\n c3: {}\n\n opts = $.extend(true, {}, defaults, opts)\n opts.c3.size ?= {}\n opts.c3.size.width ?= window.innerWidth / 1.4\n opts.c3.size.height ?= window.innerHeight / 1.4 - 50\n chartOpts.type ?= \"line\"\n chartOpts.horizontal ?= false\n chartOpts.stacked ?= false\n\n rowKeys = pivotData.getRowKeys()\n rowKeys.push [] if rowKeys.length == 0\n colKeys = pivotData.getColKeys()\n colKeys.push [] if colKeys.length == 0\n\n headers = (h.join(\"-\") for h in colKeys)\n rotationAngle = 0\n\n fullAggName = pivotData.aggregatorName\n if pivotData.valAttrs.length\n fullAggName += \"(#{pivotData.valAttrs.join(\", \")})\"\n\n if chartOpts.type == \"scatter\"\n scatterData = x:{}, y:{}, t:{}\n attrs = pivotData.rowAttrs.concat(pivotData.colAttrs)\n vAxisTitle = attrs[0] ? \"\"\n hAxisTitle = attrs[1] ? \"\"\n groupByTitle = attrs.slice(2).join(\"-\")\n titleText = vAxisTitle\n titleText += \" #{opts.localeStrings.vs} #{hAxisTitle}\" if hAxisTitle != \"\"\n titleText += \" #{opts.localeStrings.by} #{groupByTitle}\" if groupByTitle != \"\"\n for rowKey in rowKeys\n for colKey in colKeys\n agg = pivotData.getAggregator(rowKey, colKey)\n if agg.value()?\n vals = rowKey.concat(colKey)\n series = vals.slice(2).join(\"-\")\n if series == \"\" then series = \"series\"\n scatterData.x[series] ?= []\n scatterData.y[series] ?= []\n scatterData.t[series] ?= []\n scatterData.y[series].push vals[0] ? 0\n scatterData.x[series].push vals[1] ? 0\n scatterData.t[series].push agg.value()\n else\n numCharsInHAxis = 0\n for x in headers\n numCharsInHAxis += x.length\n if numCharsInHAxis > 50\n rotationAngle = 45\n\n columns = []\n for rowKey in rowKeys\n rowHeader = rowKey.join(\"-\")\n row = [if rowHeader == \"\" then fullAggName else rowHeader]\n for colKey in colKeys\n val = parseFloat pivotData.getAggregator(rowKey, colKey).value()\n if isFinite(val)\n row.push(val)\n else\n row.push(null)\n columns.push row\n\n vAxisTitle = fullAggName\n\n if chartOpts.horizontal\n hAxisTitle = pivotData.rowAttrs.join(\"-\")\n groupByTitle = pivotData.colAttrs.join(\"-\")\n else\n hAxisTitle = pivotData.colAttrs.join(\"-\")\n groupByTitle = pivotData.rowAttrs.join(\"-\")\n titleText = fullAggName\n titleText += \" #{opts.localeStrings.vs} #{hAxisTitle}\" if hAxisTitle != \"\"\n titleText += \" #{opts.localeStrings.by} #{groupByTitle}\" if groupByTitle != \"\"\n\n title = $(\"

\", {style: \"text-align: center; font-weight: bold\"})\n title.text(titleText)\n\n formatter = pivotData.getAggregator([], []).format\n\n params =\n axis:\n rotated: chartOpts.horizontal\n y:\n label: vAxisTitle\n tick: {}\n x:\n label: hAxisTitle\n tick:\n rotate: rotationAngle\n multiline: false\n data:\n type: chartOpts.type\n order: null\n tooltip:\n grouped: false\n color:\n pattern: [ \"#3366cc\", \"#dc3912\", \"#ff9900\", \"#109618\",\n \"#990099\", \"#0099c6\", \"#dd4477\", \"#66aa00\",\n \"#b82e2e\", \"#316395\", \"#994499\", \"#22aa99\",\n \"#aaaa11\", \"#6633cc\", \"#e67300\", \"#8b0707\",\n \"#651067\", \"#329262\", \"#5574a6\", \"#3b3eac\" ]\n\n\n params = $.extend(true, {}, params, opts.c3)\n if chartOpts.type == \"scatter\"\n xs = {}\n numSeries = 0\n dataColumns = []\n for s of scatterData.x\n numSeries += 1\n xs[s] = s+\"_x\"\n dataColumns.push [s+\"_x\"].concat(scatterData.x[s])\n dataColumns.push [s].concat(scatterData.y[s])\n params.data.xs = xs\n params.data.columns = dataColumns\n params.axis.x.tick = fit: false\n if numSeries == 1\n params.legend = show: false\n params.tooltip.format =\n title: -> fullAggName\n name: -> \"\"\n value: (a,b,c,d) -> formatter(scatterData.t[c][d])\n else\n params.axis.x.type= 'category'\n params.axis.y.tick.format ?= (v) -> formatter(v)\n params.tooltip.format = value: (v) -> formatter(v)\n\n if chartOpts.horizontal\n categories = (c.shift() for c in columns)\n if categories.length == 1 and categories[0] == fullAggName\n categories = [\"\"]\n params.axis.x.categories = categories\n if headers.length == 1 and headers[0] == \"\"\n headers = [fullAggName]\n columns.unshift(headers)\n params.data.rows = columns\n else\n params.axis.x.categories = headers\n params.data.columns = columns\n\n\n if chartOpts.stacked\n if chartOpts.horizontal\n params.data.groups = [x.join(\"-\") for x in colKeys]\n else\n params.data.groups = [x.join(\"-\") for x in rowKeys]\n\n renderArea = $(\"

\", style: \"display:none;\").appendTo $(\"body\")\n result = $(\"
\").appendTo renderArea\n params.bindto = result[0]\n c3.generate params\n result.detach()\n renderArea.remove()\n return $(\"
\").append title, result\n\n $.pivotUtilities.c3_renderers =\n \"Horizontal Bar Chart\": makeC3Chart(type: \"bar\", horizontal: true)\n \"Horizontal Stacked Bar Chart\": makeC3Chart(type: \"bar\", stacked: true, horizontal: true)\n \"Bar Chart\": makeC3Chart(type: \"bar\")\n \"Stacked Bar Chart\": makeC3Chart(type: \"bar\", stacked: true)\n \"Line Chart\": makeC3Chart()\n \"Area Chart\": makeC3Chart(type: \"area\", stacked: true)\n \"Scatter Chart\": makeC3Chart(type: \"scatter\")\n","(function(){var t;(t=function(t){return\"object\"==typeof exports&&\"object\"==typeof module?t(require(\"jquery\"),require(\"c3\")):\"function\"==typeof define&&define.amd?define([\"jquery\",\"c3\"],t):t(jQuery,c3)})(function(t,e){var n;return n=function(n){return null==n&&(n={}),function(r,a){var o,l,i,c,s,u,h,g,p,d,f,y,x,v,b,j,z,m,w,k,A,C,S,q,B,H,_,F,K,T,L,N,Q,R,U,W,D,E,G,I,J,M,O,P,V,X,Y,Z,$,tt,et,nt,rt,at,ot,lt;if(j={localeStrings:{vs:\"vs\",by:\"by\"},c3:{}},a=t.extend(!0,{},j,a),null==(i=a.c3).size&&(i.size={}),null==(c=a.c3.size).width&&(c.width=window.innerWidth/1.4),null==(s=a.c3.size).height&&(s.height=window.innerHeight/1.4-50),null==n.type&&(n.type=\"line\"),null==n.horizontal&&(n.horizontal=!1),null==n.stacked&&(n.stacked=!1),X=r.getRowKeys(),0===X.length&&X.push([]),x=r.getColKeys(),0===x.length&&x.push([]),C=function(){var t,e,n;for(n=[],t=0,e=x.length;e>t;t++)k=x[t],n.push(k.join(\"-\"));return n}(),M=0,m=r.aggregatorName,r.valAttrs.length&&(m+=\"(\"+r.valAttrs.join(\", \")+\")\"),\"scatter\"===n.type)for(Z={x:{},y:{},t:{}},l=r.rowAttrs.concat(r.colAttrs),nt=null!=(W=l[0])?W:\"\",A=null!=(D=l[1])?D:\"\",w=l.slice(2).join(\"-\"),et=nt,\"\"!==A&&(et+=\" \"+a.localeStrings.vs+\" \"+A),\"\"!==w&&(et+=\" \"+a.localeStrings.by+\" \"+w),S=0,_=X.length;_>S;S++)for(V=X[S],q=0,F=x.length;F>q;q++)y=x[q],o=r.getAggregator(V,y),null!=o.value()&&(at=V.concat(y),$=at.slice(2).join(\"-\"),\"\"===$&&($=\"series\"),null==(u=Z.x)[$]&&(u[$]=[]),null==(h=Z.y)[$]&&(h[$]=[]),null==(g=Z.t)[$]&&(g[$]=[]),Z.y[$].push(null!=(E=at[0])?E:0),Z.x[$].push(null!=(G=at[1])?G:0),Z.t[$].push(o.value()));else{for(Q=0,B=0,K=C.length;K>B;B++)ot=C[B],Q+=ot.length;for(Q>50&&(M=45),v=[],H=0,T=X.length;T>H;H++){for(V=X[H],P=V.join(\"-\"),O=[\"\"===P?m:P],N=0,L=x.length;L>N;N++)y=x[N],rt=parseFloat(r.getAggregator(V,y).value()),O.push(isFinite(rt)?rt:null);v.push(O)}nt=m,n.horizontal?(A=r.rowAttrs.join(\"-\"),w=r.colAttrs.join(\"-\")):(A=r.colAttrs.join(\"-\"),w=r.rowAttrs.join(\"-\")),et=m,\"\"!==A&&(et+=\" \"+a.localeStrings.vs+\" \"+A),\"\"!==w&&(et+=\" \"+a.localeStrings.by+\" \"+w)}if(tt=t(\"

\",{style:\"text-align: center; font-weight: bold\"}),tt.text(et),z=r.getAggregator([],[]).format,U={axis:{rotated:n.horizontal,y:{label:nt,tick:{}},x:{label:A,tick:{rotate:M,multiline:!1}}},data:{type:n.type,order:null},tooltip:{grouped:!1},color:{pattern:[\"#3366cc\",\"#dc3912\",\"#ff9900\",\"#109618\",\"#990099\",\"#0099c6\",\"#dd4477\",\"#66aa00\",\"#b82e2e\",\"#316395\",\"#994499\",\"#22aa99\",\"#aaaa11\",\"#6633cc\",\"#e67300\",\"#8b0707\",\"#651067\",\"#329262\",\"#5574a6\",\"#3b3eac\"]}},U=t.extend(!0,{},U,a.c3),\"scatter\"===n.type){lt={},R=0,b=[];for(Y in Z.x)R+=1,lt[Y]=Y+\"_x\",b.push([Y+\"_x\"].concat(Z.x[Y])),b.push([Y].concat(Z.y[Y]));U.data.xs=lt,U.data.columns=b,U.axis.x.tick={fit:!1},1===R&&(U.legend={show:!1}),U.tooltip.format={title:function(){return m},name:function(){return\"\"},value:function(t,e,n,r){return z(Z.t[n][r])}}}else U.axis.x.type=\"category\",null==(p=U.axis.y.tick).format&&(p.format=function(t){return z(t,!0)}),U.tooltip.format={value:function(t){return z(t)}},n.horizontal?(f=function(){var t,e,n;for(n=[],e=0,t=v.length;t>e;e++)d=v[e],n.push(d.shift());return n}(),1===f.length&&f[0]===m&&(f=[\"\"]),U.axis.x.categories=f,1===C.length&&\"\"===C[0]&&(C=[m]),v.unshift(C),U.data.rows=v):(U.axis.x.categories=C,U.data.columns=v);return n.stacked&&(U.data.groups=n.horizontal?[function(){var t,e,n;for(n=[],e=0,t=x.length;t>e;e++)ot=x[e],n.push(ot.join(\"-\"));return n}()]:[function(){var t,e,n;for(n=[],e=0,t=X.length;t>e;e++)ot=X[e],n.push(ot.join(\"-\"));return n}()]),I=t(\"

\",{style:\"display:none;\"}).appendTo(t(\"body\")),J=t(\"
\").appendTo(I),U.bindto=J[0],e.generate(U),J.detach(),I.remove(),t(\"
\").append(tt,J)}},t.pivotUtilities.c3_renderers={\"Horizontal Bar Chart\":n({type:\"bar\",horizontal:!0}),\"Horizontal Stacked Bar Chart\":n({type:\"bar\",stacked:!0,horizontal:!0}),\"Bar Chart\":n({type:\"bar\"}),\"Stacked Bar Chart\":n({type:\"bar\",stacked:!0}),\"Line Chart\":n(),\"Area Chart\":n({type:\"area\",stacked:!0}),\"Scatter Chart\":n({type:\"scatter\"})}})}).call(this);\n//# sourceMappingURL=c3_renderers.min.js.map"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["/source/c3_renderers.coffee","c3_renderers.min.js"],"names":["callWithJQuery","pivotModule","exports","module","require","define","amd","jQuery","c3","$","makeC3Chart","chartOpts","pivotData","opts","agg","attrs","base","base1","base2","base3","base4","base5","base6","c","categories","colKey","colKeys","columns","dataColumns","defaults","formatter","fullAggName","groupByTitle","h","hAxisTitle","headers","i","j","k","l","len","len1","len2","len3","len4","m","numCharsInHAxis","numSeries","params","ref","ref1","ref2","ref3","renderArea","result","rotationAngle","row","rowHeader","rowKey","rowKeys","s","scatterData","series","title","titleText","vAxisTitle","val","vals","x","xs","localeStrings","vs","by","extend","size","width","window","innerWidth","height","innerHeight","type","horizontal","stacked","getRowKeys","length","push","getColKeys","results","join","aggregatorName","valAttrs","y","t","rowAttrs","concat","colAttrs","slice","getAggregator","value","parseFloat","isFinite","style","text","format","axis","rotated","label","tick","rotate","multiline","data","order","tooltip","grouped","color","pattern","fit","legend","show","name","a","b","d","v","len5","n","shift","unshift","rows","groups","appendTo","bindto","generate","detach","remove","append","pivotUtilities","c3_renderers","Horizontal Bar Chart","Horizontal Stacked Bar Chart","Bar Chart","Stacked Bar Chart","Line Chart","Area Chart","Scatter Chart","call","this"],"mappings":"CAAA,WAAA,GAAAA,IAAAA,EAAiB,SAACC,GACd,MAAqB,gBAAlBC,UAAgD,gBAAjBC,QAC9BF,EAAYG,QAAQ,UAAWA,QAAQ,OAClB,kBAAjBC,SAAgCA,OAAOC,IAC3CD,QAAQ,SAAU,MAAOJ,GAGzBA,EAAYM,OAAQC,MAEb,SAACC,EAAGD,GAEf,GAAAE,ECuRA,ODvRAA,GAAc,SAACC,GCQb,MAHiB,OAAbA,IDLSA,MAAmB,SAACC,EAAWC,GAC1C,GAAAC,GAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,EAwBA,IAxBAxC,GACIyC,eAAgBC,GAAI,KAAMC,GAAI,MAC9BhE,OAEJK,EAAOJ,EAAEgE,QAAO,KAAU5C,EAAUhB,GCaP,OAAxBG,EAAOH,EAAKL,IAAIkE,OACnB1D,EDbM0D,SCe4B,OAA/BzD,EAAQJ,EAAKL,GAAGkE,MAAMC,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AAC,EAAAA,IC+GpBzD,GAAIT,EAAQkE,GD/GQtC,EAAAF,KAAAjB,GAAEoB,KAAK,KCkH7B,OAAOD,QDhHflC,EAAa5C,EAAE,SAAS4F,MAAO,kBAAiB6B,SAASzH,EAAE,SAC3D6C,EAAS7C,EAAE,SAASyH,SAAS7E,GAC7BL,EAAOmF,OAAS7E,EAAO,GACvB9C,EAAG4H,SAASpF,GACZM,EAAO+E,SACPhF,EAAWiF,SACJ7H,EAAE,SAAS8H,OAAOxE,GAAOT,KAEpC7C,EAAE+H,eAAeC,cACbC,uBAAwBhI,GAAYsE,KAAM,MAAOC,YAAY,IAC7D0D,+BAAgCjI,GAAYsE,KAAM,MAAOE,SAAS,EAAMD,YAAY,IACpF2D,YAAalI,GAAYsE,KAAM,QAC/B6D,oBAAqBnI,GAAYsE,KAAM,MAAOE,SAAS,IACvD4D,aAAcpI,IACdqI,aAAcrI,GAAYsE,KAAM,OAAQE,SAAS,IACjD8D,gBAAiBtI,GAAYsE,KAAM,iBC6IxCiE,KAAKC","file":"c3_renderers.min.js","sourcesContent":["callWithJQuery = (pivotModule) ->\n if typeof exports is \"object\" and typeof module is \"object\" # CommonJS\n pivotModule require(\"jquery\"), require(\"c3\")\n else if typeof define is \"function\" and define.amd # AMD\n define [\"jquery\", \"c3\"], pivotModule\n # Plain browser env\n else\n pivotModule jQuery, c3\n\ncallWithJQuery ($, c3) ->\n\n makeC3Chart = (chartOpts = {}) -> (pivotData, opts) ->\n defaults =\n localeStrings: {vs: \"vs\", by: \"by\"}\n c3: {}\n\n opts = $.extend(true, {}, defaults, opts)\n opts.c3.size ?= {}\n opts.c3.size.width ?= window.innerWidth / 1.4\n opts.c3.size.height ?= window.innerHeight / 1.4 - 50\n chartOpts.type ?= \"line\"\n chartOpts.horizontal ?= false\n chartOpts.stacked ?= false\n\n rowKeys = pivotData.getRowKeys()\n rowKeys.push [] if rowKeys.length == 0\n colKeys = pivotData.getColKeys()\n colKeys.push [] if colKeys.length == 0\n\n headers = (h.join(\"-\") for h in colKeys)\n rotationAngle = 0\n\n fullAggName = pivotData.aggregatorName\n if pivotData.valAttrs.length\n fullAggName += \"(#{pivotData.valAttrs.join(\", \")})\"\n\n if chartOpts.type == \"scatter\"\n scatterData = x:{}, y:{}, t:{}\n attrs = pivotData.rowAttrs.concat(pivotData.colAttrs)\n vAxisTitle = attrs[0] ? \"\"\n hAxisTitle = attrs[1] ? \"\"\n groupByTitle = attrs.slice(2).join(\"-\")\n titleText = vAxisTitle\n titleText += \" #{opts.localeStrings.vs} #{hAxisTitle}\" if hAxisTitle != \"\"\n titleText += \" #{opts.localeStrings.by} #{groupByTitle}\" if groupByTitle != \"\"\n for rowKey in rowKeys\n for colKey in colKeys\n agg = pivotData.getAggregator(rowKey, colKey)\n if agg.value()?\n vals = rowKey.concat(colKey)\n series = vals.slice(2).join(\"-\")\n if series == \"\" then series = \"series\"\n scatterData.x[series] ?= []\n scatterData.y[series] ?= []\n scatterData.t[series] ?= []\n scatterData.y[series].push vals[0] ? 0\n scatterData.x[series].push vals[1] ? 0\n scatterData.t[series].push agg.value()\n else\n numCharsInHAxis = 0\n for x in headers\n numCharsInHAxis += x.length\n if numCharsInHAxis > 50\n rotationAngle = 45\n\n columns = []\n for rowKey in rowKeys\n rowHeader = rowKey.join(\"-\")\n row = [if rowHeader == \"\" then fullAggName else rowHeader]\n for colKey in colKeys\n val = parseFloat pivotData.getAggregator(rowKey, colKey).value()\n if isFinite(val)\n row.push(val)\n else\n row.push(null)\n columns.push row\n\n vAxisTitle = fullAggName\n\n if chartOpts.horizontal\n hAxisTitle = pivotData.rowAttrs.join(\"-\")\n groupByTitle = pivotData.colAttrs.join(\"-\")\n else\n hAxisTitle = pivotData.colAttrs.join(\"-\")\n groupByTitle = pivotData.rowAttrs.join(\"-\")\n titleText = fullAggName\n titleText += \" #{opts.localeStrings.vs} #{hAxisTitle}\" if hAxisTitle != \"\"\n titleText += \" #{opts.localeStrings.by} #{groupByTitle}\" if groupByTitle != \"\"\n\n title = $(\"

\", {style: \"text-align: center; font-weight: bold\"})\n title.text(titleText)\n\n formatter = pivotData.getAggregator([], []).format\n\n params =\n axis:\n rotated: chartOpts.horizontal\n y:\n label: vAxisTitle\n tick: {}\n x:\n label: hAxisTitle\n tick:\n rotate: rotationAngle\n multiline: false\n data:\n type: chartOpts.type\n order: null\n tooltip:\n grouped: false\n color:\n pattern: [ \"#3366cc\", \"#dc3912\", \"#ff9900\", \"#109618\",\n \"#990099\", \"#0099c6\", \"#dd4477\", \"#66aa00\",\n \"#b82e2e\", \"#316395\", \"#994499\", \"#22aa99\",\n \"#aaaa11\", \"#6633cc\", \"#e67300\", \"#8b0707\",\n \"#651067\", \"#329262\", \"#5574a6\", \"#3b3eac\" ]\n\n\n params = $.extend(true, {}, params, opts.c3)\n if chartOpts.type == \"scatter\"\n xs = {}\n numSeries = 0\n dataColumns = []\n for s of scatterData.x\n numSeries += 1\n xs[s] = s+\"_x\"\n dataColumns.push [s+\"_x\"].concat(scatterData.x[s])\n dataColumns.push [s].concat(scatterData.y[s])\n params.data.xs = xs\n params.data.columns = dataColumns\n params.axis.x.tick = fit: false\n if numSeries == 1\n params.legend = show: false\n params.tooltip.format =\n title: -> fullAggName\n name: -> \"\"\n value: (a,b,c,d) -> formatter(scatterData.t[c][d])\n else\n params.axis.x.type= 'category'\n params.axis.y.tick.format ?= (v) -> formatter(v)\n params.tooltip.format = value: (v) -> formatter(v)\n\n if chartOpts.horizontal\n categories = (c.shift() for c in columns)\n if categories.length == 1 and categories[0] == fullAggName\n categories = [\"\"]\n params.axis.x.categories = categories\n if headers.length == 1 and headers[0] == \"\"\n headers = [fullAggName]\n columns.unshift(headers)\n params.data.rows = columns\n else\n params.axis.x.categories = headers\n params.data.columns = columns\n\n\n if chartOpts.stacked\n if chartOpts.horizontal\n params.data.groups = [x.join(\"-\") for x in colKeys]\n else\n params.data.groups = [x.join(\"-\") for x in rowKeys]\n\n renderArea = $(\"

\", style: \"display:none;\").appendTo $(\"body\")\n result = $(\"
\").appendTo renderArea\n params.bindto = result[0]\n c3.generate params\n result.detach()\n renderArea.remove()\n return $(\"
\").append title, result\n\n $.pivotUtilities.c3_renderers =\n \"Horizontal Bar Chart\": makeC3Chart(type: \"bar\", horizontal: true)\n \"Horizontal Stacked Bar Chart\": makeC3Chart(type: \"bar\", stacked: true, horizontal: true)\n \"Bar Chart\": makeC3Chart(type: \"bar\")\n \"Stacked Bar Chart\": makeC3Chart(type: \"bar\", stacked: true)\n \"Line Chart\": makeC3Chart()\n \"Area Chart\": makeC3Chart(type: \"area\", stacked: true)\n \"Scatter Chart\": makeC3Chart(type: \"scatter\")\n","(function(){var t;(t=function(t){return\"object\"==typeof exports&&\"object\"==typeof module?t(require(\"jquery\"),require(\"c3\")):\"function\"==typeof define&&define.amd?define([\"jquery\",\"c3\"],t):t(jQuery,c3)})(function(t,e){var n;return n=function(n){return null==n&&(n={}),function(r,a){var o,l,i,c,s,u,h,g,p,d,f,y,x,v,b,j,z,m,w,k,A,C,S,q,B,H,_,F,K,T,L,N,Q,R,U,W,D,E,G,I,J,M,O,P,V,X,Y,Z,$,tt,et,nt,rt,at,ot,lt;if(j={localeStrings:{vs:\"vs\",by:\"by\"},c3:{}},a=t.extend(!0,{},j,a),null==(i=a.c3).size&&(i.size={}),null==(c=a.c3.size).width&&(c.width=window.innerWidth/1.4),null==(s=a.c3.size).height&&(s.height=window.innerHeight/1.4-50),null==n.type&&(n.type=\"line\"),null==n.horizontal&&(n.horizontal=!1),null==n.stacked&&(n.stacked=!1),X=r.getRowKeys(),0===X.length&&X.push([]),x=r.getColKeys(),0===x.length&&x.push([]),C=function(){var t,e,n;for(n=[],t=0,e=x.length;e>t;t++)k=x[t],n.push(k.join(\"-\"));return n}(),M=0,m=r.aggregatorName,r.valAttrs.length&&(m+=\"(\"+r.valAttrs.join(\", \")+\")\"),\"scatter\"===n.type)for(Z={x:{},y:{},t:{}},l=r.rowAttrs.concat(r.colAttrs),nt=null!=(W=l[0])?W:\"\",A=null!=(D=l[1])?D:\"\",w=l.slice(2).join(\"-\"),et=nt,\"\"!==A&&(et+=\" \"+a.localeStrings.vs+\" \"+A),\"\"!==w&&(et+=\" \"+a.localeStrings.by+\" \"+w),S=0,_=X.length;_>S;S++)for(V=X[S],q=0,F=x.length;F>q;q++)y=x[q],o=r.getAggregator(V,y),null!=o.value()&&(at=V.concat(y),$=at.slice(2).join(\"-\"),\"\"===$&&($=\"series\"),null==(u=Z.x)[$]&&(u[$]=[]),null==(h=Z.y)[$]&&(h[$]=[]),null==(g=Z.t)[$]&&(g[$]=[]),Z.y[$].push(null!=(E=at[0])?E:0),Z.x[$].push(null!=(G=at[1])?G:0),Z.t[$].push(o.value()));else{for(Q=0,B=0,K=C.length;K>B;B++)ot=C[B],Q+=ot.length;for(Q>50&&(M=45),v=[],H=0,T=X.length;T>H;H++){for(V=X[H],P=V.join(\"-\"),O=[\"\"===P?m:P],N=0,L=x.length;L>N;N++)y=x[N],rt=parseFloat(r.getAggregator(V,y).value()),O.push(isFinite(rt)?rt:null);v.push(O)}nt=m,n.horizontal?(A=r.rowAttrs.join(\"-\"),w=r.colAttrs.join(\"-\")):(A=r.colAttrs.join(\"-\"),w=r.rowAttrs.join(\"-\")),et=m,\"\"!==A&&(et+=\" \"+a.localeStrings.vs+\" \"+A),\"\"!==w&&(et+=\" \"+a.localeStrings.by+\" \"+w)}if(tt=t(\"

\",{style:\"text-align: center; font-weight: bold\"}),tt.text(et),z=r.getAggregator([],[]).format,U={axis:{rotated:n.horizontal,y:{label:nt,tick:{}},x:{label:A,tick:{rotate:M,multiline:!1}}},data:{type:n.type,order:null},tooltip:{grouped:!1},color:{pattern:[\"#3366cc\",\"#dc3912\",\"#ff9900\",\"#109618\",\"#990099\",\"#0099c6\",\"#dd4477\",\"#66aa00\",\"#b82e2e\",\"#316395\",\"#994499\",\"#22aa99\",\"#aaaa11\",\"#6633cc\",\"#e67300\",\"#8b0707\",\"#651067\",\"#329262\",\"#5574a6\",\"#3b3eac\"]}},U=t.extend(!0,{},U,a.c3),\"scatter\"===n.type){lt={},R=0,b=[];for(Y in Z.x)R+=1,lt[Y]=Y+\"_x\",b.push([Y+\"_x\"].concat(Z.x[Y])),b.push([Y].concat(Z.y[Y]));U.data.xs=lt,U.data.columns=b,U.axis.x.tick={fit:!1},1===R&&(U.legend={show:!1}),U.tooltip.format={title:function(){return m},name:function(){return\"\"},value:function(t,e,n,r){return z(Z.t[n][r])}}}else U.axis.x.type=\"category\",null==(p=U.axis.y.tick).format&&(p.format=function(t){return z(t)}),U.tooltip.format={value:function(t){return z(t)}},n.horizontal?(f=function(){var t,e,n;for(n=[],e=0,t=v.length;t>e;e++)d=v[e],n.push(d.shift());return n}(),1===f.length&&f[0]===m&&(f=[\"\"]),U.axis.x.categories=f,1===C.length&&\"\"===C[0]&&(C=[m]),v.unshift(C),U.data.rows=v):(U.axis.x.categories=C,U.data.columns=v);return n.stacked&&(U.data.groups=n.horizontal?[function(){var t,e,n;for(n=[],e=0,t=x.length;t>e;e++)ot=x[e],n.push(ot.join(\"-\"));return n}()]:[function(){var t,e,n;for(n=[],e=0,t=X.length;t>e;e++)ot=X[e],n.push(ot.join(\"-\"));return n}()]),I=t(\"

\",{style:\"display:none;\"}).appendTo(t(\"body\")),J=t(\"
\").appendTo(I),U.bindto=J[0],e.generate(U),J.detach(),I.remove(),t(\"
\").append(tt,J)}},t.pivotUtilities.c3_renderers={\"Horizontal Bar Chart\":n({type:\"bar\",horizontal:!0}),\"Horizontal Stacked Bar Chart\":n({type:\"bar\",stacked:!0,horizontal:!0}),\"Bar Chart\":n({type:\"bar\"}),\"Stacked Bar Chart\":n({type:\"bar\",stacked:!0}),\"Line Chart\":n(),\"Area Chart\":n({type:\"area\",stacked:!0}),\"Scatter Chart\":n({type:\"scatter\"})}})}).call(this);\n//# sourceMappingURL=c3_renderers.min.js.map"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/dist/pivot.js b/dist/pivot.js index ea030b98..b5407406 100644 --- a/dist/pivot.js +++ b/dist/pivot.js @@ -1009,7 +1009,7 @@ } if (parseInt(j) === 0) { th = document.createElement("th"); - th.className = "pvtTotalLabel"; + th.className = "pvtTotalLabel pvtRowTotalLabel"; th.innerHTML = opts.localeStrings.totals; th.setAttribute("rowspan", colAttrs.length + (rowAttrs.length === 0 ? 0 : 1)); tr.appendChild(th); @@ -1028,7 +1028,7 @@ } th = document.createElement("th"); if (colAttrs.length === 0) { - th.className = "pvtTotalLabel"; + th.className = "pvtTotalLabel pvtRowTotalLabel"; th.innerHTML = opts.localeStrings.totals; } tr.appendChild(th); @@ -1084,7 +1084,7 @@ } tr = document.createElement("tr"); th = document.createElement("th"); - th.className = "pvtTotalLabel"; + th.className = "pvtTotalLabel pvtColTotalLabel"; th.innerHTML = opts.localeStrings.totals; th.setAttribute("colspan", rowAttrs.length + (colAttrs.length === 0 ? 0 : 1)); tr.appendChild(th); @@ -1185,7 +1185,7 @@ Pivot Table UI: calls Pivot Table core above with options set by user */ $.fn.pivotUI = function(input, inputOpts, overwrite, locale) { - 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; + var a, aggregator, attr, attrLength, attrValues, c, 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, shownInAggregators, shownInDragDrop, tr1, tr2, uiTable, unused, unusedAttrsVerticalAutoCutoff, unusedAttrsVerticalAutoOverride, x; if (overwrite == null) { overwrite = false; } @@ -1200,6 +1200,8 @@ aggregators: locales[locale].aggregators, renderers: locales[locale].renderers, hiddenAttributes: [], + hiddenFromAggregators: [], + hiddenFromDragDrop: [], menuLimit: 500, cols: [], rows: [], @@ -1281,6 +1283,28 @@ } return results; })(); + shownInAggregators = (function() { + var l, len1, results; + results = []; + for (l = 0, len1 = shownAttributes.length; l < len1; l++) { + c = shownAttributes[l]; + if (indexOf.call(opts.hiddenFromAggregators, c) < 0) { + results.push(c); + } + } + return results; + })(); + shownInDragDrop = (function() { + var l, len1, results; + results = []; + for (l = 0, len1 = shownAttributes.length; l < len1; l++) { + c = shownAttributes[l]; + if (indexOf.call(opts.hiddenFromDragDrop, c) < 0) { + results.push(c); + } + } + return results; + })(); unusedAttrsVerticalAutoOverride = false; if (opts.unusedAttrsVertical === "auto") { unusedAttrsVerticalAutoCutoff = 120; @@ -1289,8 +1313,8 @@ } if (!isNaN(unusedAttrsVerticalAutoCutoff)) { attrLength = 0; - for (l = 0, len1 = shownAttributes.length; l < len1; l++) { - a = shownAttributes[l]; + for (l = 0, len1 = shownInDragDrop.length; l < len1; l++) { + a = shownInDragDrop[l]; attrLength += a.length; } unusedAttrsVerticalAutoOverride = attrLength > unusedAttrsVerticalAutoCutoff; @@ -1431,9 +1455,9 @@ } return unused.append(attrElem).append(valueList); }; - for (i in shownAttributes) { - if (!hasProp.call(shownAttributes, i)) continue; - attr = shownAttributes[i]; + for (i in shownInDragDrop) { + if (!hasProp.call(shownInDragDrop, i)) continue; + attr = shownInDragDrop[i]; fn1(attr); } tr1 = $("").appendTo(uiTable); @@ -1491,12 +1515,12 @@ ref2 = opts.cols; for (n = 0, len2 = ref2.length; n < len2; n++) { x = ref2[n]; - this.find(".pvtCols").append(this.find(".axis_" + ($.inArray(x, shownAttributes)))); + this.find(".pvtCols").append(this.find(".axis_" + ($.inArray(x, shownInDragDrop)))); } ref3 = opts.rows; for (o = 0, len3 = ref3.length; o < len3; o++) { x = ref3[o]; - this.find(".pvtRows").append(this.find(".axis_" + ($.inArray(x, shownAttributes)))); + this.find(".pvtRows").append(this.find(".axis_" + ($.inArray(x, shownInDragDrop)))); } if (opts.aggregatorName != null) { this.find(".pvtAggregator").val(opts.aggregatorName); @@ -1541,8 +1565,8 @@ newDropdown = $("\")\n .addClass('pvtRenderer')\n .appendTo(rendererControl)\n .bind \"change\", -> refresh() #capture reference\n for own x of opts.renderers\n $(\"