UNPKG

zingchart

Version:

Our JavaScript charting library is a commercial product. But the full branded version is free to try, forever.

8 lines (7 loc) 7.26 kB
/* All of the code within the ZingChart software is developed and copyrighted by ZingChart, Inc., and may not be copied, replicated, or used in any other software or application without prior permission from ZingChart. All usage must coincide with the ZingChart End User License Agreement which can be requested by email at support@zingchart.com. Build 2.9.11 */ ZC.WG.push("hfunnel"),ZC.A81=ZC.NK.CC({$i:function(A){this.b(A);var n=this;n.AF="hfunnel",n.AZ=new ZC.A6U(n),n.AJ["enable-animation"]=!1,n.AJ["enable-zooming"]=!1,n.AJ["enable-scroll"]=!1},ABG:function(A){if("v"===A){for(var n=[],e=0;e<this.o.series.length;e++)n.push("Step "+(e+1));return n}},MS:function(A){switch(A){case"x":var n=new ZC.SU(this);return n.DE=!0,n;case"y":var e=new ZC.SV(this);return e.DE=!0,e}}}),ZC.A2C=ZC.LN.CC({parse:function(){var A,n,e,l,i,a=this;for(a.AY=ZC.MAX,a.BD=-ZC.MAX,a.A7R=[],a.S8=[],a.b(),A=0,n=a.A3.length;A<n;A++)for(e=0,l=a.A3[A].R.length;e<l;e++)a.A3[A].R[e]&&(i=a.A3[A].R[e],null===ZC._n_(a.S8[e])&&(a.S8[e]=ZC.MAX),null===ZC._n_(a.A7R[e])&&(a.A7R[e]=-ZC.MAX),a.S8[e]=ZC.CY(a.S8[e],i.AD),a.A7R[e]=ZC.BQ(a.A7R[e],i.AD));for(A=0,n=a.A3.length;A<n;A++)for(e=0,l=a.A3[A].R.length;e<l;e++)a.A3[A].R[e]&&(i=a.A3[A].R[e],a.AY=ZC.CY(a.AY,i.AD),a.BD=ZC.BQ(a.BD,i.AD))}}),ZC.A6U=ZC.A2C.CC({ACU:function(){return new ZC.V9(this)}}),ZC.W8=ZC.W5.CC({$i:function(A){this.b(A);var n=this;n.L2=.1,n.OB=.1,n.LW=0,n.A2I="dynamic",n.OS=[],n.VI=[],n.P3="bg"},parse:function(){var A,n,e,l,i=this;if(i.BP=i.O1(),i.C2=i.BP[0],i.B7=i.BP[1],i.BX=i.BP[1],i.A0=i.BP[2],i.AE=i.BP[1],i.NQ(),i.b(),i.assign_a([["start-width","A2I"],["min-exit","LW","fp"],["space-entry","L2","fp"],["offset","L2","fp"],["offset","OB","fp"]]),null!==ZC._n_(e=i.o.entry))for(e instanceof Array||(e=[e]),A=0,n=e.length;A<n;A++){var a=new ZC.DQ(i);a.o=e[A],a.parse(),i.OS.push(a)}if(null!==ZC._n_(l=i.o.exit))for(l instanceof Array||(l=[l]),A=0,n=l.length;A<n;A++){var t=new ZC.DQ(i);t.o=l[A],t.parse(),i.VI.push(t)}i.B0=i.C.BM(i.BW("k")[0]),i.CN=i.C.BM(i.BW("v")[0])},paint:function(){var A=this;A.b(),A.KF=A.CQ("bl",0),A.PD()}}),ZC.V9=ZC.W8.CC({$i:function(A){this.b(A),this.AF="hfunnel"},TY:function(){return new ZC.A5W(this)}}),ZC.A5W=ZC.LI.CC({setup:function(){var A=this,n=A.A.B0,e=A.A.CN,l=[n.W,n.A1,e.W,e.A1];A.JQ!==l&&(n.AW?A.iY=n.iY+n.A9+A.L*n.AB:A.iY=n.iY+n.F-n.A9-(A.L+1)*n.AB,e.AW?A.iX=e.iX+e.I-e.A9-(A.A.L+1)*e.AB:A.iX=e.iX+e.A9+A.A.L*e.AB,A.JQ=l),A.HZ||(A.copy(A.A),A.E7=A.A.E7,A.DF()&&A.parse(!1),A.HZ=!0)},JX:function(A,n,e,l){var i,a,t=this,C=ZC._f_(t.A.A.F8["%pstack-"+t.L+"-0-sum"]||"0"),r=t.A.MT();if(ZC._cp_(n,r),t.CV=[],t.A.L>0&&t.A.A.A3[t.A.L-1]&&t.A.A.A3[t.A.L-1].R[t.L]?a=""+(i=100*t.AD/t.A.A.A3[t.A.L-1].R[t.L].AD):(i=100,a="100"),null!==ZC._n_(r.decimals)&&(a=i.toFixed(ZC.BQ(0,ZC._i_(r.decimals)))),t.CV.push(["%output-percent-value",a]),C>0){var o=100*t.AD/C,s=""+o;null!==ZC._n_(r.decimals)&&(s=o.toFixed(ZC.BQ(0,ZC._i_(r.decimals)))),t.CV.push(["%node-percent-value",s]),t.CV.push(["%npv",s])}return A=t.b(A,n,e,l)},AC7:function(A){var n,e=this,l=e.A.B0,i=e.A.CN;null!==ZC._n_(A.o.placement)&&(n=A.o.placement);var a=e.iX+i.AB/2-A.I/2,t=e.iY+l.AB/2-A.F/2,C=e.E["entry-exit"],r=(C[0]+C[1])/2;switch(n){case"in":case"auto":break;case"top":a=e.iX+i.AB-A.I-5;break;case"bottom":a=e.iX+5;break;case"left":t=e.iY+l.AB/2-r/2+5;break;case"left-out":t=e.iY+l.AB/2-r/2-A.F-5;break;case"right":t=e.iY+l.AB/2+r/2-A.F-5;break;case"right-out":t=e.iY+l.AB/2+r/2+5}return null!==ZC._n_(A.o.x)&&(a=A.iX),null!==ZC._n_(A.o.y)&&(t=A.iY),[ZC._i_(a),ZC._i_(t)]},paint:function(){var A,n,e,l,i,a,t,C,r,o,s,Z,p,u=this;u.b();var h=u.A.B0,B=u.A.CN;u.setup(),"static"===u.A.A2I?(u.C.AZ.S8[u.L],A=u.C.AZ.A7R[u.L]):(u.C.AZ.AY,A=u.C.AZ.BD);var _=u.A.L2;_<=1&&(_*=h.AB);var c=u.A.OB;c<=1&&(c*=h.AB);var f=u.A.LW;f<=1&&(f*=h.AB);var b=h.AB-_-c-f,v=f+b*(u.AD/A),L=0;u.A.L+1<u.A.A.A3.length&&u.A.A.A3[u.A.L+1].R[u.L]&&(L=u.A.A.A3[u.A.L+1].R[u.L].AD);var D=f+b*(L/A);u.E["entry-exit"]=[v,D];var X=u.iY+(h.AW?_:c)+b/2+f/2;if(t=[],B.AW?t.push([u.iX+B.AB,X-v/2],[u.iX+B.AB,X+v/2],[u.iX,X+D/2],[u.iX,X-D/2],[u.iX+B.AB,X-v/2]):t.push([u.iX,X-v/2],[u.iX,X+v/2],[u.iX+B.AB,X+D/2],[u.iX+B.AB,X-D/2],[u.iX,X-v/2]),u.E.points=t,u.AN){var Q=new ZC.DQ(u.A);Q.K=u.K+"-trapeze",Q.copy(u),Q.D=t,Q.parse(),Q.Z=u.A.CQ("bl",1),Q.C7=u.A.CQ("bl",0),Q.paint();var d=Q.FG(),Y=u.C.K+"-node-area "+u.C.K+"-plotset-plot-"+u.A.L+"-node-area zc-node-area";u.A.A.HD.push(ZC.Q.FS("poly",u.A.EA,u.A.IK)+'class="'+Y+'" id="'+u.K+'" coords="'+d+'" />')}for(n=0,e=u.A.OS.length;n<e;n++){var w=u.A.OS[n];w&&null!==ZC._n_(w.o.values)&&null!==ZC._n_(w.o.values[u.L])&&(null===ZC._n_(w.o.width)&&null===ZC._n_(w.o.height)||((a=new ZC.HQ(u.A)).append(w.o),a.parse()),l=0,i=0,null!==ZC._n_(w.o.width)&&(l=a.I),null!==ZC._n_(w.o.height)&&(i=a.F),0===i&&(i=ZC.BQ(20,h.AB/10)),0===l&&(l=ZC.BQ(16,B.AB/10)),(C=new ZC.DQ(u.A)).K=u.K+"-arrow-entry",C.copy(u),C.append(w.o),C.parse(),t=[],1===u.A.OS.length?r=u.iX+B.AB/2:(s=B.AB/(u.A.OS.length+1),r=u.iX+s+n*s),h.AW?(o=u.iY+_-i+b/2-(v+D)/4+f/2-2,t.push([r-2*l/6,o],[r+2*l/6,o],[r+l/6,o+2*i/3],[r+3*l/6,o+2*i/3],[r,o+i],[r-3*l/6,o+2*i/3],[r-l/6,o+2*i/3])):(o=u.iY+h.AB+i-_-b/2+(v+D)/4-f/2+2,t.push([r-2*l/6,o],[r+2*l/6,o],[r+l/6,o-2*i/3],[r+3*l/6,o-2*i/3],[r,o-i],[r-3*l/6,o-2*i/3],[r-l/6,o-2*i/3])),C.D=t,C.parse(),C.Z=u.A.CQ("bl",1),C.C7=u.A.CQ("bl",0),C.paint(),null!==ZC._n_(w.o.labels)&&null!==ZC._n_(w.o.labels[u.L])&&""!==w.o.labels[u.L]&&(Z=w.o.labels[u.L],(p=new ZC.DN(u.A)).K=u.K+"-entry-label-"+n,p.GL=u.K+"-entry-label "+u.A.K+"-entry-label zc-entry-label",p.copy(u),p.o.text=Z,p.append(w.o),null!==ZC._n_(w.o.label)&&p.append(w.o.label),p.AM=Z,p.Z=u.A.CQ("fl",0),p.parse(),p.iX=r-p.I/2,h.AW?p.iY=o-p.F-2:p.iY=o+2,p.paint(),p.EM()))}for(n=0,e=u.A.VI.length;n<e;n++){var g=u.A.VI[n];g&&null!==ZC._n_(g.o.values)&&null!==ZC._n_(g.o.values[u.L])&&(null===ZC._n_(g.o.width)&&null===ZC._n_(g.o.height)||((a=new ZC.HQ(u.A)).append(g.o),a.parse()),l=0,i=0,null!==ZC._n_(g.o.width)&&(l=a.I),null!==ZC._n_(g.o.height)&&(i=a.F),0===i&&(i=ZC.BQ(20,h.AB/10)),0===l&&(l=ZC.BQ(16,B.AB/10)),(C=new ZC.DQ(u.A)).K=u.K+"-arrow-exit",C.copy(u),C.append(g.o),C.parse(),t=[],1===u.A.OS.length?r=u.iX+B.AB/2:(s=B.AB/(u.A.OS.length+1),r=u.iX+s+n*s),h.AW?(o=u.iY+_+b/2+(v+D)/4+f/2+2,t.push([r-2*l/6,o],[r+2*l/6,o],[r+l/6,o+2*i/3],[r+3*l/6,o+2*i/3],[r,o+i],[r-3*l/6,o+2*i/3],[r-l/6,o+2*i/3])):(o=u.iY+h.AB-_-b/2-(v+D)/4-f/2-2,t.push([r-2*l/6,o],[r+2*l/6,o],[r+l/6,o-2*i/3],[r+3*l/6,o-2*i/3],[r,o-i],[r-3*l/6,o-2*i/3],[r-l/6,o-2*i/3])),C.D=t,C.parse(),C.Z=u.A.CQ("bl",1),C.C7=u.A.CQ("bl",0),C.paint(),null!==ZC._n_(g.o.labels)&&null!==ZC._n_(g.o.labels[u.L])&&""!==g.o.labels[u.L]&&(Z=g.o.labels[u.L],(p=new ZC.DN(u.A)).K=u.K+"-exit-label-"+n,p.GL=u.K+"-exit-label "+u.A.K+"-exit-label zc-exit-label",p.copy(u),p.o.text=Z,p.append(g.o),null!==ZC._n_(g.o.label)&&p.append(g.o.label),p.AM=Z,p.Z=u.A.CQ("fl",0),p.parse(),p.iX=r-p.I/2,h.AW?p.iY=o+i+2:p.iY=o-i-p.F-2,p.paint(),p.EM()))}u.A.U&&u.GY()},A12:function(){var A=this;if(!ZC.move&&A.A.IH&&A.A.AN){A.b();var n=new ZC.DQ(A.A);n.K=A.K+"-trapeze-hover",n.Z=ZC.AL(A.C.K+"-hover-c"),n.D=A.E.points,n.parse(),n.B7=A.A.BP[1],n.BX=A.A.BP[1],n.A0=A.A.BP[2],n.AE=A.A.BP[3],n.append(A.A.IH.o),n.parse(),n.J5=function(n){return A.J5(n)},n.DF()&&n.parse(),n.AN&&n.paint()}}});