1import{s as t,g as e,t as a,q as r,a as n,b as s,_ as i,K as o,z as l,F as c,G as d,H as p,l as g,a0 as m,e as x}from"./index-C16DHWFp.js";import{p as u}from"./chunk-4BX2VUAB-CJu338GO.js";import{p as h}from"./treemap-KZPCXAKY-DdCrRx6w.js";import"./vendor-react-DejgYtBM.js";import"./vendor-semi-D8d7bTtM.js";import"./index-BeIIFw6E.js";import"./vendor-icons-EJvJ5X-w.js";import"./vendor-motion-Chfy_MiU.js";import"./vendor-katex-BuQuj6Fv.js";import"./dayjs.min-CASHsil8.js";import"./purify.es-Bm-lHtoJ.js";import"./index-DcbB2zxU.js";import"./vendor-highlight-CaHTjBxz.js";import"./index-B_PxGnmD.js";import"./_baseUniq-BjWlgG8Y.js";import"./_basePickBy-bVyxPQRR.js";import"./clone-VMOlTGG7.js";var f={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},$={axes:[],curves:[],options:f},v=structuredClone($),y=d.radar,b=i(()=>c({...y,...p().radar}),"getConfig"),w=i(()=>v.axes,"getAxes"),M=i(()=>v.curves,"getCurves"),C=i(()=>v.options,"getOptions"),L=i(t=>{v.axes=t.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),j=i(t=>{v.curves=t.map(t=>({name:t.name,label:t.label??t.name,entries:A(t.entries)}))},"setCurves"),A=i(t=>{if(null==t[0].axis)return t.map(t=>t.value);const e=w();if(0===e.length)throw new Error("Axes must be populated before curves for reference entries");return e.map(e=>{const a=t.find(t=>t.axis?.$refText===e.name);if(void 0===a)throw new Error("Missing entry for axis "+e.label);return a.value})},"computeCurveEntries"),k={getAxes:w,getCurves:M,getOptions:C,setAxes:L,setCurves:j,setOptions:i(t=>{const e=t.reduce((t,e)=>(t[e.name]=e,t),{});v.options={showLegend:e.showLegend?.value??f.showLegend,ticks:e.ticks?.value??f.ticks,max:e.max?.value??f.max,min:e.min?.value??f.min,graticule:e.graticule?.value??f.graticule}},"setOptions"),getConfig:b,clear:i(()=>{l(),v=structuredClone($)},"clear"),setAccTitle:s,getAccTitle:n,setDiagramTitle:r,getDiagramTitle:a,getAccDescription:e,setAccDescription:t},T=i(t=>{u(t,k);const{axes:e,curves:a,options:r}=t;k.setAxes(e),k.setCurves(a),k.setOptions(r)},"populate"),O={parse:i(async t=>{const e=await h("radar",t);g.debug(e),T(e)},"parse")},S=i((t,e,a,r)=>{const n=r.db,s=n.getAxes(),i=n.getCurves(),l=n.getOptions(),c=n.getConfig(),d=n.getDiagramTitle(),p=o(e),g=I(p,c),m=l.max??Math.max(...i.map(t=>Math.max(...t.entries))),x=l.min,u=Math.min(c.width,c.height)/2;z(g,s,u,l.ticks,l.graticule),F(g,s,u,c),P(g,s,i,x,m,l.graticule,c),R(g,i,l.showLegend,c),g.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),I=i((t,e)=>{const a=e.width+e.marginLeft+e.marginRight,r=e.height+e.marginTop+e.marginBottom,n=e.marginLeft+e.width/2,s=e.marginTop+e.height/2;return x(t,r,a,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${a} ${r}`),t.append("g").attr("transform",`translate(${n}, ${s})`)},"drawFrame"),z=i((t,e,a,r,n)=>{if("circle"===n)for(let s=0;s<r;s++){const e=a*(s+1)/r;t.append("circle").attr("r",e).attr("class","radarGraticule")}else if("polygon"===n){const n=e.length;for(let s=0;s<r;s++){const i=a*(s+1)/r,o=e.map((t,e)=>{const a=2*e*Math.PI/n-Math.PI/2;return`${i*Math.cos(a)},${i*Math.sin(a)}`}).join(" ");t.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),F=i((t,e,a,r)=>{const n=e.length;for(let s=0;s<n;s++){const i=e[s].label,o=2*s*Math.PI/n-Math.PI/2;t.append("line").attr("x1",0).attr("y1",0).attr("x2",a*r.axisScaleFactor*Math.cos(o)).attr("y2",a*r.axisScaleFactor*Math.sin(o)).attr("class","radarAxisLine"),t.append("text").text(i).attr("x",a*r.axisLabelFactor*Math.cos(o)).attr("y",a*r.axisLabelFactor*Math.sin(o)).attr("class","radarAxisLabel")}},"drawAxes");function P(t,e,a,r,n,s,i){const o=e.length,l=Math.min(i.width,i.height)/2;a.forEach((e,a)=>{if(e.entries.length!==o)return;const c=e.entries.map((t,e)=>{const a=2*Math.PI*e/o-Math.PI/2,s=B(t,r,n,l);return{x:s*Math.cos(a),y:s*Math.sin(a)}});"circle"===s?t.append("path").attr("d",E(c,i.curveTension)).attr("class",`radarCurve-${a}`):"polygon"===s&&t.append("polygon").attr("points",c.map(t=>`${t.x},${t.y}`).join(" ")).attr("class",`radarCurve-${a}`)})}function B(t,e,a,r){return r*(Math.min(Math.max(t,e),a)-e)/(a-e)}function E(t,e){const a=t.length;let r=`M${t[0].x},${t[0].y}`;for(let n=0;n<a;n++){const s=t[(n-1+a)%a],i=t[n],o=t[(n+1)%a],l=t[(n+2)%a],c={x:i.x+(o.x-s.x)*e,y:i.y+(o.y-s.y)*e},d={x:o.x-(l.x-i.x)*e,y:o.y-(l.y-i.y)*e};r+=` C${c.x},${c.y} ${d.x},${d.y} ${o.x},${o.y}`}return`${r} Z`}function R(t,e,a,r){if(!a)return;const n=3*(r.width/2+r.marginRight)/4,s=3*-(r.height/2+r.marginTop)/4;e.forEach((e,a)=>{const r=t.append("g").attr("transform",`translate(${n}, ${s+20*a})`);r.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${a}`),r.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(e.label)})}i(P,"drawCurves"),i(B,"relativeRadius"),i(E,"closedRoundCurve"),i(R,"drawLegend");var D={draw:S},G=i((t,e)=>{let a="";for(let r=0;r<t.THEME_COLOR_LIMIT;r++){const n=t[`cScale${r}`];a+=`\n\t\t.radarCurve-${r} {\n\t\t\tcolor: ${n};\n\t\t\tfill: ${n};\n\t\t\tfill-opacity: ${e.curveOpacity};\n\t\t\tstroke: ${n};\n\t\t\tstroke-width: ${e.curveStrokeWidth};\n\t\t}\n\t\t.radarLegendBox-${r} {\n\t\t\tfill: ${n};\n\t\t\tfill-opacity: ${e.curveOpacity};\n\t\t\tstroke: ${n};\n\t\t}\n\t\t`}return a},"genIndexStyles"),_=i(t=>{const e=m(),a=p(),r=c(e,a.themeVariables);return{themeVariables:r,radarOptions:c(r.radar,t)}},"buildRadarStyleOptions"),K={parser:O,db:k,renderer:D,styles:i(({radar:t}={})=>{const{themeVariables:e,radarOptions:a}=_(t);return`\n\t.radarTitle {\n\t\tfont-size: ${e.fontSize};\n\t\tcolor: ${e.titleColor};\n\t\tdominant-baseline: hanging;\n\t\ttext-anchor: middle;\n\t}\n\t.radarAxisLine {\n\t\tstroke: ${a.axisColor};\n\t\tstroke-width: ${a.axisStrokeWidth};\n\t}\n\t.radarAxisLabel {\n\t\tdominant-baseline: middle;\n\t\ttext-anchor: middle;\n\t\tfont-size: ${a.axisLabelFontSize}px;\n\t\tcolor: ${a.axisColor};\n\t}\n\t.radarGraticule {\n\t\tfill: ${a.graticuleColor};\n\t\tfill-opacity: ${a.graticuleOpacity};\n\t\tstroke: ${a.graticuleColor};\n\t\tstroke-width: ${a.graticuleStrokeWidth};\n\t}\n\t.radarLegendText {\n\t\ttext-anchor: start;\n\t\tfont-size: ${a.legendFontSize}px;\n\t\tdominant-baseline: hanging;\n\t}\n\t${G(e,a)}\n\t`},"styles")};export{K 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.