export const id=470;export const ids=[470];export const modules={64379:(e,t,a)=>{function i(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}a.d(t,{S:()=>i}),(0,a(54759).K2)(i,"populateCommonDb")},73470:(e,t,a)=>{a.d(t,{diagram:()=>K});var i=a(64379),n=a(71510),r=a(27983),l=a(54759),o=a(88465),s=a(54722),c=l.UI.pie,p={sections:new Map,showData:!1,config:c},d=p.sections,g=p.showData,u=structuredClone(c),m=(0,l.K2)((()=>structuredClone(u)),"getConfig"),h=(0,l.K2)((()=>{d=new Map,g=p.showData,(0,l.IU)()}),"clear"),f=(0,l.K2)((({label:e,value:t})=>{d.has(e)||(d.set(e,t),l.Rm.debug(`added new section: ${e}, with value: ${t}`))}),"addSection"),x=(0,l.K2)((()=>d),"getSections"),S=(0,l.K2)((e=>{g=e}),"setShowData"),w=(0,l.K2)((()=>g),"getShowData"),D={getConfig:m,clear:h,setDiagramTitle:l.ke,getDiagramTitle:l.ab,setAccTitle:l.SV,getAccTitle:l.iN,setAccDescription:l.EI,getAccDescription:l.m7,addSection:f,getSections:x,setShowData:S,getShowData:w},T=(0,l.K2)(((e,t)=>{(0,i.S)(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)}),"populateDb"),$={parse:(0,l.K2)((async e=>{const t=await(0,o.qg)("pie",e);l.Rm.debug(t),T(t,D)}),"parse")},y=(0,l.K2)((e=>`\n  .pieCircle{\n    stroke: ${e.pieStrokeColor};\n    stroke-width : ${e.pieStrokeWidth};\n    opacity : ${e.pieOpacity};\n  }\n  .pieOuterCircle{\n    stroke: ${e.pieOuterStrokeColor};\n    stroke-width: ${e.pieOuterStrokeWidth};\n    fill: none;\n  }\n  .pieTitleText {\n    text-anchor: middle;\n    font-size: ${e.pieTitleTextSize};\n    fill: ${e.pieTitleTextColor};\n    font-family: ${e.fontFamily};\n  }\n  .slice {\n    font-family: ${e.fontFamily};\n    fill: ${e.pieSectionTextColor};\n    font-size:${e.pieSectionTextSize};\n    // fill: white;\n  }\n  .legend text {\n    fill: ${e.pieLegendTextColor};\n    font-family: ${e.fontFamily};\n    font-size: ${e.pieLegendTextSize};\n  }\n`),"getStyles"),C=(0,l.K2)((e=>{const t=[...e.entries()].map((e=>({label:e[0],value:e[1]}))).sort(((e,t)=>t.value-e.value));return(0,s.rLf)().value((e=>e.value))(t)}),"createPieArcs"),b=(0,l.K2)(((e,t,a,i)=>{l.Rm.debug("rendering pie chart\n"+e);const o=i.db,c=(0,l.D7)(),p=(0,n.$t)(o.getConfig(),c.pie),d=18,g=450,u=g,m=(0,r.D)(t),h=m.append("g");h.attr("transform","translate(225,225)");const{themeVariables:f}=c;let[x]=(0,n.I5)(f.pieOuterStrokeWidth);x??=2;const S=p.textPosition,w=Math.min(u,g)/2-40,D=(0,s.JLW)().innerRadius(0).outerRadius(w),T=(0,s.JLW)().innerRadius(w*S).outerRadius(w*S);h.append("circle").attr("cx",0).attr("cy",0).attr("r",w+x/2).attr("class","pieOuterCircle");const $=o.getSections(),y=C($),b=[f.pie1,f.pie2,f.pie3,f.pie4,f.pie5,f.pie6,f.pie7,f.pie8,f.pie9,f.pie10,f.pie11,f.pie12],K=(0,s.UMr)(b);h.selectAll("mySlices").data(y).enter().append("path").attr("d",D).attr("fill",(e=>K(e.data.label))).attr("class","pieCircle");let k=0;$.forEach((e=>{k+=e})),h.selectAll("mySlices").data(y).enter().append("text").text((e=>(e.data.value/k*100).toFixed(0)+"%")).attr("transform",(e=>"translate("+T.centroid(e)+")")).style("text-anchor","middle").attr("class","slice"),h.append("text").text(o.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");const v=h.selectAll(".legend").data(K.domain()).enter().append("g").attr("class","legend").attr("transform",((e,t)=>"translate(216,"+(22*t-22*K.domain().length/2)+")"));v.append("rect").attr("width",d).attr("height",d).style("fill",K).style("stroke",K),v.data(y).append("text").attr("x",22).attr("y",14).text((e=>{const{label:t,value:a}=e.data;return o.getShowData()?`${t} [${a}]`:t}));const A=512+Math.max(...v.selectAll("text").nodes().map((e=>e?.getBoundingClientRect().width??0)));m.attr("viewBox",`0 0 ${A} 450`),(0,l.a$)(m,g,A,p.useMaxWidth)}),"draw"),K={parser:$,db:D,renderer:{draw:b},styles:y}}};
//# sourceMappingURL=https://main.vscode-cdn.net/sourcemaps/146732d0c28fe6d8f982f1ebf7ab4101ece88c63/extensions/windsurf/out/470.chat.js.map