UNPKG

quoslibero

Version:

FusionCharts JavaScript charting framework

1 lines 40.7 kB
import Pie2DDataset,{labelClickFn,plotClickHandler,hideFn}from'../pie2d';import{ZEROSTRING,touchEnabled,pluck,toRaphaelColor,preDefStr,getPosition,fcEach,getFirstValue,pluckNumber,convertColor,getDarkColor,getLightColor,hasSVG,normalizeAngle,extend2,rawRGBtoHEX}from'../../../../fc-core/src/lib';import{ComponentInterface}from'../../../../fc-core/src/component-interface';import{_getInnerSize}from'../doughnut2d';import pie3dAnimation from'./index.animation';import{getDep,addDep}from'../../../../fc-core/src/dependency-manager';import raphaelShapesLitepath from'../../../../fc-core/src/_internal/redraphael/redraphael-shapes/redraphael-shapes.litepath';let UNDEF,Raphael=getDep('redraphael','plugin'),win=window,HIDDEN='hidden',docMode8=8===window.document.documentMode,VISIBLE=docMode8?'visible':'',COMMASTRING=',',ROLLOVER='DataPlotRollOver',ROLLOUT='DataPlotRollOut',EVENTARGS='eventArgs',GROUPID='groupId',POINTER='pointer',elementStr=preDefStr.elementStr,M='M',L='L',V='v',A='A',Z='Z',math=Math,mathMax=math.max,mathMin=math.min,mathAbs=math.abs,mathCeil=math.ceil,mathSin=math.sin,mathATan2=math.atan2,mathCos=math.cos,mathFloor=math.floor,mathRound=math.round,pi=math.PI,pi2=2*pi,piBy2=pi/2,pi3By2=pi+piBy2,getAbsScaleAngle=function(t,e){return(t>e?pi2:0)+e-t},map=function(t,e){for(var n=[],o=0,r=t.length;o<r;o++)n[o]=e.call(t[o],t[o],o,t);return n},defined=function(t){return t!==UNDEF&&null!==t},isObject=function(t){return'object'==typeof t},isString=function(t){return'string'==typeof t},pInt=function(t,e){return parseInt(t,e||10)},pie3DCacheColorStore={lighting3D:{},lighting2D:{}},getClickArcTangent=function(t,e,n,o,r){return mathATan2((e-n[1]-o.top)/r,t-n[0]-o.left)},plotRollOver=function(t){var e=this.data('plotItem'),n=e.index,o=e.chart,r=o.getFromEnv('animationManager'),a=o.config,i=o.getChildren('dataset')[0],l=i.config,c=i.components,s=c.data[n],d=s.graphics,p=s.config,h=d.element,g=p.hoverEffects;l.isRotating||(o.plotEventHandler(h,t,ROLLOVER),g.enabled&&r.setAnimation({el:h,attr:g,component:i})),a.isHovered=!0},plotRollOut=function(t){var e=this.data('plotItem'),n=e.index,o=e.chart,r=o.getFromEnv('animationManager'),a=o.config,i=o.getChildren('dataset')[0],l=i.config,c=i.components,s=c.data[n],d=s.graphics,p=s.config,h=d.element;l.isRotating||(o.plotEventHandler(h,t,ROLLOUT),r.setAnimation({el:h,attr:{color:p.color.color.split(',')[0],alpha:p._3dAlpha,borderWidth:p.borderWidth,borderColor:p.borderColor},component:i})),a.isHovered=!1},plotDragStart=function(t){var e,n=this.data('plotItem'),o=n.chart,r=o.getChildren('dataset')[0],a=pluckNumber(t.button,t.originalEvent.button),i=r.config,l=t.data[0],c=t.data[1];i.isRightClicked=!(touchEnabled||0===a||1===a);!i.enableRotation||i.isRightClicked||(i.isRotating=!1,e=getClickArcTangent.call(t,l,c,i.center,i.chartPosition=getPosition(r.getFromEnv('chart-container')),i.pieYScale),i.dragStartAngle=e,i._lastAngle=-i.startAngle,i.startingAngleOnDragStart=i.startAngle)},plotDragEnd=function(){var t=this.data('plotItem'),e=t.index,n=t.chart,o=n.getFromEnv('animationManager'),r=n.config,a=n.getChildren('dataset')[0],i=a.config,l=a.components,c=l.data[e],s=c.graphics,d=c.config,p=s.element,h=i.startAngle;i.isRightClicked||i.isRotating&&(setTimeout(function(){i.isRotating=!1},0),n.fireChartInstanceEvent('rotationEnd',{startingAngle:normalizeAngle(h,!0),changeInAngle:h-i.startingAngleOnDragStart}),!r.isHovered&&o.setAnimation({el:p,attr:{color:d.color.color.split(',')[0],alpha:d._3dAlpha,borderWidth:d.borderWidth,borderColor:d.borderColor},component:a}))},plotDragMove=function(t){var e,n,o,r=this.data('plotItem'),a=r.chart,i=t.data,l=i[0],c=i[1],s=i[2],d=i[3],p=a.getChildren('dataset')[0],h=p.config;isNaN(l)||isNaN(c)||!h.enableRotation||h.singletonCase||h.isRightClicked||(e=getClickArcTangent.call(t,s,d,h.center,h.chartPosition,h.pieYScale),h.dragStartAngle!==e&&!h.isRotating&&(h.isRotating=!0,a.fireChartInstanceEvent('rotationStart',{startingAngle:normalizeAngle(h.startAngle,!0)})),o=e-h.dragStartAngle,h.dragStartAngle=e,h.moveDuration=0,h._lastAngle+=180*o/pi,n=new Date().getTime(),(!h._lastTime||h._lastTime+h.timerThreshold<n)&&(!h._lastTime&&p._rotate(),h.timerId=setTimeout(function(){a.disposed&&a.disposing||p._rotate()},h.timerThreshold),h._lastTime=n))},elementZSortFn=function(t,e){var n=t._conf.index-e._conf.index||t._conf.cIndex-e._conf.cIndex||t._conf.isStart-e._conf.isStart||t._conf.si-e._conf.si;return n},getStartIndex=function(t){var e,n,o,r,a,c=t[0]&&t[0]._conf.index;for(o=c<=pi,n=1,e=t.length;n<e;n+=1)if(a=t[n]._conf.index,r=a<=pi,r!=o||a<c)return n;return 0},sortArrayByPoint=function(t,e){return t.point.value-e.point.value},sortArrayByAngle=function(t,e){return t.angle-e.angle},alignments=['start','start','end','end'],alignCenter='middle',ySign=[-1,1,1,-1],xSign=[1,1,-1,-1],attrKeyList={stroke:!0,strokeWidth:!0,"stroke-width":!0,dashstyle:!0,"stroke-dasharray":!0,translateX:!0,translateY:!0,"stroke-opacity":!0,fill:!0,"fill-opacity":!0,opacity:!0,transform:!0,cursor:!0,sAngle:!0,eAngle:!0,color:!0,alpha:!0,borderColor:!0,borderAlpha:!0,borderWidth:!0,rolloverProps:!0,showBorderEffect:!0,positionIndex:!0,cx:!0,cy:!0,radiusYFactor:!0,r:!0,innerR:!0},attrFN=function(t,e){var n,o,r,a,i,l,c=this,s=c._confObject,d={},p=s.elements,h=s.Pie3DManager;if(isString(t)&&defined(e)&&(n=t,t={},t[n]=e),!t||isString(t))c=attrKeyList[t]?s[t]:c._attr(t);else{for(n in t)o=t[n],attrKeyList[n]?(s[n]=o,'cursor'===n||'transform'===n||'opacity'===n||'fill-opacity'===n?(d[n]=o,l=!0):'sAngle'===n||'eAngle'===n||'cx'===n||'cy'===n||'radiusYFactor'===n||'r'===n||'innerR'===n?a=!0:('color'===n||'alpha'===n||'borderColor'===n||'borderAlpha'===n||'borderWidth'===n)&&(i=!0)):c._attr(n,o);if(a&&(h._setSliceShape(s),h.refreshDrawing()),(i||a)&&h._setSliceCosmetics(s),l){for(r in p)p[r].attr(d);c._attr(d)}}return c},onFN=function(t,e,n){if(n)return void this._on(t,e,!0);var o,r=this,a=r._confObject,i=a.elements;for(o in i)i[o].on(t,e);return r._on(t,e)},onDragFN=function(t,e,n){var o,r=this,a=r._confObject,i=a.elements,l=win.navigator,c=l.userAgent.toLowerCase(),s=-1<c.indexOf('android');for(o in i)s?('topBorder'===o||'frontOuter'===o||'startSlice'===o||'endSlice'===o)&&i[o].drag(t,e,n):i[o].drag(t,e,n);return r._drag(t,e,n)},hideFN=function(){var t,e=this,n=e._confObject,o=n.elements;for(t in o)o[t].hide();return e._hide()},showFN=function(){var t,e=this,n=e._confObject,o=n.elements;for(t in o)o[t].show();return e._show()},destroyFN=function(){var t,e=this._confObject,n=e.elements;for(t in n)n[t].destroy();return hasSVG&&(e.clipTop.destroy(),e.clipOuterFront.destroy(),e.clipOuterBack.destroy(),e.clipOuterFront1&&e.clipOuterFront1.destroy(),e.clipInnerFront&&e.clipInnerFront.destroy(),e.clipInnerBack&&e.clipInnerBack.destroy()),this._destroy()},dataFN=function(t,e){var n,o=this,r=o._confObject,a=r.elements;if(e===UNDEF)return o._data(t);for(n in a)a[n].data(t,e);return o._data(t,e)},si=0;addDep({name:'pie3dAnimation',type:'animationRule',extension:pie3dAnimation});class Pie3DDataset extends Pie2DDataset{__setDefaultConfig(){super.__setDefaultConfig();let t=this.config;t.setBorderWidth=UNDEF,t.alphaanimation=1,t.showBorderEffect=UNDEF}placeDataLabels(t){var e,n,o,r,a,l,c,s,d,p,h,g,f,u,m,b,P,F,x,A,_,O,S,y,C,B,I,v,T,w,D,W,E,Y,R,G,H,z,U=this,X=U.getFromEnv('chart'),V=X.getFromEnv('toolTipController'),q=X.config,N=U.config,Z=U.components.data,Q=N.piePlotOptions,J=q.canvasLeft,$=q.canvasTop,K=q.canvasWidth,tt=J+.5*q.canvasWidth,et=$+.5*q.canvasHeight,nt=X.getFromEnv('smartLabel'),ot=N.dataLabelOptions,rt=ot.style,at=pluckNumber(mathCeil(parseFloat(rt.lineHeight)),12),it=getFirstValue(ot.placeInside,!1),lt=ot.skipOverlapLabels,ct=ot.manageLabelOverflow,st=ot.connectorPadding,dt=ot.distance,pt=ot.connectorWidth,ht=[[],[],[],[]],gt=J,ft=$,ut=parseInt(rt.fontSize,10),mt=ut,bt=mt/2,Pt=[st,st,-st,-st],Ft=ot.isSmartLineSlanted,xt=N.center||(N.center=[tt,et,Q.size,Q.innerSize||0]),At=xt[1],_t=xt[0],kt=xt[2],Ot=xt[4],St=N.labelsRadius,yt=mathRound(100*N.labelsRadiusY)/100,Ct=N.maxLabels,Bt=N.enableSmartLabels,It=N.pieSliceDepth/2,vt=X.getFromEnv('animationManager'),Tt=U.getContainer('label-group');if(nt.useEllipsesOnOverflow(q.useEllipsesWhenOverflow),!!N.dataLabelCounter)if(t||nt.setStyle(rt),1==Z.length)_=Z[0],W=_.graphics,D=_.config,z=D._textAttrs,H=D._textCss,C=W.label,E=W.connector,D.slicedTranslation=[gt,ft],null!==D.y&&D.y!==UNDEF&&(z.visibility=VISIBLE,z['text-anchor']=alignCenter,z.x=_t,z.y=At+bt-2,z._x=_t),H.cursor=D.labellink?'pointer':'',C=W.label=vt.setAnimation({el:W.label||'text',attr:z,css:H,label:'label',container:Tt,component:U}),C.on('fc-dragstart',plotDragStart).on('fc-dragmove',plotDragMove).on('fc-dragend',plotDragEnd).on('fc-click',labelClickFn.bind(C,X,_.config.labellink)).on('fc-mouseup',plotClickHandler(U,C)).on('fc-mouseover',plotRollOver).on('fc-mouseout',plotRollOut),z._x&&(C.x=z._x,delete z.x),C.data('plotItem',z.plotItem).data(EVENTARGS,z.eventArgs),z.visibility===VISIBLE&&C.show(),E&&E.hide();else if(it)fcEach(Z,function(t){var e,n,o;W=t.graphics,D=t.config,z=D._textAttrs,C=W.label,null!==D.y&&D.y!==UNDEF&&(O=D.angle,x=At+xt[6]*mathSin(O)+bt-2,m=_t+xt[5]*mathCos(O),z._x=m,z._y=x,D.sliced&&(e=t.slicedTranslation,n=e[0]-gt,o=e[1]-ft,m+=n,x+=o),z.visibility=VISIBLE,z.align=alignCenter,z.x=m,z.y=x),H.cursor=D.labellink?'pointer':'',C=W.label=vt.setAnimation({el:W.label||'text',attr:z,css:H,label:'label',container:Tt,component:U}),C.data('plotItem',z.plotItem).data(EVENTARGS,z.eventArgs),z.visibility===VISIBLE&&C.show(),C.x=z._x,C._x=z._x,C._y=z._y});else{for(fcEach(Z,function(t){return W=t.graphics,D=t.config,H=D._textCss,z=D._textAttrs,(z.text=D.displayValue)?void(W=t.graphics,null!==D.y&&D.y!==UNDEF&&(C=W.label,E=W.connector,E&&E.show(),C&&C.show()),C=W.label,O=D.angle,0>O&&(O=pi2+O),I=0<=O&&O<piBy2?1:O<pi?2:O<pi3By2?3:0,ht[I].push({point:t,angle:O})):(W.connector&&vt.setAnimation({el:W.connector,component:U,callback:hideFn}),void(W.label&&vt.setAnimation({el:W.label,component:U,callback:hideFn})))}),r=4;r--;){if(lt&&(S=ht[r].length-Ct,0<S))for(ht[r].sort(sortArrayByPoint),y=ht[r].splice(0,S),(l=0,p=y.length);l<p;l+=1)_=y[l].point,W=_.graphics,W.label&&vt.setAnimation({el:W.label,attr:{visibility:HIDDEN},component:U}),W.connector&&vt.setAnimation({el:W.connector,attr:{visibility:HIDDEN},component:U});ht[r].sort(sortArrayByAngle)}for(G=mathMax(ht[0].length,ht[1].length,ht[2].length,ht[3].length),R=mathMax(mathMin(G,Ct)*mt,yt+mt),ht[1].reverse(),ht[3].reverse(),nt.setStyle(rt),h=4;h--;){for(A=ht[h],p=A.length,lt||(mt=p>Ct?R/p:ut,bt=mt/2),d=p*mt,n=R,r=0;r<p;r+=1,d-=mt)c=mathAbs(R*mathSin(A[r].angle)),n<c?c=n:c<d&&(c=d),n=(A[r].oriY=c)-mt;for(o=alignments[h],s=R-(p-1)*mt,n=0,r=A.length-1;0<=r;r-=1,s+=mt)(_=A[r].point,W=_.graphics,D=_.config,z=D._textAttrs,H=D._textCss,null!==D.y&&z.text)&&(O=A[r].angle,g=D.sliced,C=W.label,c=mathAbs(R*mathSin(O)),c<n?c=n:c>s&&(c=s),n=c+mt,P=(c+A[r].oriY)/2,f=_t+xSign[h]*St*mathCos(math.asin(P/R)),P*=ySign[h],P+=At,F=At+Ot*mathSin(O),u=_t+kt*mathCos(O),(2>h&&f<u||1<h&&f>u)&&(f=u),m=f+Pt[h],x=P+bt-2,b=m+Pt[h],z._x=b,ct&&(a=1<h?b-J:J+K-b,nt.setStyle(D.style),at=pluckNumber(mathCeil(parseFloat(D.style.lineHeight)),12)+(2*mathCeil(parseFloat(D.style.border),12)||0),w=nt.getSmartText(D.displayValue,a,at),z.text=w.text,z.tooltip=w.tooltext),O<pi&&(P+=It,F+=It,x+=It),z._y=x,g&&(v=D.transX,T=D.transY,m+=v,f+=v,u+=v,P+=T,F+=T,b+=v),z.visibility=VISIBLE,z['text-anchor']=o,z.x=b,z.y=P,z.opacity=1,H.cursor=D.labellink?'pointer':'',B=W.label,C=vt.setAnimation({el:B||'text',attr:z,css:H,container:Tt,component:U,label:'label'}),C.data('textPos',{x:b,y:P}).data('plotItem',z.plotItem).data(EVENTARGS,z.eventArgs),B||(W.label=C,C.on('fc-dragstart',plotDragStart).on('fc-dragmove',plotDragMove).on('fc-dragend',plotDragEnd).on('fc-click',labelClickFn.bind(C,X,_.config.labellink)).on('fc-click',plotClickHandler(U,C)).on('fc-mouseover',plotRollOver).on('fc-mouseout',plotRollOut)),C.x=z._x,C._x=z._x,C.y=z._y,z.tooltip&&(V.enableToolTip(C,z.tooltip),delete z.tooltip),0<dt&&pt&&Bt&&(E=W.connector,D.connectorPath=Y=[M,u,F,L,Ft?f:u,P,m,P],e={path:Y,"stroke-width":pt,stroke:ot.connectorColor||'#606060',opacity:1,visibility:VISIBLE},E&&vt.setAnimation({el:E,attr:e,label:'connector',component:U})))}}}_parsePie3DOptions(){var t=this,e=t.config;return{size:2*e.pieMinRadius,slicedOffset:e.slicingDistance,allowPointSelect:!0,cursor:POINTER,innerSize:'pie3d'===t.getName()?0:_getInnerSize.call(t)}}_parseBorderConfig(t,e,n){var o=this,r=o.config,a=r.pieBorderColor,i=o.getFromEnv('chart-attrib'),l=pluck(n.bordercolor,a),c=pluck(n.borderalpha,i.plotborderalpha,i.pieborderalpha);return l=pluck(l,getLightColor(t,90)).split(COMMASTRING)[0],c=i.showplotborder==ZEROSTRING?ZEROSTRING:pluck(c,e,'80'),{setPlotBorderColor:l,setPlotBorderAlpha:c}}_initPie3dManager(){var t,e,n,o,r,a,l,c,s,d,p,h,g,f=this,u=f.getFromEnv('chart'),m=u.config,b=0,P=f.config,F=f.components,x=P.dataLabelOptions,A=P.pie3DOptions=f._parsePie3DOptions(),_=pluck(P.startAngle,0)%pi2,k=P.managedPieSliceDepth,O=P.slicedOffset=A.slicedOffset,S=m.canvasWidth,y=m.canvasHeight,C=[m.canvasLeft+.5*S,m.canvasTop+.5*y-.5*k],B=F.data,I=mathMin(S,y),v=x.distance,T=P.pieYScale,w=P.slicedOffsetY||(P.slicedOffsetY=O*P.pieYScale),D=f.getFromEnv('pie3DManager');for(C.push(2*P.pieMinRadius,A.innerSize||0),C=map(C,function(t,e){return p=/%$/.test(t),p?[S,y-k,I,I][e]*pInt(t)/100:t}),C[2]/=2,C[3]/=2,C.push(C[2]*T),C.push((C[2]+C[3])/2),C.push(C[5]*T),f.getX=function(t,e){return l=math.asin((t-C[1])/(C[2]+v)),C[0]+(e?-1:1)*(mathCos(l)*(C[2]+v))},P.center=C,fcEach(B,function(t){b+=t.config.y}),P.labelsRadius=C[2]+v,P.labelsRadiusY=P.labelsRadius*T,P.quadrantHeight=(y-k)/2,P.quadrantWidth=S/2,c=_,c=mathRound(1000*c)/1000,s=c+pi2,n=pluckNumber(parseInt(x.style.fontSize,10),10)+4,P.maxLabels=mathFloor(P.quadrantHeight/n),P.labelFontSize=n,P.connectorPadding=pluckNumber(x.connectorPadding,5),P.isSmartLineSlanted=pluck(x.isSmartLineSlanted,!0),P.connectorWidth=pluckNumber(x.connectorWidth,1),P.enableSmartLabels=x.enableSmartLabels,D||(D=new Pie3DManager(u),f.attachChild(D,'pie3DManager',!1),f.addToEnv('pie3DManager',D)),f._configurePie3DManager(),t=B.length-1;0<=t;t-=1)e=B[t],r=e.config,o=c,d=b?r.y/b:0,c=mathRound(1000*(c+d*pi2))/1000,c>s&&(c=s),a=c,r.shapeArgs={sAngle:mathRound(1000*o)/1000,eAngle:mathRound(1000*a)/1000},r.centerAngle=l=(a+o)/2%pi2,r.slicedTranslation=[mathRound(mathCos(l)*O),mathRound(mathSin(l)*w)],h=mathCos(l)*C[2],P.radiusY=g=mathSin(l)*C[4],r.tooltipPos=[C[0]+.7*h,C[1]+g],r.percentage=100*d,r.total=b}_configurePie3DManager(){var t=this,e=t.config,n=t.components,o=t.getFromEnv('pie3DManager'),r=n.data;o&&o.configure(e.pieSliceDepth,1===r.length,e.use3DLighting,!1)}allocatePosition(){var t,e,n,o,r,a,l,c,s=this,d=s.getFromEnv('chart'),p=d.config,h=s.config,g=s.components.data,f=pluck(h.startAngle,0)%pi2,u=f,m=h.pie3DOptions=s._parsePie3DOptions(),b=h.pieYScale,P=h.managedPieSliceDepth,F=p.canvasWidth,x=p.canvasHeight,A=mathMin(F,x),_=[p.canvasLeft+.5*F,p.canvasTop+.5*x-.5*P],k=0,O=g.length;for(_.push(2*h.pieMinRadius,m.innerSize||0),_=map(_,function(t,e){return l=/%$/.test(t),l?[F,x-P,A,A][e]*pInt(t)/100:t}),_[2]/=2,_[3]/=2,_.push(_[2]*b),_.push((_[2]+_[3])/2),_.push(_[5]*b),h.center=_,fcEach(g,function(t){k+=t.config.y}),u=mathRound(1000*u)/1000,c=u+pi2,t=g.length-1;0<=t;t-=1)r=g[t],n=u,a=k?r.config.y/k:0,u=mathRound(1000*(u+a*pi2))/1000,u>c&&(u=c),o=u,r.config.shapeArgs={sAngle:mathRound(1000*n)/1000,eAngle:mathRound(1000*o)/1000};for(t=0;t<O;t++)e=g[t],s.parsePlotAttributes(e,t),s.parseLabelAttributes(e,t)}parsePlotAttributes(t,e){var n,o,r,a,l,c,s,d,p,h,g,f,u,m,b,P,F,x,A,_,k,O=this,S=O.components,y=O.config,C=O.getFromEnv('chart'),B=C.config,I=S.data,v=y.dataLabelOptions,T=v.style,w=y.slicingDistance,D=y.slicedOffsetY||(y.slicedOffsetY=w*y.pieYScale),W=y.showBorderEffect,E=I.length,Y=y.usePerPointLabelColor,L=B.textDirection,R=e,i={},G=B.dataLabelStyle;n=y.center,k=y.prevPositions||n,o=y.pieYScale,u=t.config,(F=u._textAttrs)||(F=u._textAttrs={}),(x=u._textCss)||(x=u._textCss={}),l=u.y,c=u.displayValue,d=u.sliced,g=u.shapeArgs,p=u.centerAngle,f=u.toolText,s=!!u.link,T=u.style;null===l||l===UNDEF||(A={sAngle:g.sAngle,eAngle:g.eAngle,r:P?k[2]:n[2],innerR:P?k[3]:n[3],cx:P?k[0]:n[0],cy:P?k[1]:n[1],radiusYFactor:o,opacity:1},c===UNDEF?F.text='':(T?(!(x=u._textCss)&&(x=u._textCss={}),x.fontFamily=T.fontFamily,x.fontSize=T.fontSize,x.lineHeight=T.lineHeight,x.fontWeight=T.fontWeight,x.fontStyle=T.fontStyle):u._textCss&&(m&&m.removeCSS(),delete u._textCss,x=UNDEF),u.style=T||(T=G),F.text=c,F.fill=(Y?toRaphaelColor(u.color):T.color)||'#000000',F['text-bound']=[T.backgroundColor,T.borderColor,T.borderThickness,T.borderPadding,T.borderRadius,T.borderDash],F.direction=L,F.lineHeight=T.lineHeight,m&&x&&(delete x.fontFamily,delete x.fontSize,delete x.lineHeight,delete x.fontWeight,delete x.fontStyle,x=UNDEF),0<v.distance&&(h=v.connectorWidth)&&v.enableSmartLabels&&(_={"stroke-width":h,stroke:v.connectorColor||'#606060',cursor:s?POINTER:'',opacity:1})),u.plotItem=a={chart:C,index:R,seriesData:y,value:l,angle:u.angle=p,link:u.link,shapeArgs:g,slicedX:d&&!y.singletonCase?mathCos(p)*w:0,slicedY:d&&!y.singletonCase?mathSin(p)*D:0,sliced:d,labelText:c,name:u.name,percentage:u.percentage,toolText:f,originalIndex:E-R-1,style:u.style,transX:u.transX=mathCos(p)*w,transY:u.transY=mathSin(p)*D,slicedTranslation:u.slicedTranslation='t'+u.transX+','+u.transY,label:m,connector:b},u.eventArgs=r={index:y.reversePlotOrder?E-1-R:R,link:u.link,value:u.y,displayValue:u.displayValueArgs,categoryLabel:u.categoryLabel,isSliced:u.sliced,toolText:u.toolText},i={color:u.color.color.split(',')[0],alpha:u._3dAlpha,borderWidth:u.borderWidth,borderColor:u.borderColor,borderAlpha:u.borderConfig.setPlotBorderAlpha},extend2(A,i),A.cursor=s?POINTER:'',A.showBorderEffect=W,A.transform='t'+a.slicedX+','+a.slicedY,F.plotItem=a,F[EVENTARGS]=r,u.props={element:{attr:A},connector:{attr:_},label:{attr:F,css:x}})}draw(){var t,e,n,o,r,a,l,c,s,d,p,h,g,f,u,m,b,P,F,x,A,_,k,O,S,y,C,B,I,v,T=this,w=T.components,D=T.config,W=T.getFromEnv('chart'),E=W.config,Y=W.getFromEnv('animationManager'),L=w.data,R=D.dataLabelOptions,G=R.style,M=D.slicingDistance,H=D.slicedOffsetY||(D.slicedOffsetY=M*D.pieYScale),j=D.showBorderEffect,z=L.length,U=D.usePerPointLabelColor,X=E.textDirection,V=D.valueTotal,q=w.removeDataArr||[],N=T.getState('visible'),Z=T.getContainer('labelGroup'),Q={},J=T.getFromEnv('toolTipController'),$=function(){Z.show(),T.placeDataLabels(!1)},K=E.dataLabelStyle;for(T.getContainer('pie-groups')||T._createContainer(),Z=T.getContainer('label-group'),x=T.getContainer('plot-group'),Y.setAnimation({el:Z,attr:{css:K},component:T,label:'labelcontainer',callback:function(){N&&V?(Z.show(),x.show()):(Z.hide(),x.hide())}}),T._initPie3dManager(),n=T.getFromEnv('pie3DManager'),q.length&&T.remove(),t=D.center,v=D.prevPositions||t,e=D.pieYScale,L&&z||(L=[]),F=-1;++F<z;)if(a=L[F],u=a.config,(k=u._textAttrs)||(k=u._textAttrs={}),m=a.graphics,l=u.y,c=u.displayValue,d=u.sliced,g=u.shapeArgs,p=u.centerAngle,f=u.toolText,s=!!u.link,G=u.style,null!==l&&l!==UNDEF){for(B in _=m.element,b=m.label,P=m.connector,S={sAngle:g.sAngle,eAngle:g.eAngle,r:A?v[2]:t[2],innerR:A?v[3]:t[3],cx:A?v[0]:t[0],cy:A?v[1]:t[1],radiusYFactor:e,opacity:1},_?C=!1:(C=!0,_=m.element=n.useSliceFromPool(),!_&&(_=m.element=n.createSlice().drag(plotDragMove,plotDragStart,plotDragEnd).on('fc-mouseover',plotRollOver).on('fc-mouseout',plotRollOut),_.on('fc-click',plotClickHandler(T,_)))),c!==UNDEF&&(G?(!(O=u._textCss)&&(O=u._textCss={}),O.fontFamily=G.fontFamily,O.fontSize=G.fontSize,O.lineHeight=G.lineHeight,O.fontWeight=G.fontWeight,O.fontStyle=G.fontStyle):u._textCss&&(b&&b.removeCSS(),delete u._textCss,O=UNDEF),u.style=G||(G=K),k.text=c,k.fill=(U?toRaphaelColor(u.color):G.color)||'#000000',k['text-bound']=[G.backgroundColor,G.borderColor,G.borderThickness,G.borderPadding,G.borderRadius,G.borderDash],k.direction=X,k.lineHeight=G.lineHeight,b&&O&&(Y.setAnimation({el:b,attr:{css:O},component:T}),delete O.fontFamily,delete O.fontSize,delete O.lineHeight,delete O.fontWeight,delete O.fontStyle,O=UNDEF),0<R.distance&&(h=R.connectorWidth)&&R.enableSmartLabels&&(y={"stroke-width":h,stroke:R.connectorColor||'#606060',cursor:s?POINTER:'',opacity:1},Z.show(),P=m.connector=Y.setAnimation({el:m.connector||'path',attr:y,container:Z,label:'connector',component:T}).show().on('fc-dragstart',plotDragStart).on('fc-dragmove',plotDragMove).on('fc-dragend',plotDragEnd).on('fc-mouseover',plotRollOver).on('fc-mouseout',plotRollOut))),V?(b&&b.show(),P&&P.show()):(b&&b.hide(),P&&P.hide()),r={chart:W,index:F,seriesData:D,value:l,angle:u.angle=p,link:u.link,shapeArgs:g,slicedX:d&&!D.singletonCase?mathCos(p)*M:0,slicedY:d&&!D.singletonCase?mathSin(p)*H:0,sliced:d,labelText:c,name:u.name,percentage:u.percentage,toolText:f,originalIndex:z-F-1,style:u.style,graphic:_,transX:u.transX=mathCos(p)*M,transY:u.transY=mathSin(p)*H,slicedTranslation:u.slicedTranslation='t'+u.transX+','+u.transY,label:b,connector:P},o={index:D.reversePlotOrder?z-1-F:F,link:u.link,value:u.y,displayValue:u.displayValueArgs,categoryLabel:u.categoryLabel,isSliced:u.sliced,toolText:u.toolText},Q={color:u.color.color.split(',')[0],alpha:u._3dAlpha,borderWidth:u.borderWidth,borderColor:u.borderColor,borderAlpha:u.borderConfig.setPlotBorderAlpha},C&&extend2(S,Q),_.data(GROUPID,F).data('plotItem',r).data(EVENTARGS,o),_.data(GROUPID,F).data('plotItem',r).data(EVENTARGS,o),S.cursor=s?POINTER:'',S.showBorderEffect=j,S.color=u.color.color.split(',')[0],S.alpha=u._3dAlpha,S.borderWidth=u.borderWidth,S.borderColor=u.borderColor,J.enableToolTip(_,f),I=_._confObject.elements,I)J.enableToolTip(I[B],f);S.transform='t'+r.slicedX+','+r.slicedY,k.plotItem=r,k[EVENTARGS]=o,Y.setAnimation({el:_,attr:S,component:T,label:'slice',state:C?'appearing':'updating'}),P&&P.data('plotItem',r).data(EVENTARGS,o)}$(),T.drawn=!0,D.prevPositions=t.slice(0)}remove(){var t,e,n,o,r,a=this,l=a.config,c=a.components,s=a.getFromEnv('animationManager'),d=c.removeDataArr||[],p=a.pool=a.pool=[],h=d.length,g=this.getFromEnv('pie3DManager'),f=function(t,e){return function(){e===elementStr?(g.removeSlice(t.element),delete t.element):t[e].hide()}},u=l.startAngle,m=l.center;for(o=0;o<h;o++){for(e in t=d[0],n=t.graphics,n)r=n[e],p[e]||(p[e]=[]),e===elementStr?s.setAnimation({el:r,attr:{sAngle:-u,eAngle:-u+.01,r:m[2],innerR:m[3],cx:m[0],cy:m[1]},component:a,callback:f(n,e)}):s.setAnimation({el:r,attr:{opacity:0},component:a,callback:f(n,e)});d.splice(0,1)}}_rotate(t){var e,n=this,o=n.config,r=n.getFromEnv('animationManager'),a=n.components,i=a.data,l=o.slicedOffset,c=o.slicedOffsetY,s=o.startAngle,d=n.getFromEnv('pie3DManager');t=isNaN(t)?-o._lastAngle:t,e=(t-s)%360,o.startAngle=pluckNumber(t,o.startAngle)%360,e=-(e*pi)/180,d&&d.rotate(e),fcEach(i,function(t){var o=[],a=t.graphics,i=t.config,s=a.element,d=i.shapeArgs,p={sAngle:d.sAngle+=e,eAngle:d.eAngle+=e},h=i.angle=normalizeAngle((p.sAngle+p.eAngle)/2),g=i.sliced,f=mathCos(h),u=mathSin(h);o=i.slicedTranslation=[mathRound(f*l),mathRound(u*c)],i.transX=o[0],i.transY=o[1],i.slicedX=g?mathCos(e)*l:0,i.slicedY=g?mathSin(e)*c:0,s&&g&&r.setAnimation({el:s,attr:{transform:'t'+o[0]+','+o[1]},component:n})}),n.placeDataLabels(!0,i)}foldingFn(){var t=this.config,e=t.startAngle;return{sAngle:-e,eAngle:-e+.01}}getType(){return'dataset'}getName(){return'pie3d'}}Raphael&&Raphael._availableAnimAttrs&&Raphael._availableAnimAttrs.cx&&(Raphael._availableAnimAttrs.innerR=Raphael._availableAnimAttrs.depth=Raphael._availableAnimAttrs.radiusYFactor=Raphael._availableAnimAttrs.sAngle=Raphael._availableAnimAttrs.eAngle=Raphael._availableAnimAttrs.cx),raphaelShapesLitepath(Raphael);class Pie3DManager extends ComponentInterface{constructor(t){super();var e=this;e.config={},e.linkedItems={chart:t}}getType(){return'pie3DManager'}getName(){return'pie3d'}createSlice(){let t,e=this,n=e.renderer,o={elements:{},Pie3DManager:e},r=e.slicingWallsArr,a=o.elements,i=hasSVG?'litepath':'path';return t=n[i](e.getContainer('topGroup')),t._confObject=o,o.thisElement=t,t._destroy=t.destroy,t.destroy=destroyFN,t._show=t.show,t.show=showFN,t._hide=t.hide,t.hide=hideFN,t._on=t.on,t.on=onFN,t._drag=t.drag,t.drag=onDragFN,t._attr=t.attr,t.attr=attrFN,t._data=t.data,t.data=dataFN,e.pointElemStore.push(t),a.topBorder=n[i](e.getContainer('topGroup')),a.bottom=n[i](e.getContainer('bottomBorderGroup')).attr({"stroke-width":0}),a.bottomBorder=n[i](e.getContainer('bottomBorderGroup')),a.frontOuter=n[i](e.getContainer('slicingWallsFrontGroup')).attr({"stroke-width":0}),a.backOuter=n[i](e.getContainer('slicingWallsFrontGroup')).attr({"stroke-width":0}),a.startSlice=n[i](e.getContainer('slicingWallsFrontGroup')),a.endSlice=n[i](e.getContainer('slicingWallsFrontGroup')),a.frontOuter1=n[i](e.getContainer('slicingWallsFrontGroup')).attr({"stroke-width":0}),a.frontOuter._conf={si:si,isStart:.5},a.frontOuter1._conf={si:si,isStart:.5},a.startSlice._conf={si:si,isStart:0},a.endSlice._conf={si:si,isStart:1},a.backOuter._conf={si:si,isStart:.4},r.push(a.startSlice,a.frontOuter1,a.frontOuter,a.backOuter,a.endSlice),e.isDoughnut&&(a.frontInner=n[i](e.getContainer('slicingWallsFrontGroup')).attr({"stroke-width":0}),a.backInner=n[i](e.getContainer('slicingWallsFrontGroup')).attr({"stroke-width":0}),a.backInner._conf={si:si,isStart:.5},a.frontInner._conf={si:si,isStart:.4},r.push(a.frontInner,a.backInner)),si+=1,t}refreshDrawing(){let t,e,n,o,r,a=this.slicingWallsArr,i=0,l=a.length,c=this.getContainer('slicingWallsFrontGroup'),s=this.getContainer('slicingWallsBackGroup');for(a.sort(elementZSortFn),e=getStartIndex(a);i<l;i+=1,e+=1)e===l&&(e=0),t=a[e],r=t._conf.index,r<piBy2?c.appendChild(t):r<=pi?(n?t.insertBefore(n):c.appendChild(t),n=t):r<=pi3By2?(o?t.insertBefore(o):s.appendChild(t),o=t):s.appendChild(t)}configure(t,e,n,o){var r=this,a=r.getLinkedParent(),i=r.getFromEnv('paper'),l=a.getContainer('plot-group');isObject(t)&&(t=t.depth,e=t.hasOnePoint,n=t.use3DLighting,o=t.isDoughnut),r.renderer||(r.renderer=i),r.hasOnePoint=e,r.use3DLighting=n,r.isDoughnut=o,r.depth=t,r.getContainer('bottomBorderGroup')||r.addContainer('bottomBorderGroup',i.group('bottom-border',l)),r.getContainer('bottomBorderGroup').attr({transform:'t0,'+t}),r.getContainer('slicingWallsBackGroup')||r.addContainer('slicingWallsBackGroup',i.group('slicingWalls-back-Side',l)),r.getContainer('slicingWallsFrontGroup')||r.addContainer('slicingWallsFrontGroup',i.group('slicingWalls-front-Side',l)),r.getContainer('topGroup')||r.addContainer('topGroup',i.group('top-Side',l)),r.pointElemStore||(r.pointElemStore=[]),r.slicingWallsArr||(r.slicingWallsArr=[]),r.moveCmdArr=[M],r.lineCmdArr=[L],r.closeCmdArr=[Z],r.colorObjs=[]}_parseSliceColor(t,e,n){var o,r,a,i,l,c,s,d,p,h,g,f,u,m,b,P,F,x,A,_,k=this,O=3,S=k.use3DLighting,y=S?pie3DCacheColorStore.lighting3D:pie3DCacheColorStore.lighting2D,C=n.radiusYFactor,B=n.cx,I=n.cy,v=n.r,T=n.innerR||0;return~t.indexOf('rgb')&&(t=rawRGBtoHEX(t)),e=e||100,g=e/2,y[t]&&y[t][e]?_=y[t][e]:(!y[t]&&(y[t]={}),!y[t][e]&&(y[t][e]={}),_=y[t][e],S?(o=getDarkColor(t,80),r=getDarkColor(t,75),c=getLightColor(t,85),s=getLightColor(t,70),d=getLightColor(t,40),p=getLightColor(t,50),h=getLightColor(t,65),a=getDarkColor(t,69),i=getDarkColor(t,75),l=getDarkColor(t,95)):(O=10,o=getDarkColor(t,90),r=getDarkColor(t,87),c=getLightColor(t,93),s=getLightColor(t,87),d=getLightColor(t,80),h=p=getLightColor(t,85),l=getDarkColor(t,85),a=getDarkColor(t,75),i=getDarkColor(t,80)),f=r+COMMASTRING+c+COMMASTRING+s+COMMASTRING+c+COMMASTRING+r,m=e+COMMASTRING+e+COMMASTRING+e+COMMASTRING+e+COMMASTRING+e,u=r+COMMASTRING+t+COMMASTRING+c+COMMASTRING+t+COMMASTRING+r,b=g+COMMASTRING+g+COMMASTRING+g+COMMASTRING+g+COMMASTRING+g,F=r+COMMASTRING+t+COMMASTRING+d+COMMASTRING+t+COMMASTRING+r,x=i+COMMASTRING+c+COMMASTRING+p+COMMASTRING+c+COMMASTRING+a,A='FFFFFF,FFFFFF,FFFFFF,FFFFFF,FFFFFF',P='0,'+g/O+COMMASTRING+e/O+COMMASTRING+g/O+COMMASTRING+0,_.top=hasSVG?{FCcolor:{gradientUnits:'userSpaceOnUse',radialGradient:!0,color:h+COMMASTRING+l,alpha:e+COMMASTRING+e,ratio:'0,100'}}:{FCcolor:{gradientUnits:'objectBoundingBox',color:s+COMMASTRING+s+COMMASTRING+c+COMMASTRING+r,alpha:e+COMMASTRING+e+COMMASTRING+e+COMMASTRING+e,angle:-72,ratio:'0,8,15,77'}},_.frontOuter={FCcolor:{gradientUnits:'userSpaceOnUse',y1:0,y2:0,color:x,alpha:m,angle:0,ratio:'0,20,15,15,50'}},_.backOuter={FCcolor:{gradientUnits:'userSpaceOnUse',y1:0,y2:0,color:F,alpha:b,angle:0,ratio:'0,62,8,8,22'}},_.frontInner={FCcolor:{gradientUnits:'userSpaceOnUse',y1:0,y2:0,color:u,alpha:b,angle:0,ratio:'0,25,5,5,65'}},_.backInner={FCcolor:{gradientUnits:'userSpaceOnUse',y1:0,y2:0,color:f,alpha:m,angle:0,ratio:'0,62,8,8,22'}},_.topBorder={FCcolor:{gradientUnits:'userSpaceOnUse',y1:0,y2:0,color:A,alpha:P,angle:0,ratio:'0,20,15,15,50'}},_.topInnerBorder={FCcolor:{gradientUnits:'userSpaceOnUse',y1:0,y2:0,color:A,alpha:P,angle:0,ratio:'0,50,15,15,20'}},_.bottom=toRaphaelColor(convertColor(t,g)),_.startSlice=toRaphaelColor(convertColor(o,e)),_.endSlice=toRaphaelColor(convertColor(o,e))),(_.cx!==B||_.cy!==I||_.rx!==v||_.radiusYFactor!==C||_.innerRx!==T)&&(hasSVG&&(_.top.FCcolor.cx=B,_.top.FCcolor.cy=I,_.top.FCcolor.r=v,_.top.FCcolor.fx=B-.3*v,_.top.FCcolor.fy=I+1.2*(v*C)),_.topBorder.FCcolor.x1=_.backOuter.FCcolor.x1=_.frontOuter.FCcolor.x1=B-v,_.topBorder.FCcolor.x2=_.backOuter.FCcolor.x2=_.frontOuter.FCcolor.x2=B+v,_.topInnerBorder.FCcolor.x1=_.backInner.FCcolor.x1=_.frontInner.FCcolor.x1=B-T,_.topInnerBorder.FCcolor.x2=_.backInner.FCcolor.x2=_.frontInner.FCcolor.x2=B+T,_.cx=B,_.cy=I,_.rx=v,_.radiusYFactor=C,_.innerRx=T),_}allocatePosition(){}rotate(t){var e,n,o=this,r=o.pointElemStore,a=0,i=r.length;if(!o.hasOnePoint){for(;a<i;a+=1)e=r[a],n=e._confObject,n.sAngle+=t,n.eAngle+=t,o._setSliceShape(n);o.refreshDrawing()}}removeSlice(t){var e,n,o,r=this,a=r.pointElemStore,i=t._confObject,l=i.elements,c=r.slicingWallsArr,s=a.length;for(e=s-1;0<=e;e-=1)n=a[e],n===t&&a.splice(e,1);for(s=c.length,e=s-1;0<=e;e-=1)o=c[e],(o===l.startSlice||o===l.frontOuter1||o===l.frontOuter||o===l.backInner||o===l.endSlice)&&c.splice(e,1);t.hide&&t.hide(),r._slicePool||(r._slicePool=[]),r._slicePool.push(t),r.refreshDrawing()}useSliceFromPool(){var t,e=this,n=e._slicePool||(e._slicePool=[]),o=e.slicingWallsArr,r=!1;return n.length&&(r=n.shift(),e.pointElemStore.push(r),r.show(),t=r._confObject.elements,o.push(t.startSlice,t.frontOuter1,t.frontOuter),t.backInner&&o.push(t.backInner),o.push(t.endSlice)),r}_setSliceShape(t,e){var n,o,r,a,i,l,c,s,d,p,h,g,f,u,m,b,P,F,x,_,k,O,S,y,C,B,I,v,T,w,D,W,E,Y,R,G,H,j,z,U,X,q,N,Q=this,J=function(t,e,n,o,r,a,i,l){return t==n&&e==o?[]:[A,r,a,0,l,i,n,o]},$=t.sAngle,K=t.eAngle,tt=normalizeAngle($),et=normalizeAngle(K),nt=Q.isDoughnut,ot=t.radiusYFactor,rt=t.cx,at=t.cy,it=t.r,lt=it*ot,ct=it+(hasSVG?-1:2),st=lt+(hasSVG?-1:2),dt=t.innerR||0,pt=dt*ot,ht=Q.depth,gt=ht+at,ft=rt+it,ut=rt-it,mt=rt+dt,bt=rt-dt,Pt=at-lt,Ft=[M,bt,Pt,L,bt,gt+lt,Z],xt=t.elements,At='path',_t=(tt+et)/2;o=mathCos(tt),r=mathSin(tt),a=mathCos(et),i=mathSin(et),l=rt+it*o,c=at+lt*r,s=rt+ct*o,d=at+st*r,F=c+ht,x=rt+it*a,_=at+lt*i,p=rt+ct*a,h=at+st*i,k=_+ht,nt?(g=rt+dt*o,f=at+pt*r,b=f+ht,u=rt+dt*a,m=at+pt*i,P=m+ht,t.startSlice=[M,l,c,L,l,F,g,b,g,f,Z],t.endSlice=[M,x,_,L,x,k,u,P,u,m,Z]):(t.startSlice=[M,l,c,L,l,F,rt,gt,rt,at,Z],t.endSlice=[M,x,_,L,x,k,rt,gt,rt,at,Z]),hasSVG?(n=getAbsScaleAngle(tt,et),t.clipTopPath=nt?[[M,l,c,A,it,lt,0,n>pi?1:0,1,x,_,L,u,m,A,dt,pt,0,n>pi?1:0,0,g,f,Z]]:[[M,l,c,A,it,lt,0,n>pi?1:0,1,x,_,L,rt,at,Z]],t.clipOuterFrontPath1=[Ft],t.clipTopBorderPath=[[M,s,d,A,ct,st,0,n>pi?1:0,1,p,h,L,x,_,x,_+1,A,it,lt,0,n>pi?1:0,0,l,c+1,L,l,c,Z]],$==K?t.clipOuterFrontPath=t.clipOuterBackPath=t.clipInnerBackPath=t.clipInnerFrontPath=[Ft]:tt>et?tt<pi?(t.clipOuterFrontPath=[[M,ft,at,A,it,lt,0,0,1,x,_,V,ht,A,it,lt,0,0,0,ft,at+ht,Z]],t.clipOuterFrontPath1=[[M,ut,at,A,it,lt,0,0,0,l,c,V,ht,A,it,lt,0,0,1,ut,at+ht,Z]],t.clipOuterBackPath=[[M,ft,at,A,it,lt,0,1,0,ut,at,V,ht,A,it,lt,0,1,1,ft,at+ht,Z]],nt&&(t.clipInnerBackPath=[[M,mt,at,A,dt,pt,0,1,0,bt,at,V,ht,A,dt,pt,0,1,1,mt,at+ht,Z]],t.clipInnerFrontPath=[[M,mt,at,A,dt,pt,0,0,1,u,m,V,ht,A,dt,pt,0,0,0,mt,at+ht,Z,M,bt,at,A,dt,pt,0,0,0,g,f,V,ht,A,dt,pt,0,0,1,bt,at+ht,Z]])):et>pi?(t.clipOuterFrontPath=[[M,ft,at,A,it,lt,0,1,1,ut,at,V,ht,A,it,lt,0,1,0,ft,at+ht,Z]],t.clipOuterBackPath=[[M,ut,at,A,it,lt,0,0,1,x,_,V,ht,A,it,lt,0,0,0,ut,at+ht,Z,M,ft,at,A,it,lt,0,0,0,l,c,V,ht,A,it,lt,0,0,1,ft,at+ht,Z]],nt&&(t.clipInnerFrontPath=[[M,mt,at,A,dt,pt,0,1,1,bt,at,V,ht,A,dt,pt,0,1,0,mt,at+ht,Z]],t.clipInnerBackPath=[[M,bt,at,A,dt,pt,0,0,1,u,m,V,ht,A,dt,pt,0,0,0,bt,at+ht,Z,M,mt,at,A,dt,pt,0,0,0,g,f,V,ht,A,dt,pt,0,0,1,mt,at+ht,Z]])):(t.clipOuterFrontPath=[[M,ft,at,A,it,lt,0,0,1,x,_,V,ht,A,it,lt,0,0,0,ft,at+ht,Z]],t.clipOuterBackPath=[[M,l,c,A,it,lt,0,0,1,ft,at,V,ht,A,it,lt,0,0,0,l,F,Z]],nt&&(t.clipInnerFrontPath=[[M,mt,at,A,dt,pt,0,0,1,u,m,V,ht,A,dt,pt,0,0,0,mt,at+ht,Z]],t.clipInnerBackPath=[[M,g,f,A,dt,pt,0,0,1,mt,at,V,ht,A,dt,pt,0,0,0,g,b,Z]])):tt<pi?et>pi?(t.clipOuterFrontPath=[[M,l,c,A,it,lt,0,0,1,ut,at,V,ht,A,it,lt,0,0,0,l,F,Z]],t.clipOuterBackPath=[[M,ut,at,A,it,lt,0,0,1,x,_,V,ht,A,it,lt,0,0,0,ut,at+ht,Z]],nt&&(t.clipInnerFrontPath=[[M,g,f,A,dt,pt,0,0,1,bt,at,V,ht,A,dt,pt,0,0,0,g,b,Z]],t.clipInnerBackPath=[[M,bt,at,A,dt,pt,0,0,1,u,m,V,ht,A,dt,pt,0,0,0,bt,at+ht,Z]])):(t.clipOuterFrontPath=[[M,l,c,A,it,lt,0,0,1,x,_,V,ht,A,it,lt,0,0,0,l,F,Z]],t.clipOuterBackPath=[Ft],nt&&(t.clipInnerFrontPath=[[M,g,f,A,dt,pt,0,0,1,u,m,V,ht,A,dt,pt,0,0,0,g,b,Z]],t.clipInnerBackPath=[Ft])):(t.clipOuterFrontPath=[Ft],t.clipOuterBackPath=[[M,l,c,A,it,lt,0,0,1,x,_,V,ht,A,it,lt,0,0,0,l,F,Z]],nt&&(t.clipInnerFrontPath=[Ft],t.clipInnerBackPath=[[M,g,f,A,dt,pt,0,0,1,u,m,V,ht,A,dt,pt,0,0,0,g,b,Z]])),At='litepath',t.clipBottomBorderPath=t.clipTopPath,t.startSlice=[t.startSlice],t.endSlice=[t.endSlice]):(v=Q.moveCmdArr,T=Q.lineCmdArr,w=Q.closeCmdArr,D=[rt,at],W=[ut,at],E=[rt,Pt],Y=[ft,at],R=[rt,at+lt],G=[ut,gt],H=[ft,gt],j=[bt,at],z=[mt,at],U=[bt,gt],X=[mt,gt],t.clipOuterFrontPath1=[],$==K?(t.clipTopPath=t.clipOuterFrontPath=t.clipOuterBackPath=[],nt&&(t.clipInnerFrontPath=t.clipInnerBackPath=[])):(tt>et?tt<pi?(O=J(l,c,ut,at,it,lt,1,0),y=J(ut,at,ft,at,it,lt,1,0),B=J(ft,at,x,_,it,lt,1,0),t.clipOuterBackPath=v.concat(W,y,T,H,J(ft,gt,ut,gt,it,lt,0,0),w),t.clipOuterFrontPath1=v.concat([l,c],O,T,G,J(ut,gt,l,F,it,lt,0,0),w),t.clipOuterFrontPath=v.concat(Y,B,T,[x,k],J(x,k,ft,gt,it,lt,0,0),w),t.clipTopBorderPath=v.concat([l,c],O,y,B),nt?(S=J(u,m,mt,at,dt,pt,0,0),C=J(mt,at,bt,at,dt,pt,0,0),I=J(bt,at,g,f,dt,pt,0,0),t.clipInnerBackPath=v.concat(z,C,T,U,J(bt,gt,mt,gt,dt,pt,1,0),w),t.clipInnerFrontPath=v.concat(j,I,T,[g,b],J(g,b,bt,gt,dt,pt,1,0),w,v,[u,m],S,T,X,J(mt,gt,u,P,dt,pt,1,0),w),t.clipTopPath=t.clipTopBorderPath.concat(T,[u,m],S,C,I,w),t.clipTopBorderPath=t.clipTopBorderPath.concat(v,[u,m],S,C,I)):t.clipTopPath=t.clipTopBorderPath.concat(T,D,w)):et>pi?(O=J(l,c,ft,at,it,lt,1,0),y=J(ft,at,ut,at,it,lt,1,0),B=J(ut,at,x,_,it,lt,1,0),t.clipOuterFrontPath=v.concat(Y,y,T,G,J(ut,gt,ft,gt,it,lt,0,0),w),t.clipOuterBackPath=v.concat([l,c],O,T,H,J(ft,gt,l,F,it,lt,0,0),w,v,W,B,T,[x,k],J(x,k,ut,gt,it,lt,0,0),w),t.clipTopBorderPath=v.concat([l,c],O,y,B),nt?(S=J(u,m,bt,at,dt,pt,0,0),C=J(bt,at,mt,at,dt,pt,0,0),I=J(mt,at,g,f,dt,pt,0,0),t.clipInnerFrontPath=v.concat(j,C,T,X,J(mt,gt,bt,gt,dt,pt,1,0),w),t.clipInnerBackPath=v.concat(z,I,T,[g,b],J(g,b,mt,gt,dt,pt,1,0),w,v,[u,m],S,T,U,J(bt,gt,u,P,dt,pt,1,0),w),t.clipTopPath=t.clipTopBorderPath.concat(T,[u,m],S,C,I,w),t.clipTopBorderPath=t.clipTopBorderPath.concat(v,[u,m],S,C,I)):t.clipTopPath=t.clipTopBorderPath.concat(T,D,w)):(O=J(l,c,ft,at,it,lt,1,0),y=J(ft,at,x,_,it,lt,1,0),t.clipOuterFrontPath=v.concat(Y,y,T,[x,k],J(x,k,ft,gt,it,lt,0,0),w),t.clipOuterBackPath=v.concat([l,c],O,T,H,J(ft,gt,l,F,it,lt,0,0),w),t.clipTopBorderPath=v.concat([l,c],O,y),nt?(S=J(u,m,mt,at,dt,pt,0,0),C=J(mt,at,g,f,dt,pt,0,0),t.clipInnerFrontPath=v.concat([u,m],S,T,X,J(mt,gt,u,P,dt,pt,1,0),w),t.clipInnerBackPath=v.concat(z,C,T,[g,b],J(g,b,mt,gt,dt,pt,1,0),w),t.clipTopPath=t.clipTopBorderPath.concat(T,[u,m],S,C,w),t.clipTopBorderPath=t.clipTopBorderPath.concat(v,[u,m],S,C)):t.clipTopPath=t.clipTopBorderPath.concat(T,D,w)):tt<pi?et>pi?(O=J(l,c,ut,at,it,lt,1,0),y=J(ut,at,x,_,it,lt,1,0),t.clipOuterBackPath=v.concat(W,y,T,[x,k],J(x,k,ut,gt,it,lt,0,0),w),t.clipOuterFrontPath=v.concat([l,c],O,T,G,J(ut,gt,l,F,it,lt,0,0),w),t.clipTopBorderPath=v.concat([l,c],O,y),nt?(S=J(u,m,bt,at,dt,pt,0,0),C=J(bt,at,g,f,dt,pt,0,0),t.clipInnerBackPath=v.concat([u,m],S,T,U,J(bt,gt,u,P,dt,pt,1,0),w),t.clipInnerFrontPath=v.concat(j,C,T,[g,b],J(g,b,bt,gt,dt,pt,1,0),w),t.clipTopPath=t.clipTopBorderPath.concat(T,[u,m],S,C,w),t.clipTopBorderPath=t.clipTopBorderPath.concat(v,[u,m],S,C)):t.clipTopPath=t.clipTopBorderPath.concat(T,D,w)):(O=J(l,c,x,_,it,lt,1,0),t.clipOuterBackPath=v.concat([l,c]),t.clipTopBorderPath=t.clipOuterBackPath.concat(O),t.clipOuterFrontPath=t.clipTopBorderPath.concat(T,[x,k],J(x,k,l,F,it,lt,0,0),w),nt?(S=J(u,m,g,f,dt,pt,0,0),t.clipInnerBackPath=v.concat([u,m]),t.clipTopPath=t.clipTopBorderPath.concat(T,[u,m],S,w),t.clipTopBorderPath=t.clipTopBorderPath.concat(v,[u,m],S),t.clipInnerFrontPath=t.clipInnerBackPath.concat(S,T,[g,b],J(g,b,u,P,dt,pt,1,0),w)):t.clipTopPath=t.clipTopBorderPath.concat(T,D,w)):(O=J(l,c,x,_,it,lt,1,0),t.clipOuterFrontPath=v.concat([l,c]),t.clipTopBorderPath=t.clipOuterFrontPath.concat(O),t.clipOuterBackPath=t.clipTopBorderPath.concat(T,[x,k],J(x,k,l,F,it,lt,0,0),w),nt?(S=J(u,m,g,f,dt,pt,0,0),t.clipInnerFrontPath=v.concat([u,m]),t.clipTopPath=t.clipTopBorderPath.concat(T,[u,m],S,w),t.clipTopBorderPath=t.clipTopBorderPath.concat(t.clipInnerFrontPath,S),t.clipInnerBackPath=t.clipInnerFrontPath.concat(S,T,[g,b],J(g,b,u,P,dt,pt,1,0),w)):t.clipTopPath=t.clipTopBorderPath.concat(T,D,w)),O=v.concat(W,T,Y),S=v.concat(E,T,R),t.clipTopPath=t.clipTopPath.concat(O,S),t.clipOuterFrontPath=t.clipOuterFrontPath.concat(O),t.clipOuterFrontPath1=t.clipOuterFrontPath1.concat(O),t.clipOuterBackPath=t.clipOuterBackPath.concat(O),nt&&(S=v.concat(j,T,z),t.clipInnerFrontPath=t.clipInnerFrontPath.concat(S),t.clipInnerBackPath=t.clipInnerBackPath.concat(S))),t.clipBottomBorderPath=t.clipTopBorderPath),e||(xt.startSlice._conf.index=tt,xt.endSlice._conf.index=et,xt.backOuter._conf.index=N=tt>et&&(tt<=pi3By2||et>pi3By2)||tt<=pi3By2&&et>pi3By2?pi3By2:tt>pi?tt:et,xt.frontOuter._conf.index=q=et<=piBy2?et:tt>et||tt<=piBy2?piBy2:tt,xt.frontOuter1._conf.index=tt,xt.frontOuter1._conf.cIndex=pi,tt>et?(xt.backOuter._conf.cIndex=tt<pi3By2?pi3By2:pi2,xt.startSlice._conf.cIndex=tt<pi?(tt+pi)/2:(tt+pi2)/2,xt.endSlice._conf.cIndex=xt.frontOuter._conf.cIndex=0):xt.backOuter._conf.cIndex=xt.startSlice._conf.cIndex=xt.endSlice._conf.cIndex=xt.frontOuter._conf.cIndex=_t,n>pi?xt.frontOuter1.show().attr(At,t.clipOuterFrontPath1):xt.frontOuter1.hide(),t.thisElement._attr(At,t.clipTopPath),xt.bottom.attr(At,t.clipTopPath),xt.bottomBorder.attr(At,t.clipBottomBorderPath),xt.topBorder&&xt.topBorder.attr(At,t.clipTopBorderPath),xt.frontOuter.attr(At,t.clipOuterFrontPath),xt.backOuter.attr(At,t.clipOuterBackPath),nt&&(xt.backInner.attr(At,t.clipInnerBackPath),xt.frontInner.attr(At,t.clipInnerFrontPath),xt.backInner._conf.index=N,xt.frontInner._conf.index=q,tt>et?(xt.backInner._conf.cIndex=pi2,xt.frontInner._conf.cIndex=0):xt.backInner._conf.cIndex=xt.frontInner._conf.cIndex=_t),Q.hasOnePoint?(xt.startSlice.hide(),xt.endSlice.hide()):(xt.startSlice.attr(At,t.startSlice).show(),xt.endSlice.attr(At,t.endSlice).show()))}_setSliceCosmetics(t){var e,n,o=this,r=t.thisElement,a=t.showBorderEffect,i=t.elements,l=convertColor(t.borderColor,pluckNumber(t.borderAlpha,t.alpha)),c=t.borderWidth;t.color&&(t.color=t.color.color?t.color.color:t.color,e=o._parseSliceColor(t.color,t.alpha,t),hasSVG?(n={fill:toRaphaelColor(e.top),"stroke-width":0},a?i.topBorder.show().attr({fill:toRaphaelColor(e.topBorder),"stroke-width":0}):(i.topBorder.hide(),n.stroke=l,n['stroke-width']=c),r._attr(n)):(r._attr({fill:toRaphaelColor(e.top),"stroke-width":0}),i.topBorder.attr({stroke:l,"stroke-width":c})),i.bottom.attr({fill:toRaphaelColor(e.bottom)}),i.bottomBorder.attr({stroke:l,"stroke-width":c}),i.frontOuter.attr({fill:toRaphaelColor(e.frontOuter)}),i.frontOuter1.attr({fill:toRaphaelColor(e.frontOuter)}),i.backOuter.attr({fill:toRaphaelColor(e.backOuter)}),i.startSlice.attr({fill:toRaphaelColor(e.startSlice),stroke:l,"stroke-width":c}),i.endSlice.attr({fill:toRaphaelColor(e.endSlice),stroke:l,"stroke-width":c}),o.isDoughnut&&(i.frontInner.attr({fill:toRaphaelColor(e.frontInner)}),i.backInner.attr({fill:toRaphaelColor(e.backInner)})))}}export default Pie3DDataset;