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.54 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.16-hf1 */ ZC.WJ.push("vfunnel"),ZC.A82=ZC.NM.CD({$i:function(A){this.b(A);var e=this;e.AF="vfunnel",e.AY=new ZC.A6V(e),e.AJ["enable-animation"]=!1,e.AJ["enable-zooming"]=!1,e.AJ["enable-scroll"]=!1},MT:function(A,e){switch(A){case"x":var n=this.b(A,e);return n.DF=!0,n;case"y":var i=this.b(A,e);return i.DF=!0,i}},ABF:function(A){var e=this;if("v"===A&&e.o.series&&e.o.series.length){for(var n=[],i=0;i<e.o.series.length;i++)n.push("Step "+(i+1));return n}return null},paint:function(){for(var A=this,e=0,n=A.BO.length;e<n;e++)"v"===A.BO[e].AF&&(A.BO[e].AX=!A.BO[e].AX);A.b()}}),ZC.A2C=ZC.LQ.CD({parse:function(){var A,e,n,i,a,l=this;for(l.B0=ZC.MAX,l.BF=-ZC.MAX,l.A7T=[],l.SF=[],l.b(),A=0,e=l.A3.length;A<e;A++)for(n=0,i=l.A3[A].R.length;n<i;n++)l.A3[A].R[n]&&(a=l.A3[A].R[n],null===ZC._n_(l.SF[n])&&(l.SF[n]=ZC.MAX),null===ZC._n_(l.A7T[n])&&(l.A7T[n]=-ZC.MAX),l.SF[n]=ZC.CY(l.SF[n],a.AD),l.A7T[n]=ZC.BR(l.A7T[n],a.AD));for(A=0,e=l.A3.length;A<e;A++)for(n=0,i=l.A3[A].R.length;n<i;n++)l.A3[A].R[n]&&(a=l.A3[A].R[n],l.B0=ZC.CY(l.B0,a.AD),l.BF=ZC.BR(l.BF,a.AD))}}),ZC.A6V=ZC.A2C.CD({ACU:function(){return new ZC.VB(this)}}),ZC.WB=ZC.W8.CD({$i:function(A){this.b(A);var e=this;e.L7=.1,e.OG=.1,e.LY=0,e.A2I="dynamic",e.OX=[],e.VM=[],e.P8="bg"},parse:function(){var A,e,n,i,a=this;if(a.BP=a.O6(),a.C2=a.BP[0],a.B9=a.BP[1],a.BX=a.BP[1],a.A0=a.BP[2],a.AE=a.BP[1],a.NS(),a.b(),a.assign_a([["start-width","A2I"],["min-exit","LY","fp"],["space-entry","L7","fp"],["offset","L7","fp"],["offset","OG","fp"]]),null!==ZC._n_(n=a.o.entry))for(n instanceof Array||(n=[n]),A=0,e=n.length;A<e;A++){var l=new ZC.DT(a);l.o=n[A],l.parse(),a.OX.push(l)}if(null!==ZC._n_(i=a.o.exit))for(i instanceof Array||(i=[i]),A=0,e=i.length;A<e;A++){var t=new ZC.DT(a);t.o=i[A],t.parse(),a.VM.push(t)}a.AZ=a.C.BM(a.BW("k")[0]),a.CQ=a.C.BM(a.BW("v")[0])},paint:function(){var A=this;A.b(),A.KH=A.CS("bl",0),A.PI()}}),ZC.VB=ZC.WB.CD({$i:function(A){this.b(A),this.AF="vfunnel"},U3:function(){return new ZC.A5W(this)}}),ZC.A5W=ZC.LM.CD({setup:function(){var A=this,e=A.A.AZ,n=A.A.CQ,i=[e.W,e.A1,n.W,n.A1];A.JS!==i&&(e.AX?A.iX=e.iX+e.I-e.A9-(A.L+1)*e.AA:A.iX=e.iX+e.A9+A.L*e.AA,n.AX?A.iY=n.iY+n.A9+A.A.L*n.AA:A.iY=n.iY+n.F-n.A9-(A.A.L+1)*n.AA,A.JS=i),A.I3||(A.copy(A.A),A.E6=A.A.E6,A.DH()&&A.parse(!1),A.I3=!0)},KA:function(A,e,n,i){var a,l,t=this,C=ZC._f_(t.A.A.F9["%pstack-"+t.L+"-0-sum"]||"0"),r=t.A.MU();if(ZC._cp_(e,r),t.CA=[],t.A.L>0&&t.A.A.A3[t.A.L-1]&&t.A.A.A3[t.A.L-1].R[t.L]?l=""+(a=100*t.AD/t.A.A.A3[t.A.L-1].R[t.L].AD):(a=100,l="100"),null!==ZC._n_(r.decimals)&&(l=a.toFixed(ZC.BR(0,ZC._i_(r.decimals)))),t.CA.push(["%output-percent-value",l]),C>0){var o=100*t.AD/C,s=""+o;null!==ZC._n_(r.decimals)&&(s=o.toFixed(ZC.BR(0,ZC._i_(r.decimals)))),t.CA.push(["%node-percent-value",s]),t.CA.push(["%npv",s])}return A=t.b(A,e,n,i)},paint:function(){var A,e,n,i,a,l,t,C,r,o,s,p,Z,u=this;u.b();var h=u.A.AZ,_=u.A.CQ;u.setup(),"static"===u.A.A2I?(u.C.AY.SF[u.L],A=u.C.AY.A7T[u.L]):(u.C.AY.B0,A=u.C.AY.BF);var c=u.A.L7;c<=1&&(c*=h.AA);var f=u.A.OG;f<=1&&(f*=h.AA);var b=u.A.LY;b<=1&&(b*=h.AA);var v=h.AA-c-f-b,B=b+v*(u.AD/A),X=0;u.A.L+1<u.A.A.A3.length&&u.A.A.A3[u.A.L+1].R[u.L]&&(X=u.A.A.A3[u.A.L+1].R[u.L].AD);var L=b+v*(X/A);u.E["entry-exit"]=[B,L];var Y=u.iX+(h.AX?f:c)+v/2+b/2;if(i=[],_.AX?i.push([Y-B/2,u.iY],[Y+B/2,u.iY],[Y+L/2,u.iY+_.AA],[Y-L/2,u.iY+_.AA],[Y-B/2,u.iY]):i.push([Y-B/2,u.iY+_.AA],[Y+B/2,u.iY+_.AA],[Y+L/2,u.iY],[Y-L/2,u.iY],[Y-B/2,u.iY+_.AA]),u.E.points=i,u.AP){var D=new ZC.DT(u.A);D.K=u.K+"-trapeze",D.copy(u),D.D=i,D.parse(),D.Z=u.A.CS("bl",1),D.C8=u.A.CS("bl",0),D.paint();var d=D.F1(),F=u.C.K+"-node-area "+u.C.K+"-plotset-plot-"+u.A.L+"-node-area zc-node-area";u.A.A.H3.push(ZC.Q.FO("poly",u.A.E9,u.A.IE)+'class="'+F+'" '+u.a11y()+' id="'+u.K+'" coords="'+d+'" />')}for(e=0,n=u.A.OX.length;e<n;e++){var g=u.A.OX[e];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.HU(u.A)).append(g.o),a.parse()),l=0,t=0,null!==ZC._n_(g.o.width)&&(l=a.I),null!==ZC._n_(g.o.height)&&(t=a.F),0===l&&(l=ZC.BR(20,h.AA/10)),0===t&&(t=ZC.BR(16,_.AA/10)),(C=new ZC.DT(u.A)).K=u.K+"-arrow-entry",C.copy(u),C.append(g.o),C.parse(),i=[],1===u.A.OX.length?o=u.iY+_.AA/2:(s=_.AA/(u.A.OX.length+1),o=u.iY+s+e*s),h.AX?(r=u.iX+h.AA+l-c-v/2+(B+L)/4-b/2+2,i.push([r,o-2*t/6],[r-2*l/3,o-t/6],[r-2*l/3,o-3*t/6],[r-l,o],[r-2*l/3,o+3*t/6],[r-2*l/3,o+t/6],[r,o+2*t/6],[r,o-2*t/6])):(r=u.iX+c-l+v/2-(B+L)/4+b/2-2,i.push([r,o-2*t/6],[r+2*l/3,o-t/6],[r+2*l/3,o-3*t/6],[r+l,o],[r+2*l/3,o+3*t/6],[r+2*l/3,o+t/6],[r,o+2*t/6],[r,o-2*t/6])),C.D=i,C.parse(),C.Z=u.A.CS("bl",1),C.C8=u.A.CS("bl",0),C.paint(),null!==ZC._n_(g.o.labels)&&null!==ZC._n_(g.o.labels[u.L])&&""!==g.o.labels[u.L]&&(p=g.o.labels[u.L],(Z=new ZC.DN(u.A)).K=u.K+"-entry-label-"+e,Z.GN=u.K+"-entry-label "+u.A.K+"-entry-label zc-entry-label",Z.copy(u),Z.o.text=p,Z.append(g.o),null!==ZC._n_(g.o.label)&&Z.append(g.o.label),Z.Z=u.A.CS("fl",0),Z.parse(),h.AX?Z.iX=r+2:Z.iX=r-Z.I-2,Z.iY=o-Z.F/2,Z.paint(),Z.EP()))}for(e=0,n=u.A.VM.length;e<n;e++){var y=u.A.VM[e];y&&null!==ZC._n_(y.o.values)&&null!==ZC._n_(y.o.values[u.L])&&(null===ZC._n_(y.o.width)&&null===ZC._n_(y.o.height)||((a=new ZC.HU(u.A)).append(y.o),a.parse()),l=0,t=0,null!==ZC._n_(y.o.width)&&(l=a.I),null!==ZC._n_(y.o.height)&&(t=a.F),0===l&&(l=ZC.BR(20,h.AA/10)),0===t&&(t=ZC.BR(16,_.AA/10)),(C=new ZC.DT(u.A)).K=u.K+"-arrow-exit",C.copy(u),C.append(y.o),C.parse(),i=[],1===u.A.VM.length?o=u.iY+_.AA/2:(s=_.AA/(u.A.VM.length+1),o=u.iY+s+e*s),h.AX?(r=u.iX+f+v/2-(B+L)/4+b/2-2,i.push([r,o-2*t/6],[r-2*l/3,o-t/6],[r-2*l/3,o-3*t/6],[r-l,o],[r-2*l/3,o+3*t/6],[r-2*l/3,o+t/6],[r,o+2*t/6],[r,o-2*t/6])):(r=u.iX+h.AA-f-v/2+(B+L)/4-b/2+2,i.push([r,o-2*t/6],[r+2*l/3,o-t/6],[r+2*l/3,o-3*t/6],[r+l,o],[r+2*l/3,o+3*t/6],[r+2*l/3,o+t/6],[r,o+2*t/6],[r,o-2*t/6])),C.D=i,C.parse(),C.Z=u.A.CS("bl",1),C.C8=u.A.CS("bl",0),C.paint(),null!==ZC._n_(y.o.labels)&&null!==ZC._n_(y.o.labels[u.L])&&""!==y.o.labels[u.L]&&(p=y.o.labels[u.L],(Z=new ZC.DN(u.A)).K=u.K+"-exit-label-"+e,Z.GN=u.K+"-exit-label "+u.A.K+"-exit-label zc-exit-label",Z.copy(u),Z.o.text=p,Z.append(y.o),null!==ZC._n_(y.o.label)&&Z.append(y.o.label),Z.parse(),Z.Z=u.A.CS("fl",0),h.AX?Z.iX=r-l-Z.I-2:Z.iX=r+l+2,Z.iY=o-Z.F/2,Z.paint(),Z.EP()))}u.setNodeData({x:u.iX,y:u.iY,w:h.AA,h:_.AA,ax:u.iX+h.AA/2,ay:u.iY+_.AA/2,fx:0,fy:0}),u.A.U&&u.H1()},AC6:function(A){var e,n=this,i=n.A.AZ,a=n.A.CQ;null!==ZC._n_(A.o.placement)&&(e=A.o.placement);var l=n.iX+i.AA/2-A.I/2,t=n.iY+a.AA/2-A.F/2,C=n.E["entry-exit"],r=(C[0]+C[1])/2;switch(e){case"in":case"auto":break;case"top":t=n.iY+5;break;case"bottom":t=n.iY+a.AA-A.F-5;break;case"left":l=n.iX+i.AA/2-r/2+5;break;case"left-out":l=n.iX+i.AA/2-r/2-A.I-5;break;case"right":l=n.iX+i.AA/2+r/2-A.I-5;break;case"right-out":l=n.iX+i.AA/2+r/2+5}return null!==ZC._n_(A.o.x)&&(l=A.iX),null!==ZC._n_(A.o.y)&&(t=A.iY),[ZC._i_(l),ZC._i_(t)]},A15:function(){var A=this;if(!ZC.move&&A.A.IK&&A.A.AP){A.b();var e=new ZC.DT(A.A);e.K=A.K+"-trapeze-hover",e.Z=ZC.AM(A.C.K+"-hover-c"),e.D=A.E.points,e.parse(),e.B9=A.A.BP[1],e.BX=A.A.BP[1],e.A0=A.A.BP[2],e.AE=A.A.BP[3],e.append(A.A.IK.o),e.parse(),e.IQ=function(e){return A.IQ(e)},e.DH()&&e.parse(),e.AP&&e.paint()}}});