"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[1561],{85054:(t,e,a)=>{a.d(e,{S:()=>n});var r=a(70416);function n(t,e){if(t.accDescr){e.setAccDescription?.(t.accDescr)}if(t.accTitle){e.setAccTitle?.(t.accTitle)}if(t.title){e.setDiagramTitle?.(t.title)}}(0,r.K2)(n,"populateCommonDb")},41561:(t,e,a)=>{a.d(e,{diagram:()=>F});var r=a(29479);var n=a(85054);var s=a(29131);var i=a(42418);var o=a(70416);var c=a(24010);var l={showLegend:true,ticks:5,max:null,min:0,graticule:"circle"};var d={axes:[],curves:[],options:l};var p=structuredClone(d);var g=i.UI.radar;var u=(0,o.K2)((()=>{const t=(0,s.$t)({...g,...(0,i.zj)().radar});return t}),"getConfig");var h=(0,o.K2)((()=>p.axes),"getAxes");var x=(0,o.K2)((()=>p.curves),"getCurves");var m=(0,o.K2)((()=>p.options),"getOptions");var v=(0,o.K2)((t=>{p.axes=t.map((t=>({name:t.name,label:t.label??t.name})))}),"setAxes");var $=(0,o.K2)((t=>{p.curves=t.map((t=>({name:t.name,label:t.label??t.name,entries:f(t.entries)})))}),"setCurves");var f=(0,o.K2)((t=>{if(t[0].axis==void 0){return t.map((t=>t.value))}const e=h();if(e.length===0){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(a===void 0){throw new Error("Missing entry for axis "+e.label)}return a.value}))}),"computeCurveEntries");var y=(0,o.K2)((t=>{const e=t.reduce(((t,e)=>{t[e.name]=e;return t}),{});p.options={showLegend:e.showLegend?.value??l.showLegend,ticks:e.ticks?.value??l.ticks,max:e.max?.value??l.max,min:e.min?.value??l.min,graticule:e.graticule?.value??l.graticule}}),"setOptions");var b=(0,o.K2)((()=>{(0,i.IU)();p=structuredClone(d)}),"clear");var w={getAxes:h,getCurves:x,getOptions:m,setAxes:v,setCurves:$,setOptions:y,getConfig:u,clear:b,setAccTitle:i.SV,getAccTitle:i.iN,setDiagramTitle:i.ke,getDiagramTitle:i.ab,getAccDescription:i.m7,setAccDescription:i.EI};var C=(0,o.K2)((t=>{(0,n.S)(t,w);const{axes:e,curves:a,options:r}=t;w.setAxes(e);w.setCurves(a);w.setOptions(r)}),"populate");var M={parse:(0,o.K2)((async t=>{const e=await(0,c.qg)("radar",t);o.Rm.debug(e);C(e)}),"parse")};var K=(0,o.K2)(((t,e,a,n)=>{const s=n.db;const i=s.getAxes();const o=s.getCurves();const c=s.getOptions();const l=s.getConfig();const d=s.getDiagramTitle();const p=(0,r.D)(e);const g=L(p,l);const u=c.max??Math.max(...o.map((t=>Math.max(...t.entries))));const h=c.min;const x=Math.min(l.width,l.height)/2;T(g,i,x,c.ticks,c.graticule);k(g,i,x,l);A(g,i,o,h,u,c.graticule,l);I(g,o,c.showLegend,l);g.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-l.height/2-l.marginTop)}),"draw");var L=(0,o.K2)(((t,e)=>{const a=e.width+e.marginLeft+e.marginRight;const r=e.height+e.marginTop+e.marginBottom;const n={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};t.attr("viewbox",`0 0 ${a} ${r}`).attr("width",a).attr("height",r);return t.append("g").attr("transform",`translate(${n.x}, ${n.y})`)}),"drawFrame");var T=(0,o.K2)(((t,e,a,r,n)=>{if(n==="circle"){for(let e=0;e{const a=2*e*Math.PI/n-Math.PI/2;const r=i*Math.cos(a);const s=i*Math.sin(a);return`${r},${s}`})).join(" ");t.append("polygon").attr("points",o).attr("class","radarGraticule")}}}),"drawGraticule");var k=(0,o.K2)(((t,e,a,r)=>{const n=e.length;for(let s=0;s{if(e.entries.length!==o){return}const l=e.entries.map(((t,e)=>{const a=2*Math.PI*e/o-Math.PI/2;const s=O(t,r,n,c);const i=s*Math.cos(a);const l=s*Math.sin(a);return{x:i,y:l}}));if(s==="circle"){t.append("path").attr("d",S(l,i.curveTension)).attr("class",`radarCurve-${a}`)}else if(s==="polygon"){t.append("polygon").attr("points",l.map((t=>`${t.x},${t.y}`)).join(" ")).attr("class",`radarCurve-${a}`)}}))}(0,o.K2)(A,"drawCurves");function O(t,e,a,r){const n=Math.min(Math.max(t,e),a);return r*(n-e)/(a-e)}(0,o.K2)(O,"relativeRadius");function S(t,e){const a=t.length;let r=`M${t[0].x},${t[0].y}`;for(let n=0;n{const r=t.append("g").attr("transform",`translate(${n}, ${s+a*i})`);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)}))}(0,o.K2)(I,"drawLegend");var D={draw:K};var z=(0,o.K2)(((t,e)=>{let a="";for(let r=0;r{const e=(0,i.P$)();const a=(0,i.zj)();const r=(0,s.$t)(e,a.themeVariables);const n=(0,s.$t)(r.radar,t);return{themeVariables:r,radarOptions:n}}),"buildRadarStyleOptions");var _=(0,o.K2)((({radar:t}={})=>{const{themeVariables:e,radarOptions:a}=E(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${z(e,a)}\n\t`}),"styles");var F={parser:M,db:w,renderer:D,styles:_}}}]);