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.41 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("hfunnel"),ZC.A83=ZC.NM.CD({$i:function(A){this.b(A);var e=this;e.AF="hfunnel",e.AY=new ZC.A6W(e),e.AJ["enable-animation"]=!1,e.AJ["enable-zooming"]=!1,e.AJ["enable-scroll"]=!1},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},MT:function(A){switch(A){case"x":var e=new ZC.T0(this);return e.DF=!0,e;case"y":var n=new ZC.T1(this);return n.DF=!0,n}}}),ZC.A2C=ZC.LQ.CD({parse:function(){var A,e,n,i,l,a=this;for(a.B0=ZC.MAX,a.BF=-ZC.MAX,a.A7T=[],a.SF=[],a.b(),A=0,e=a.A3.length;A<e;A++)for(n=0,i=a.A3[A].R.length;n<i;n++)a.A3[A].R[n]&&(l=a.A3[A].R[n],null===ZC._n_(a.SF[n])&&(a.SF[n]=ZC.MAX),null===ZC._n_(a.A7T[n])&&(a.A7T[n]=-ZC.MAX),a.SF[n]=ZC.CY(a.SF[n],l.AD),a.A7T[n]=ZC.BR(a.A7T[n],l.AD));for(A=0,e=a.A3.length;A<e;A++)for(n=0,i=a.A3[A].R.length;n<i;n++)a.A3[A].R[n]&&(l=a.A3[A].R[n],a.B0=ZC.CY(a.B0,l.AD),a.BF=ZC.BR(a.BF,l.AD))}}),ZC.A6W=ZC.A2C.CD({ACU:function(){return new ZC.VC(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,l=this;if(l.BP=l.O6(),l.C2=l.BP[0],l.B9=l.BP[1],l.BX=l.BP[1],l.A0=l.BP[2],l.AE=l.BP[1],l.NS(),l.b(),l.assign_a([["start-width","A2I"],["min-exit","LY","fp"],["space-entry","L7","fp"],["offset","L7","fp"],["offset","OG","fp"]]),null!==ZC._n_(n=l.o.entry))for(n instanceof Array||(n=[n]),A=0,e=n.length;A<e;A++){var a=new ZC.DT(l);a.o=n[A],a.parse(),l.OX.push(a)}if(null!==ZC._n_(i=l.o.exit))for(i instanceof Array||(i=[i]),A=0,e=i.length;A<e;A++){var t=new ZC.DT(l);t.o=i[A],t.parse(),l.VM.push(t)}l.AZ=l.C.BM(l.BW("k")[0]),l.CQ=l.C.BM(l.BW("v")[0])},paint:function(){var A=this;A.b(),A.KH=A.CS("bl",0),A.PI()}}),ZC.VC=ZC.WB.CD({$i:function(A){this.b(A),this.AF="hfunnel"},U3:function(){return new ZC.A5X(this)}}),ZC.A5X=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.iY=e.iY+e.A9+A.L*e.AA:A.iY=e.iY+e.F-e.A9-(A.L+1)*e.AA,n.AX?A.iX=n.iX+n.I-n.A9-(A.A.L+1)*n.AA:A.iX=n.iX+n.A9+A.A.L*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 l,a,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]?a=""+(l=100*t.AD/t.A.A.A3[t.A.L-1].R[t.L].AD):(l=100,a="100"),null!==ZC._n_(r.decimals)&&(a=l.toFixed(ZC.BR(0,ZC._i_(r.decimals)))),t.CA.push(["%output-percent-value",a]),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)},AC6:function(A){var e,n=this,i=n.A.AZ,l=n.A.CQ;null!==ZC._n_(A.o.placement)&&(e=A.o.placement);var a=n.iX+l.AA/2-A.I/2,t=n.iY+i.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":a=n.iX+l.AA-A.I-5;break;case"bottom":a=n.iX+5;break;case"left":t=n.iY+i.AA/2-r/2+5;break;case"left-out":t=n.iY+i.AA/2-r/2-A.F-5;break;case"right":t=n.iY+i.AA/2+r/2-A.F-5;break;case"right-out":t=n.iY+i.AA/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,e,n,i,l,a,t,C,r,o,s,Z,p,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 X=u.A.LY;X<=1&&(X*=h.AA);var b=h.AA-c-f-X,v=X+b*(u.AD/A),B=0;u.A.L+1<u.A.A.A3.length&&u.A.A.A3[u.A.L+1].R[u.L]&&(B=u.A.A.A3[u.A.L+1].R[u.L].AD);var L=X+b*(B/A);u.E["entry-exit"]=[v,L];var D=u.iY+(h.AX?c:f)+b/2+X/2;if(t=[],_.AX?t.push([u.iX+_.AA,D-v/2],[u.iX+_.AA,D+v/2],[u.iX,D+L/2],[u.iX,D-L/2],[u.iX+_.AA,D-v/2]):t.push([u.iX,D-v/2],[u.iX,D+v/2],[u.iX+_.AA,D+L/2],[u.iX+_.AA,D-L/2],[u.iX,D-v/2]),u.E.points=t,u.AP){var Y=new ZC.DT(u.A);Y.K=u.K+"-trapeze",Y.copy(u),Y.D=t,Y.parse(),Y.Z=u.A.CS("bl",1),Y.C8=u.A.CS("bl",0),Y.paint();var d=Y.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 K=u.A.OX[e];K&&null!==ZC._n_(K.o.values)&&null!==ZC._n_(K.o.values[u.L])&&(null===ZC._n_(K.o.width)&&null===ZC._n_(K.o.height)||((a=new ZC.HU(u.A)).append(K.o),a.parse()),i=0,l=0,null!==ZC._n_(K.o.width)&&(i=a.I),null!==ZC._n_(K.o.height)&&(l=a.F),0===l&&(l=ZC.BR(20,h.AA/10)),0===i&&(i=ZC.BR(16,_.AA/10)),(C=new ZC.DT(u.A)).K=u.K+"-arrow-entry",C.copy(u),C.append(K.o),C.parse(),t=[],1===u.A.OX.length?r=u.iX+_.AA/2:(s=_.AA/(u.A.OX.length+1),r=u.iX+s+e*s),h.AX?(o=u.iY+c-l+b/2-(v+L)/4+X/2-2,t.push([r-2*i/6,o],[r+2*i/6,o],[r+i/6,o+2*l/3],[r+3*i/6,o+2*l/3],[r,o+l],[r-3*i/6,o+2*l/3],[r-i/6,o+2*l/3])):(o=u.iY+h.AA+l-c-b/2+(v+L)/4-X/2+2,t.push([r-2*i/6,o],[r+2*i/6,o],[r+i/6,o-2*l/3],[r+3*i/6,o-2*l/3],[r,o-l],[r-3*i/6,o-2*l/3],[r-i/6,o-2*l/3])),C.D=t,C.parse(),C.Z=u.A.CS("bl",1),C.C8=u.A.CS("bl",0),C.paint(),null!==ZC._n_(K.o.labels)&&null!==ZC._n_(K.o.labels[u.L])&&""!==K.o.labels[u.L]&&(Z=K.o.labels[u.L],(p=new ZC.DN(u.A)).K=u.K+"-entry-label-"+e,p.GN=u.K+"-entry-label "+u.A.K+"-entry-label zc-entry-label",p.copy(u),p.o.text=Z,p.append(K.o),null!==ZC._n_(K.o.label)&&p.append(K.o.label),p.AK=Z,p.Z=u.A.CS("fl",0),p.parse(),p.iX=r-p.I/2,h.AX?p.iY=o-p.F-2:p.iY=o+2,p.paint(),p.EP()))}for(e=0,n=u.A.VM.length;e<n;e++){var w=u.A.VM[e];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.HU(u.A)).append(w.o),a.parse()),i=0,l=0,null!==ZC._n_(w.o.width)&&(i=a.I),null!==ZC._n_(w.o.height)&&(l=a.F),0===l&&(l=ZC.BR(20,h.AA/10)),0===i&&(i=ZC.BR(16,_.AA/10)),(C=new ZC.DT(u.A)).K=u.K+"-arrow-exit",C.copy(u),C.append(w.o),C.parse(),t=[],1===u.A.OX.length?r=u.iX+_.AA/2:(s=_.AA/(u.A.OX.length+1),r=u.iX+s+e*s),h.AX?(o=u.iY+c+b/2+(v+L)/4+X/2+2,t.push([r-2*i/6,o],[r+2*i/6,o],[r+i/6,o+2*l/3],[r+3*i/6,o+2*l/3],[r,o+l],[r-3*i/6,o+2*l/3],[r-i/6,o+2*l/3])):(o=u.iY+h.AA-c-b/2-(v+L)/4-X/2-2,t.push([r-2*i/6,o],[r+2*i/6,o],[r+i/6,o-2*l/3],[r+3*i/6,o-2*l/3],[r,o-l],[r-3*i/6,o-2*l/3],[r-i/6,o-2*l/3])),C.D=t,C.parse(),C.Z=u.A.CS("bl",1),C.C8=u.A.CS("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+"-exit-label-"+e,p.GN=u.K+"-exit-label "+u.A.K+"-exit-label zc-exit-label",p.copy(u),p.o.text=Z,p.append(w.o),null!==ZC._n_(w.o.label)&&p.append(w.o.label),p.AK=Z,p.Z=u.A.CS("fl",0),p.parse(),p.iX=r-p.I/2,h.AX?p.iY=o+l+2:p.iY=o-l-p.F-2,p.paint(),p.EP()))}u.setNodeData({x:u.iX,y:u.iY,w:_.AA,h:h.AA,ax:u.iX+_.AA/2,ay:u.iY+h.AA/2,fx:0,fy:0}),u.A.U&&u.H1()},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()}}});