PageSourceSearch

https://jukez.ai/assets/pieDiagram-E7YTZNPT-DQ0mlMBL.js

js jukez.ai collected 2026-10-05 14:32:20 UTC 6,357 bytes, 39 lines download raw bytes

vendor: 4,478 bytes, lines 1-39
1import{p as at}from"./chunk-JWPE2WC7-DqmPw6_y.js";import{g as rt,s as nt,a as it,b as ot,q as st,p as lt,_ as g,l as B,c as ct,E as ut,H as dt,Q as gt,d as pt,r as ht,F as ft}from"./mermaid-GHXKKRXX-D6zTFCWI.js";import{p as mt}from"./cynefin-OW5HDTMX-BhLD7cJI.js";import{d as X}from"./arc-BgJ-aKq1.js";import{o as vt}from"./ordinal-DILIJJjt.js";import{a as T,t as G,n as xt}from"./string-DAaY_9R9.js";import"./index-XuTraXL9.js";import"./utils-0dAE7CDf.js";import"./init-Dmth1JHB.js";function St(t,n){return n<t?-1:n>t?1:n>=t?0:NaN}function yt(t){return t}function wt(){var t=yt,n=St,y=null,b=T(0),l=T(G),p=T(0);function i(e){var r,s=(e=xt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),z=Math.min(G,Math.max(-G,l.apply(this,arguments)-D)),k,F=Math.min(Math.abs(z)/s,p.apply(this,arguments)),u=F*(z<0?-1:1),A;for(r=0;r<s;++r)(A=o[f[r]=r]=+t(e[r],r,e))>0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(z-s*u)/$:0;r<s;++r,D=k)h=f[r],A=o[h],k=D+(A>0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:F};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var At=ft.pie,I={sections:new Map,showData:!1},W=I.sections,V=I.showData,Ct=structuredClone(At),$t=g(()=>structuredClone(Ct),"getConfig"),Dt=g(()=>{W=new Map,V=I.showData,ht()},"clear"),Tt=g(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);W.has(t)||(W.set(t,n),B.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),bt=g(()=>W,"getSections"),kt=g(t=>{V=t},"setShowData"),Et=g(()=>V,"getShowData"),Z={getConfig:$t,clear:Dt,setDiagramTitle:lt,getDiagramTitle:st,setAccTitle:ot,getAccTitle:it,setAccDescription:nt,getAccDescription:rt,addSection:Tt,getSections:bt,setShowData:kt,getShowData:Et},zt=g((t,n)=>{at(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Mt={parse:g(async t=>{const n=await mt("pie",t);B.debug(n),zt(n,Z)},"parse")},Rt=g(t=>`
2  .pieCircle{
3    stroke: ${t.pieStrokeColor};
4    stroke-width : ${t.pieStrokeWidth};
5    opacity : ${t.pieOpacity};
6  }
7  .pieCircle.highlighted{
8    scale: 1.05;
9    opacity: 1;
10  }
11  .pieCircle.highlightedOnHover:hover{
12    transition-duration: 250ms;
13    scale: 1.05;
14    opacity: 1;
15  }
16  .pieOuterCircle{
17    stroke: ${t.pieOuterStrokeColor};
18    stroke-width: ${t.pieOuterStrokeWidth};
19    fill: none;
20  }
21  .pieTitleText {
22    text-anchor: middle;
23    font-size: ${t.pieTitleTextSize};
24    fill: ${t.pieTitleTextColor};
25    font-family: ${t.fontFamily};
26  }
27  .slice {
28    font-family: ${t.fontFamily};
29    fill: ${t.pieSectionTextColor};
30    font-size:${t.pieSectionTextSize};
31    // fill: white;
32  }
33  .legend text {
34    fill: ${t.pieLegendTextColor};
35    font-family: ${t.fontFamily};
36    font-size: ${t.pieLegendTextSize};
37  }
38`,"getStyles"),Ft=Rt,Ht=g(t=>{const n=[...t.values()].reduce((l,p)=>l+p,0),y=[...t.entries()].map(([l,p])=>({label:l,value:p})).filter(l=>l.value/n*100>=1);return wt().value(l=>l.value).sort(null)(y)},"createPieArcs"),Lt=g((t,n,y,b)=>{B.debug(`rendering pie chart
39`+t);const l=b.db,p=ct(),i=ut(l.getConfig(),p.pie),e=40,r=18,s=4,h=450,w=h,$=dt(n),f=$.append("g");f.attr("transform","translate("+w/2+","+h/2+")");const{themeVariables:o}=p;let[D]=gt(o.pieOuterStrokeWidth);D??=2;const z=i.legendPosition,k=i.textPosition,F=i.donutHole>0&&i.donutHole<=.9?i.donutHole:0,u=Math.min(w,h)/2-e,A=X().innerRadius(F*u).outerRadius(u),M=X().innerRadius(u*k).outerRadius(u*k),m=f.append("g");m.append("circle").attr("cx",0).attr("cy",0).attr("r",u+D/2).attr("class","pieOuterCircle");const H=l.getSections(),J=Ht(H),K=[o.pie1,o.pie2,o.pie3,o.pie4,o.pie5,o.pie6,o.pie7,o.pie8,o.pie9,o.pie10,o.pie11,o.pie12];let _=0;H.forEach(a=>{_+=a});const U=J.filter(a=>(a.data.value/_*100).toFixed(0)!=="0"),N=vt(K).domain([...H.keys()]);m.selectAll("mySlices").data(U).enter().append("path").attr("d",A).attr("fill",a=>N(a.data.label)).attr("class",a=>
39{let c="pieCircle";return i.highlightSlice==="hover"?c+=" highlightedOnHover":i.highlightSlice===a.data.label&&(c+=" highlighted"),c}),m.selectAll("mySlices").data(U).enter().append("text").text(a=>(a.data.value/_*100).toFixed(0)+"%").attr("transform",a=>"translate("+M.centroid(a)+")").style("text-anchor","middle").attr("class","slice");const Y=f.append("text").text(l.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),R=[...H.entries()].map(([a,c])=>({label:a,value:c})),C=f.selectAll(".legend").data(R).enter().append("g").attr("class","legend");C.append("rect").attr("width",r).attr("height",r).style("fill",a=>N(a.label)).style("stroke",a=>N(a.label)),C.append("text").attr("x",r+s).attr("y",r-s).text(a=>l.getShowData()?`${a.label} [${a.value}]`:a.label);const E=Math.max(...C.selectAll("text").nodes().map(a=>a?.getBoundingClientRect().width??0));let L=h,O=w+e;const d=r+s,P=R.length*d;switch(z){case"center":C.attr("transform",(a,c)=>{const v=d*R.length/2,x=-E/2-(r+s),S=c*d-v;return"translate("+x+","+S+")"});break;case"top":L+=P,C.attr("transform",(a,c)=>{const v=u,x=-E/2-(r+s),S=c*d-v;return`translate(${x}, ${S})`}),m.attr("transform",()=>`translate(0, ${P+d})`);break;case"bottom":L+=P,C.attr("transform",(a,c)=>{const v=-u-d,x=-E/2-(r+s),S=c*d-v;return"translate("+x+","+S+")"});break;case"left":O+=r+s+E,C.attr("transform",(a,c)=>{const v=d*R.length/2,x=-u-(r+s),S=c*d-v;return"translate("+x+","+S+")"}),m.attr("transform",()=>`translate(${E+r+s}, 0)`);break;default:O+=r+s+E,C.attr("transform",(a,c)=>{const v=d*R.length/2,x=12*r,S=c*d-v;return"translate("+x+","+S+")"});break}const j=Y.node()?.getBoundingClientRect().width??0,tt=w/2-j/2,et=w/2+j/2,q=Math.min(0,tt),Q=Math.max(O,et)-q;$.attr("viewBox",`${q} 0 ${Q} ${L}`),pt($,L,Q,i.useMaxWidth)},"draw"),Wt={draw:Lt},qt={parser:Mt,db:Z,renderer:Wt,styles:Ft};export{qt as diagram};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.