import{r as t,h as e}from"./p-0d5a2e05.js";const s=class{constructor(e){t(this,e);this.type="realistic";this.trend="positive";this.size="lg";this.showMarker=false;this.data=[];this.lineColor=this.trend==="positive"?"#067647":"#B42318";this.fillColor=this.trend==="positive"?"#079455":"#D92D20";this.width=this.size==="lg"?328:128;this.height=64}handleSizeChange(){this.width=this.size==="lg"?328:128}getLinePath(){const t=this.getPoints();switch(this.type){case"realistic":return this.getSmoothPath(t);case"wavy":return this.getWavyPath(t);case"straight":return this.getStraightPath(t);case"layers":return this.getSmoothPath(t);default:return""}}getPoints(){return this.data.map(((t,e)=>({x:e/(this.data.length-1)*this.width,y:this.height-t/Math.max(...this.data)*this.height})))}getSmoothPath(t){return t.reduce(((t,e,s,i)=>{if(s===0)return`M ${e.x},${e.y}`;const h=i[s-1];const a=(h.x+e.x)/2;return`${t} C ${a},${h.y} ${a},${e.y} ${e.x},${e.y}`}),"")}getWavyPath(t){return t.reduce(((t,e,s)=>s===0?`M ${e.x},${e.y}`:`${t} Q ${e.x-10},${e.y+10} ${e.x},${e.y}`),"")}getStraightPath(t){return t.reduce(((t,e,s)=>s===0?`M ${e.x},${e.y}`:`${t} L ${e.x},${e.y}`),"")}getAreaPath(){const t=this.getLinePath();return`${t} L ${this.width},${this.height} L 0,${this.height} Z`}render(){const t=this.getLinePath();const s=this.getAreaPath();return e("svg",{key:"0325b3e4cbdc5be5c7b22a7309ce9aba05dbac6c",width:this.width,height:this.height,viewBox:`0 0 ${this.width} ${this.height}`},e("defs",{key:"5bb00eb7d3c0a462a5f131f51b0da1f190b8bff6"},e("linearGradient",{key:"33fc763778b59fdbb003e9cacc7be0d52fdf4c6a",id:"areaGradient",x1:"0",x2:"0",y1:"0",y2:"1"},e("stop",{key:"f8f833cbe989ad91ea5bbfce033e311c5766f5f0",offset:"0%","stop-color":this.fillColor,"stop-opacity":"0.25"}),e("stop",{key:"3e88f78194a53854ff2f3585ad318e97b127f8b0",offset:"100%","stop-color":this.fillColor,"stop-opacity":"0"}))),e("path",{key:"b959d03a8315f999fa71122772e838ee7172b96c",d:s,fill:"url(#areaGradient)"}),e("path",{key:"94a41fac9f9e110963200055f1e557583647dac7",d:t,fill:"none",stroke:this.lineColor,"stroke-width":"2"}),this.showMarker&&this.getPoints().map((t=>e("circle",{cx:t.x,cy:t.y,r:"4",fill:"white",stroke:this.lineColor,"stroke-width":"2"}))))}static get watchers(){return{size:["handleSizeChange"]}}};export{s as dga_metric_chart};
//# sourceMappingURL=p-853d6f4a.entry.js.map