3 lines
2.5 KiB
JavaScript
3 lines
2.5 KiB
JavaScript
(function(){var t;(t=function(t){return"object"==typeof exports&&"object"==typeof module?t(require("jquery"),require("plotly.js")):"function"==typeof define&&define.amd?define(["jquery","plotly.js"],t):t(jQuery,Plotly)})(function(t,e){var o,n;return o=function(o,n,r){return null==o&&(o={}),null==n&&(n={}),null==r&&(r=!1),function(i,l){var a,s,u,d,h,p,y,g,c,v,j,f;return d={localeStrings:{vs:"vs",by:"by"},plotly:{}},l=t.extend(!0,{},d,l),v=i.getRowKeys(),a=i.getColKeys(),f=r?a:v,0===f.length&&f.push([]),u=r?v:a,0===u.length&&u.push([]),h=i.aggregatorName,i.valAttrs.length&&(h+="("+i.valAttrs.join(", ")+")"),s=f.map(function(e){var n,l,a,s,d,p,y;for(y=[],a=[],l=0,s=u.length;l<s;l++)n=u[l],p=parseFloat(i.getAggregator(r?n:e,r?e:n).value()),y.push(isFinite(p)?p:null),a.push(n.join("-")||" ");return d={name:e.join("-")||h},d.x=r?y:a,d.y=r?a:y,t.extend(d,o)}),r?(y=i.rowAttrs.join("-"),p=i.colAttrs.join("-")):(y=i.colAttrs.join("-"),p=i.rowAttrs.join("-")),j=h,""!==y&&(j+=" "+l.localeStrings.vs+" "+y),""!==p&&(j+=" "+l.localeStrings.by+" "+p),g={title:j,hovermode:"closest",width:window.innerWidth/1.4,height:window.innerHeight/1.4-50,xaxis:{title:r?h:null,automargin:!0},yaxis:{title:r?null:h,automargin:!0}},c=t("<div>").appendTo(t("body")),e.newPlot(c[0],s,t.extend(g,n,l.plotly)),c.detach()}},n=function(){return function(o,n){var r,i,l,a,s,u,d,h,p,y,g,c,v,j;for(a={localeStrings:{vs:"vs",by:"by"},plotly:{}},n=t.extend(!0,{},a,n),v=o.getRowKeys(),0===v.length&&v.push([]),i=o.getColKeys(),0===i.length&&i.push([]),l={x:[],y:[],text:[],type:"scatter",mode:"markers"},s=0,h=v.length;s<h;s++)for(c=v[s],u=0,p=i.length;u<p;u++)r=i[u],j=o.getAggregator(c,r).value(),null!=j&&(l.x.push(r.join("-")),l.y.push(c.join("-")),l.text.push(j));return d={title:o.rowAttrs.join("-")+" vs "+o.colAttrs.join("-"),hovermode:"closest",xaxis:{title:o.colAttrs.join("-"),domain:[.1,1]},yaxis:{title:o.rowAttrs.join("-")},width:window.innerWidth/1.5,height:window.innerHeight/1.4-50},y=t("<div>",{style:"display:none;"}).appendTo(t("body")),g=t("<div>").appendTo(y),e.plot(g[0],[l],t.extend(d,n.plotly)),g.detach(),y.remove(),g}},t.pivotUtilities.plotly_renderers={"Horizontal Bar Chart":o({type:"bar",orientation:"h"},{barmode:"group"},!0),"Horizontal Stacked Bar Chart":o({type:"bar",orientation:"h"},{barmode:"stack"},!0),"Bar Chart":o({type:"bar"},{barmode:"group"}),"Stacked Bar Chart":o({type:"bar"},{barmode:"stack"}),"Line Chart":o(),"Scatter Chart":n()}})}).call(this);
|
|
//# sourceMappingURL=plotly_renderers.min.js.map
|