UNPKG

angular-sunburst-radar-chart

Version:
16 lines (14 loc) 24.5 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("angular-sunburst-radar-chart",["exports","@angular/core","@angular/common"],e):e((t=t||self)["angular-sunburst-radar-chart"]={},t.ng.core,t.ng.common)}(this,(function(t,e,n){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function i(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function o(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function a(t){var e=0;t=s(t);for(var n=JSON.stringify(t),r=0;r<n.length;r++)e=Math.imul(31,e)+n.charCodeAt(r)|0;return e}function s(t){return t||{}}function l(t){var e=(t=t||{name:"",value:""}).name.length>0?"-":"";return t.name+e+t.value}function d(){for(var t="#",e=0;e<6;e++)t+="0123456789ABCDEF"[Math.floor(16*Math.random())];return t}function u(t,e){var n=o([e.x,e.y],2);return"rotate("+t+" "+n[0]+" "+n[1]+")"}function h(t){return{name:"circle",options:t=r(r({},{x:0,y:0,radius:0,fillColor:"none","stroke-width":"1",stroke:"#000000","stroke-dasharray":"none","stroke-opacity":"1",title:""}),s(t)),children:[]}}function c(t){return{name:"line",options:t=r(r({},{x1:0,y1:0,x2:0,y2:0,color:"#000000",width:"2",title:""}),s(t)),children:[]}}function p(t){(t=r(r({},{d:"",fill:"none",stroke:"none","stroke-width":"0",title:"",id:null}),s(t))).d,t.color,t.borderColor;return{name:"path",options:t,children:[]}}function f(t){(t=r(r({},{d:"",fill:"none",stroke:"none","stroke-width":"0","stroke-opacity":"1.0","fill-opacity":"1.0",title:"",id:null}),s(t))).d,t.color,t.borderColor;var e=t.fill;return e=e.replace("#",""),t.gradientId=e,t.fillUrl="url(#"+e+")",{name:"path-bar",options:t,children:[]}}function m(t,e,n,r){var i=(r-90)*Math.PI/180;return{x:t+n*Math.cos(i),y:e+n*Math.sin(i)}}function g(t,e){return e-t<=180?"0":"1"}function x(t){var e=t.plotMax,n=t.actualScore,r=t.maxScore;return n>r&&(n=r),n*(e/r)}function v(t){var e=t.item,n=t.startAngle,r=t.endAngle,i=t.middleAngle,a=t.color,s=t.middleRadius,d=t.maxScore,u=t.innerRadiusBorder,h=t.center,c=o([h.x,h.y],2),p=c[0],g=c[1],v=x({plotMax:s-u,actualScore:e.value,maxScore:d})+u,y=m(p,g,v,n),w=m(p,g,v,r),C=m(p,g,u,n),R=m(p,g,u,r),b=m(p,g,u,i),A=function(t,e,n,r){var i=o([t,e],2),a=i[0],s=i[1];r<n&&(s=t,a=e);return{updatedSecondPoint:s,updatedFirstPoint:a}}(y,w,Math.sqrt(Math.pow(C.x-y.x,2)+Math.pow(C.y-y.y,2)),Math.sqrt(Math.pow(C.x-w.x,2)+Math.pow(C.y-w.y,2))),S=function(t,e,n,r,i,o){return["M",t.x,t.y,"A",e,e,0,0,1,n.x,n.y,"L",r.x,r.y,"C",r.x,r.y,i.x,i.y,o.x,o.y,"L",t.x,t.y,"Z"]}(A.updatedFirstPoint,s,A.updatedSecondPoint,R,b,C),T=l(e);return f({d:S.join(" "),stroke:"none",fill:a,"fill-opacity":"0.5",title:T})}function y(t){var e=t.startPoint,n=t.item,r=t.radius,i=t.startAngle,a=t.endAngle,s=t.maxScore,d=o([e.x,e.y],2),u=d[0],h=d[1],c=n.value,p=n.color,v=x({plotMax:r,actualScore:c,maxScore:s}),y=m(u,h,v,a),w=m(u,h,v,i),C=g(i,a);return f({d:["M",u,h,"L",y.x,y.y,"A",v,v,0,C,0,w.x,w.y].join(" "),fill:p,title:l(n)})}function w(t,e){var n=t+e;return[n,t+(n-t)/2]}function C(t,e){void 0===e&&(e=0);var n=[];if(t&&t.length>0){var r=e+1;n=t.filter((function(t){return!!t.children})).filter((function(t){return t.children.length>0})).map((function(t){return C(t.children,r)}))}return 0!==n.length?Math.max.apply(Math,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(o(arguments[e]));return t}(n)):e}function R(t){var e=t.startPoint,n=t.center,i=t.startRadius,a=t.endRadius,l=t.degreeToBeDrawn,d=t.maxScore,u=o([n.x,n.y],2),c=u[0],p=u[1],f=a-i,g=d/4,v=x({plotMax:f,actualScore:g,maxScore:d}),y=Math.round(.083*f),w=Math.round(.067*f),C=[1,2,3].map((function(t){return{radius:t*v,content:Math.round(t*g)}})).map((function(t){var n,o=t.radius,a=t.content,d=m(e.x,e.y,o,l),u=d.x,f=d.y;return[h({x:u,y:f,radius:y,fillColor:"#000000"}),h({x:c,y:p,radius:i+o,"stroke-dasharray":4,"stroke-opacity":.3}),(n={content:a,x:u,y:f,stroke:"white","font-size":w+"px"},{name:"text",options:n=r(r({},{content:"",x:0,y:0,stroke:"white","stroke-width":"1px","font-size":"6px","text-anchor":"middle"}),s(n)),children:[]})]}));return[].concat.apply([],C)}function b(t,e,n){var r=e/n,i=r/2;return{startLocation:t,perLocation:r,middleLocation:i,startMiddle:t+i}}function A(t,e){var n=e.perLocation,r=(e.middleLocation,e.startMiddle),i=e.startLocation;return{startDegree:i+t*n,middleDegree:r+t*n,endDegree:i+t*n+n}}function S(t){for(var e=t.children,n=t.currentItem,r=t.angleDifference,i=e.length,o=[],a=b(n.startDegree,r,i),s=0;s<i;s++){var l={};l.item=e[s];var d=A(s,a),u=d.startDegree,h=d.middleDegree,c=d.endDegree;l.startDegree=u,l.middleDegree=h,l.endDegree=c,o.push(l)}return o}function T(t,e,n,r){for(var i=[],o=0;o<r.length;o++){var a=r[o];i.push(m(t,e,n,a))}return i}function P(t,e){var n=document.querySelector(t),r=n.createSVGPoint();return{initPoint:0,cursorPoint:function(t){var e=function(t){var e,n=o([t.clientX,t.clientY],2),r=n[0],i=n[1];return t.targetTouches&&t.targetTouches[0]&&(r=(e=o([t.targetTouches[0].pageX,t.targetTouches[0].pageY],2))[0],i=e[1]),{x:r,y:i}}(t),i=e.x,a=e.y;return r.x=i,r.y=a,r.matrixTransform(n.getScreenCTM().inverse())},startDrag:function(t,e){this.previousPoint=this.angleFromCenter(t),this.initPoint=e},updateInitPointFromCurrentPoint:function(t){var e=Math.abs(this.previousPoint-t);t<this.previousPoint?this.initPoint+=e:this.initPoint-=e},getRotationAngle:function(t){var e=this.angleFromCenter(t);return this.updateInitPointFromCurrentPoint(e),this.previousPoint=e,this.initPoint},angleFromCenter:function(t){var n=o([e.x,e.y],2),r=n[0],i=n[1],a=this.cursorPoint(t);return 360*function(t){var e=t.x,n=t.y,r=t.centerX,i=t.centerY,o=t.maxRad,a=Math.atan2(e-i,n-r);return a=function(t,e){var n=t;(n+=e/4)<0&&(n+=e);return n}(a,o)}({x:a.x,y:a.y,centerX:r,centerY:i,maxRad:6.283185307179586})/(2*Math.PI)}}}var k=function(){function t(){this.componentDisplayed=!1,this.showToolTip=!1,this.tooltipTopInPx="0px",this.tooltipLeftInPx="0px",this.tooltipText="",this.svgId=null,this.svgGroupId=null,this.svgHandler=null,this.currentRotationAngle=10,this.svgCursor="default",this.initialized=!1,this.innerBorderHeight=30,this.outerBorderHeight=30,this.elements=[],this.hasChildren=!1,this.outerBorderCircleRef="outerBorderCircle",this.error=null,this.hasError=!1,this.startRotation=!1}return t.prototype.showError=function(t){this.error=t,this.hasError=!0},t.prototype.hideError=function(){this.error=null,this.hasError=!1},t.prototype.appendToSvg=function(t){this.elements.push(t)},t.prototype.ngOnChanges=function(t){this.hideError();var e=Object.values(t).some((function(t){return t.isFirstChange()}));this.modifyOnFirstChange(e)},t.prototype.modifyOnFirstChange=function(t){t||this.initialize()},t.prototype.ngOnInit=function(){this.hideError(),this.initialize()},t.prototype.initialize=function(){var t=this,e=r(r({},{size:300,maxScore:100,animateChart:!0,splitBasedOnChildren:!0,legendAxisLinePosition:1}),s(this.options));if(this.size=e.size,this.maxScore=e.maxScore,this.animateChart=e.animateChart,this.splitBasedOnChildren=e.splitBasedOnChildren,this.legendAxisLinePosition=e.legendAxisLinePosition,this.hasValidParameters()){this.initialized=!1,this.svgId="svg"+a(this.items),this.svgGroupId="svg-group"+a(this.items),this.viewBox="0 0 "+this.size+" "+this.size,this.innerCircleRadius=Math.abs(this.size/5.33),this.innerBorderHeight=this.innerCircleRadius/5,this.outerBorderHeight=this.innerCircleRadius/5,this.globalPosition=function(t){for(var e=t.size,n=(t.maxScore,{x:e/2,y:e/2}),r=C(t.items)+1,i=Math.abs(e/5.33),a=.0375*e,s=2*Math.abs(e/5.33)/r,l=[],d=1;d<=r;d++){var u=d*s,h=o(w(u,a),2),c=h[0],p=h[1];l.push({startRadius:u,endRadius:c,textRadius:p})}var f=i,m=o(w(f,a),2),g=m[0],x=m[1],v=2*i,y=o(w(v,a),2),R=y[0],b=y[1],A=v+a,S=o(w(A,2*a),2);return{textSize:.0175*e,outerTextSize:.0225*e,levels:l,innerRadius:f,innerRadiusBorder:g,innerTextRadius:x,middleRadius:v,middleTextRadius:b,middleRadiusBorder:R,outerRadius:A,outerRadiusBorder:S[0],outerTextRadius:S[1],center:n}}({size:this.size,maxScore:this.maxScore,items:this.items}),this.hasChildren=this.items.filter((function(t){return!!t.children})).length>0,this.drawLayout();var n=this.globalPosition,i=n.innerRadius,l=n.innerTextRadius,h=n.textSize,p=n.outerTextSize,f=(n.outerRadiusBorder,n.outerTextRadius),g=n.center,x=o([g.x,g.y],2),v=x[0],R=x[1],T=this.items,P=[],k=this.hasChildren;P=this.splitBasedOnChildren?function(t){t.length;for(var e=[],n=360/t.filter((function(t){return t.children})).map((function(t){return t.children.length})).reduce((function(t,e){return t+e}),0),r=0,i=0;i<t.length;i++){var o=t[i],a=o.children?o.children.length:0,s=a*n,l=r+a*n,d=(l-r)/2,u={};u.item=o,u.startDegree=r,u.middleDegree=d,u.endDegree=l,a>0&&(u.children=S({children:o.children,currentItem:u,angleDifference:s})),r+=a*n,e.push(u)}return e}(T=function(t){return t.map((function(t){return t.children&&t.children.length>0||(t.children=[],t.children.push({name:"",value:0})),t}))}(T)):function(t){for(var e=t.length,n=[],r=360/e,i=b(0,360,e),o=0;o<t.length;o++){var a=A(o,i),s=a.startDegree,l=a.middleDegree,d=a.endDegree,u=t[o],h={};h.item=u,h.startDegree=s,h.middleDegree=l,h.endDegree=d,t.filter((function(t){return!!t.children})).length>0&&(h.children=S({children:u.children,currentItem:h,angleDifference:r})),n.push(h)}return n}(T);for(var z=360/T.length,M=P.map((function(t){return t.startDegree})),I=P.map((function(t){return t.middleDegree})),B=function(t,e,n,r){for(var i=[],o=0;o<r.length;o++){var a=r[o];i.push(m(t,e,n,a))}return i}(v,R,this.chartBorder,M),D=[],F=[],O=[],L=0;L<B.length;L++){var E=B[L],j=E.x,q=E.y,N=L+1;N>=B.length&&(N=0);var H=M[N],X=M[L],Y=I[L],$=T[L];if(!1==!!$.color){var U={color:d()};$=r(r({},U),$)}if(this.hasChildren&&$.children&&$.children.length>0){var G=P[L].children;O=O.concat(this.drawOnLevel({items:$.children,totalDegrees:z,childAngels:G,color:$.color}))}D.push(c({x1:v,y1:R,x2:j,y2:q,width:2}));var V=y({startPoint:g,item:$,radius:i,startAngle:X,endAngle:H,maxScore:this.maxScore});F.push(V);var W=this.addArcText({arcForTextId:"arc-text-inner"+this.getUniqueCode()+"-"+L,radius:l,fontSize:h,startAngle:X,endAngle:H,perAngle:z,item:$});if(F=F.concat(W),k){F.push(this.drawOuterBackgroundWithMiddle({item:$,startAngle:X,middleAngle:Y,endAngle:H}));var _=this.addArcText({arcForTextId:"arc-text-outer"+this.getUniqueCode()+"-"+L,radius:f,fontSize:p,perAngle:z,startAngle:X,endAngle:H,item:$});F=F.concat(_)}}O.forEach((function(e){t.appendToSvg(e)})),this.drawInnerBorders(),F.forEach((function(e){t.appendToSvg(e)})),D.forEach((function(e){t.appendToSvg(e)}));var J=this.getLegendAxisIndex(M);this.drawLegends(M[J]),this.addSmallCirclesAtCenter(v,R),this.initialized=!0,this.currentRotationAngle=10,this.rotationPoint=u(this.currentRotationAngle,g)}else this.showError("Input Values not set or Items was improper")},t.prototype.getLegendAxisIndex=function(t){var e=this.legendAxisLinePosition-1;return(e<0||e>=t.length)&&(e=0),e},t.prototype.hasValidParameters=function(){return this.items&&this.items.length>1},t.prototype.drawOuterBackgroundWithMiddle=function(t){var e=t.item,n=t.startAngle,r=t.middleAngle,i=t.endAngle,a=e.color,s=this.globalPosition,l=s.outerTextRadius,d=s.center,u=o([d.x,d.y],2),h=function(t){var e=t.centerX,n=t.centerY,r=t.startAngle,i=t.middleAngle,o=t.endAngle,a=t.radius;return{start:m(e,n,a,r),middle:m(e,n,a,i),end:m(e,n,a,o)}}({centerX:u[0],centerY:u[1],startAngle:n,middleAngle:r,endAngle:i,radius:l}),c=["M",h.start.x,h.start.y,"A",l,l,0,0,1,h.end.x,h.end.y],f=e.name+"-"+e.value,g=.0775*this.size;return p({d:c.join(" "),stroke:a,"stroke-width":g,title:f})},t.prototype.drawOnLevel=function(t){for(var e=t.items,n=t.totalDegrees,r=t.childAngels,i=t.color,a=this.globalPosition,s=a.innerRadiusBorder,l=a.middleRadius,d=a.textSize,u=a.middleTextRadius,h=a.center,p=o([h.x,h.y],2),f=p[0],m=p[1],g=r.map((function(t){return t.startDegree})),x=r.map((function(t){return t.middleDegree})),y=r.map((function(t){return t.endDegree})),w=n/e.length,C=T(f,m,s,g),R=T(f,m,l,g),b=[],A=[],S=(g[0],0);S<C.length;S++){var P=C[S],k=R[S];A.push(c({x1:P.x,y1:P.y,x2:k.x,y2:k.y,width:.5}));var z=g[S],M=x[S],I=y[S],B=e[S],D=v({startPoint:P,item:B,startAngle:z,endAngle:I,middleAngle:M,middleRadius:l,innerRadiusBorder:s,center:h,maxScore:this.maxScore,color:i,index:S});b.push(D);var F=this.addArcText({arcForTextId:"arc-text-middle"+this.getUniqueCode()+"-"+z+S,radius:u,fontSize:d,perAngle:w,startAngle:z,endAngle:I,item:B});b=b.concat(F),w}return A.forEach((function(t){b.push(t)})),b},t.prototype.getUniqueCode=function(){return a(this.items)+"-"+this.size},t.prototype.drawInnerBorders=function(){var t=this.globalPosition,e=t.innerRadius,n=t.innerRadiusBorder,r=t.center,i=o([r.x,r.y],2),a=i[0],s=i[1],l=h({x:a,y:s,radius:e,fillColor:"none"}),d=h({x:a,y:s,radius:n,fillColor:"#FFFFFF"});this.appendToSvg(d),this.appendToSvg(l)},t.prototype.addSmallCirclesAtCenter=function(t,e){var n=.005*this.size,r=.001*this.size;this.appendToSvg(h({x:t,y:e,radius:n,fillColor:"#FFFFFF"})),this.appendToSvg(h({x:t,y:e,radius:r,fillColor:"#FFFFFF"}))},t.prototype.drawLegends=function(t){var e=this,n=this.globalPosition,r=n.innerRadius,i=n.innerRadiusBorder,a=n.middleRadius,s=n.center,l=o([s.x,s.y],2),d=l[0],u=l[1],h=this.maxScore,c=function(t){var e=t.startPoint;return R({startPoint:e,center:e,startRadius:0,endRadius:t.radius,degreeToBeDrawn:t.degreeToBeDrawn,maxScore:t.maxScore})}({startPoint:s,radius:r,degreeToBeDrawn:t,maxScore:h}),p=m(d,u,i,t);if(this.hasChildren){var f=R({startPoint:p,center:s,startRadius:i,endRadius:a,maxScore:h,degreeToBeDrawn:t});c=c.concat(f)}c.forEach((function(t){e.appendToSvg(t)}))},t.prototype.addArcText=function(t){var e=t.arcForTextId,n=t.radius,i=t.startAngle,a=t.fontSize,l=t.endAngle,d=(t.perAngle,t.item),u=[],h=this.globalPosition.center,c=o([h.x,h.y],2),f=c[0],x=c[1],v=function(t){var e=t.startPoint,n=t.radius,r=t.id,i=t.startAngle,a=t.endAngle,s=o([e.x,e.y],2),l=s[0],d=s[1],u=m(l,d,n,a),h=m(l,d,n,i),c=g(i,a);return p({d:["M",u.x,u.y,"A",n,n,0,c,0,h.x,h.y].join(" "),borderColor:"",id:r})}({id:e,startPoint:h,radius:n,startAngle:i,endAngle:l});u.push(v);var y,w,C,R=function(t,e,n,r,i){var o=m(t,e,n,r),a=m(t,e,n,i),s=Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2));return Math.abs(s)}(f,x,n,i,l),b=function(t,e,n){var r=t,i=10.07;n<18&&(i=8.7);var o=Math.round(e/i);return t.length>0&&t.length>o&&(r=t.substring(0,o-1)+".."),r}(d.name,R,a);return u.push((y={label:b,text:d.name,pathId:e,"font-size":a+"px"},w=(y=r(r({},{text:"",label:"",pathId:"","font-size":"14px"}),s(y))).text,C=y.pathId,y.label,""!==C&&(y.href="#"+C,y.startOffset="50%",y["text-anchor"]="middle",y.title=w),{name:"text-on-arc",options:y,children:[]})),u},t.prototype.drawLayout=function(){var t=this.globalPosition,e=t.innerRadius,n=t.innerRadiusBorder,r=t.middleRadius,i=t.middleRadiusBorder,a=t.outerRadius,s=t.outerRadiusBorder,l=t.center,d=o([l.x,l.y],2),u=d[0],c=d[1],p=e,f=n;if(this.chartBorder=n,this.hasChildren){var m=h({x:u,y:c,radius:s,fillColor:"none","stroke-width":"5",ref:this.outerBorderCircleRef});this.appendToSvg(m);var g=h({x:u,y:c,radius:a,fillColor:"none"});this.appendToSvg(g),p=r,f=i,this.chartBorder=s}this.appendToSvg(h({x:u,y:c,radius:p})),this.appendToSvg(h({x:u,y:c,radius:f}))},t.prototype.hideTooltip=function(){this.showToolTip=!1},t.prototype.showTooltipText=function(t,e){this.tooltipLeftInPx=t.pageX+10+"px",this.tooltipTopInPx=t.pageY+10+"px",this.tooltipText=e,this.showToolTip=!0},t.prototype.onOutOfComponent=function(){this.hideTooltip(),this.stopRotate()},t.prototype.stopRotate=function(){this.svgCursor="default",this.startRotation=!1},t.prototype.startRotate=function(t){this.startRotation=!0,this.svgCursor="grab";var e=this.globalPosition,n=(e.outerRadiusBorder,e.center);this.svgHandler=P("#"+this.svgId,n),this.svgHandler.startDrag(t,this.currentRotationAngle),t.preventDefault()},t.prototype.rotateChart=function(t){if(0!=this.startRotation){this.svgCursor="grabbing";var e=this.globalPosition.center;this.currentRotationAngle=this.svgHandler.getRotationAngle(t),this.rotationPoint=u(Math.round(this.currentRotationAngle),e)}},i([e.Input()],t.prototype,"items",void 0),i([e.Input()],t.prototype,"options",void 0),t=i([e.Component({selector:"lib-sunburst-radar-chart",template:'<ng-container (mouseout)="onOutOfComponent();">\n\n\n <div *ngIf="hasError" style=" color: #a94442;\n background-color: #f2dede;\n border-color: #ebccd1;\n margin-top: 5px;\npadding: 15px;\n margin-bottom: 20px;\n border: 1px solid transparent;\n border-radius: 4px;\n">\n <strong>Error!</strong> {{error}}\n </div>\n\n\n\n<div class="app-tooltip" *ngIf="showToolTip" style="position: absolute; display: block;background: cornsilk; border: 1px solid black; border-radius: 5px; padding: 5px; z-index: 1002;"\n\n [style.left]="tooltipLeftInPx" [style.top]="tooltipTopInPx" >\n {{tooltipText}}\n</div>\n\n<svg [attr.id]="svgId"\n [attr.height]="size"\n [attr.width]="size"\n [attr.viewBox]="viewBox"\n [style.cursor]="svgCursor"\n xmlns="http://www.w3.org/2000/svg">\n\n\n\n\n <animateTransform\n *ngIf="animateChart"\n attributeName="transform"\n begin="4s"\n dur="500ms"\n type="rotate"\n from="0"\n to="10"\n\n additive="sum"\n fill="freeze"\n repeatCount="1"\n />\n\n\n<g\n (mousemove)="rotateChart($event);"\n (mousedown)="startRotate($event)"\n (mouseup)="stopRotate()"\n (touchmove)="rotateChart($event);"\n (touchstart)="startRotate($event)"\n (touchend)="stopRotate()"\n [attr.transform]="rotationPoint"\n [attr.id]="svgGroupId"\n\n\n >\n <ng-container *ngFor="let element of elements" >\n\n\n\n <ng-container [ngSwitch]="element.name" >\n\n\n <circle *ngSwitchCase="\'circle\'" [attr.cx]="element.options.x" [attr.cy]=[element.options.y]\n [attr.r]="element.options.radius"\n [attr.stroke-width]="element.options[\'stroke-width\']"\n [attr.stroke]="element.options[\'stroke\']"\n [attr.stroke-dasharray]="element.options[\'stroke-dasharray\']"\n [attr.stroke-opacity]="element.options[\'stroke-opacity\']"\n [attr.fill]="element.options[\'fillColor\']"\n >\n\n\n\n\n </circle>\n\n <path *ngSwitchCase="\'path\'" [attr.d]="element.options.d" [attr.fill]=[element.options.fill]\n\n [attr.stroke]="element.options[\'stroke\']"\n [attr.stroke-width]="element.options[\'stroke-width\']"\n [attr.id]="element.options[\'id\']"\n (mousemove)="showTooltipText($event, element.options[\'title\']);"\n (mouseout)="hideTooltip()" >\n\n\n\n\n\n </path>\n\n<g *ngSwitchCase="\'path-bar\'" >\n\n\n\n <path [attr.d]="element.options.d"\n [attr.fill]=[element.options.fill]\n\n [attr.stroke]="element.options[\'stroke\']"\n [attr.stroke-width]="element.options[\'stroke-width\']"\n [attr.stroke-opacity]="element.options[\'stroke-opacity\']"\n [attr.fill-opacity]="element.options[\'fill-opacity\']"\n [attr.id]="element.options[\'id\']"\n (mousemove)="showTooltipText($event, element.options[\'title\']);" (mouseout)="hideTooltip()" >\n\n\n\n\n <ng-container\n\n *ngIf="animateChart"\n >\n\n <animate\n attributeName="fill"\n [attr.from]="element.options[\'fill\']"\n to="transparent"\n dur="1ms"\n fill="freeze" />\n <animate\n attributeName="stroke"\n [attr.from]="element.options[\'fill\']"\n [attr.to]="element.options[\'fill\']"\n dur="1ms"\n fill="freeze" />\n <animate\n attributeName="stroke-width"\n from="8"\n to="8"\n dur="1ms"\n fill="freeze" />\n <animate\n attributeName="stroke-dasharray"\n from="1000"\n to="1000"\n dur="1ms"\n fill="freeze" />\n\n\n <animate\n attributeName="fill"\n from="#FFFFFF"\n [attr.to]="element.options[\'fill\']"\n begin="2s"\n dur="3s"\n fill="freeze" />\n\n <animate\n attributeName="stroke-dashoffset"\n from="1000"\n to="0"\n begin="1ms"\n dur="3s"\n fill="freeze" />\n\n <animate\n attributeName="stroke-width"\n from="8"\n [attr.to]="element.options[\'stroke\']"\n begin="3s"\n dur="1s"\n fill="freeze" />\n </ng-container>\n </path>\n\n\n\n\n</g>\n\n <text *ngSwitchCase="\'text-on-arc\'"\n [attr.font-size]="element.options[\'font-size\']"\n\n >\n <textPath\n [attr.href]="element.options.href"\n [attr.startOffset]="element.options.startOffset"\n [attr.text-anchor]="element.options[\'text-anchor\']"\n >{{element.options[\'label\']}}</textPath>\n <title>{{element.options[\'title\']}}</title>\n\n </text>\n\n\n <line *ngSwitchCase="\'line\'"\n [attr.x1]="element.options.x1"\n [attr.y1]="element.options.y1"\n [attr.x2]="element.options.x2"\n [attr.y2]="element.options.y2"\n [attr.stroke-width]="element.options.width"\n\n [attr.stroke]="element.options[\'color\']" >\n <title>{{element.options[\'title\']}}</title>\n </line>\n\n\n <text *ngSwitchCase="\'text\'"\n [attr.x]="element.options.x"\n [attr.y]="element.options.y"\n [attr.stroke]="element.options.stroke"\n [attr.stroke-width]="element.options[\'stroke-width\']"\n [attr.font-size]="element.options[\'font-size\']"\n [attr.text-anchor]="element.options[\'text-anchor\']"\n >{{element.options.content}}\n <title>{{element.options[\'content\']}}</title>\n </text>\n\n </ng-container>\n\n\n\n </ng-container>\n\n\n </g>\n</svg>\n</ng-container>\n',styles:[".app-tooltip{background:#fff8dc;border:1px solid #000;border-radius:5px;padding:5px;z-index:1002}.growAnimation{-moz-transition:transform 2s ease-in-out;-webkit-transition:transform 2s ease-in-out;-o-transition:transform 2s ease-in-out;transform:scale(1)}.growAnimation:active{transform:scale(.5)}"]})],t)}(),z=function(){function t(){}return t=i([e.NgModule({declarations:[k],imports:[n.CommonModule],exports:[k]})],t)}();t.AngularSunburstRadarChartComponent=k,t.AngularSunburstRadarChartModule=z,Object.defineProperty(t,"__esModule",{value:!0})})); //# sourceMappingURL=angular-sunburst-radar-chart.umd.min.js.map