Buckets:
| import{p as k}from"./B4AX6BUb.js";import{k as R,l as I,G as F,F as _,m as E,n as D,_ as c,V as P,I as G,R as y,P as C,S as z,q as B,aa as V,r as W}from"./CFM6C53a.js";import{p as H}from"./C6fgJHfO.js";var m={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:m},x=structuredClone(w),j=z.radar,q=c(()=>y({...j,...C().radar}),"getConfig"),b=c(()=>x.axes,"getAxes"),N=c(()=>x.curves,"getCurves"),U=c(()=>x.options,"getOptions"),X=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Y=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Z(t.entries)}))},"setCurves"),Z=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(n=>n.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),K=c(()=>{G(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:N,getOptions:U,setAxes:X,setCurves:Y,setOptions:J,getConfig:q,clear:K,setAccTitle:D,getAccTitle:E,setDiagramTitle:_,getDiagramTitle:F,getAccDescription:I,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const n=r.db,i=n.getAxes(),l=n.getCurves(),s=n.getOptions(),o=n.getConfig(),d=n.getDiagramTitle(),p=P(t),u=at(p,o),g=s.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=s.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,s.ticks,s.graticule),nt(u,i,v,o),A(u,i,l,h,g,s.graticule,o),T(u,l,s.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,n={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return W(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${n.x}, ${n.y})`)},"drawFrame"),rt=c((a,t,e,r,n)=>{if(n==="circle")for(let i=0;i<r;i++){const l=e*(i+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(n==="polygon"){const i=t.length;for(let l=0;l<r;l++){const s=e*(l+1)/r,o=t.map((d,p)=>{const u=2*p*Math.PI/i-Math.PI/2,g=s*Math.cos(u),h=s*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const n=t.length;for(let i=0;i<n;i++){const l=t[i].label,s=2*i*Math.PI/n-Math.PI/2,o=Math.cos(s),d=Math.sin(s);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*o).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");const p=o>.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,n,i,l){const s=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==s)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/s-Math.PI/2,f=M(g,r,n,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const n=Math.min(Math.max(a,t),e);return r*(n-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let n=0;n<e;n++){const i=a[(n-1+e)%e],l=a[n],s=a[(n+1)%e],o=a[(n+2)%e],d={x:l.x+(s.x-i.x)*t,y:l.y+(s.y-i.y)*t},p={x:s.x-(o.x-l.x)*t,y:s.y-(o.y-l.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${s.x},${s.y}`}return`${r} Z`}c(L,"closedRoundCurve");function T(a,t,e,r){if(!e)return;const n=(r.width/2+r.marginRight)*3/4,i=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((s,o)=>{const d=a.append("g").attr("transform",`translate(${n}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(s.label)})}c(T,"drawLegend");var st={draw:et},ot=c((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const n=a[`cScale${r}`];e+=` | |
| .radarCurve-${r} { | |
| color: ${n}; | |
| fill: ${n}; | |
| fill-opacity: ${t.curveOpacity}; | |
| stroke: ${n}; | |
| stroke-width: ${t.curveStrokeWidth}; | |
| } | |
| .radarLegendBox-${r} { | |
| fill: ${n}; | |
| fill-opacity: ${t.curveOpacity}; | |
| stroke: ${n}; | |
| } | |
| `}return e},"genIndexStyles"),it=c(a=>{const t=V(),e=C(),r=y(t,e.themeVariables),n=y(r.radar,a);return{themeVariables:r,radarOptions:n}},"buildRadarStyleOptions"),lt=c(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=it(a);return` | |
| .radarTitle { | |
| font-size: ${t.fontSize}; | |
| color: ${t.titleColor}; | |
| dominant-baseline: hanging; | |
| text-anchor: middle; | |
| } | |
| .radarAxisLine { | |
| stroke: ${e.axisColor}; | |
| stroke-width: ${e.axisStrokeWidth}; | |
| } | |
| .radarAxisLabel { | |
| font-size: ${e.axisLabelFontSize}px; | |
| color: ${e.axisColor}; | |
| } | |
| .radarGraticule { | |
| fill: ${e.graticuleColor}; | |
| fill-opacity: ${e.graticuleOpacity}; | |
| stroke: ${e.graticuleColor}; | |
| stroke-width: ${e.graticuleStrokeWidth}; | |
| } | |
| .radarLegendText { | |
| text-anchor: start; | |
| font-size: ${e.legendFontSize}px; | |
| dominant-baseline: hanging; | |
| } | |
| ${ot(t,e)} | |
| `},"styles"),pt={parser:tt,db:$,renderer:st,styles:lt};export{pt as diagram}; | |
Xet Storage Details
- Size:
- 5.86 kB
- Xet hash:
- 1d23fa9280966eeab4ff98b17806e49600be82969a0c3c690cafc9877bb554c5
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.