@aggroot-team/aggroot 1.8.8 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +666 -660
- package/package.json +1 -1
- package/share/web/dist/assets/arc-D1-xmnmt.js +1 -0
- package/share/web/dist/assets/arc-lB0tm96X.js +1 -0
- package/share/web/dist/assets/arc-qUDY57nl.js +1 -0
- package/share/web/dist/assets/architectureDiagram-3BPJPVTR-5x1c3saA.js +36 -0
- package/share/web/dist/assets/architectureDiagram-3BPJPVTR-DMBx-2Be.js +36 -0
- package/share/web/dist/assets/architectureDiagram-3BPJPVTR-Dp0UssQS.js +36 -0
- package/share/web/dist/assets/blockDiagram-GPEHLZMM-BCL5dg7K.js +132 -0
- package/share/web/dist/assets/blockDiagram-GPEHLZMM-BGvAyQtt.js +132 -0
- package/share/web/dist/assets/blockDiagram-GPEHLZMM-BQxF5hb_.js +132 -0
- package/share/web/dist/assets/c4Diagram-AAUBKEIU-D4w_bTGM.js +10 -0
- package/share/web/dist/assets/c4Diagram-AAUBKEIU-DlS4uT1_.js +10 -0
- package/share/web/dist/assets/c4Diagram-AAUBKEIU-U4nXEZ3l.js +10 -0
- package/share/web/dist/assets/channel-B3Bm5XZk.js +1 -0
- package/share/web/dist/assets/channel-BA5eGuYn.js +1 -0
- package/share/web/dist/assets/channel-Bru19Y4g.js +1 -0
- package/share/web/dist/assets/chunk-2J33WTMH-D6oaOjay.js +1 -0
- package/share/web/dist/assets/chunk-2J33WTMH-cdZ9jzPc.js +1 -0
- package/share/web/dist/assets/chunk-2J33WTMH-eVY-aT34.js +1 -0
- package/share/web/dist/assets/chunk-4BX2VUAB-C8Cn-5pC.js +1 -0
- package/share/web/dist/assets/chunk-4BX2VUAB-pE7oDAOb.js +1 -0
- package/share/web/dist/assets/chunk-4BX2VUAB-wPqPwSJz.js +1 -0
- package/share/web/dist/assets/chunk-55IACEB6-C3RQmN-K.js +1 -0
- package/share/web/dist/assets/chunk-55IACEB6-CNgdotn1.js +1 -0
- package/share/web/dist/assets/chunk-55IACEB6-DEFzCfgx.js +1 -0
- package/share/web/dist/assets/chunk-727SXJPM--kUckukx.js +206 -0
- package/share/web/dist/assets/chunk-727SXJPM-C2aW4Ebe.js +206 -0
- package/share/web/dist/assets/chunk-727SXJPM-CtLXL4eI.js +206 -0
- package/share/web/dist/assets/chunk-AQP2D5EJ-BNz2j229.js +231 -0
- package/share/web/dist/assets/chunk-AQP2D5EJ-DqVrkfaW.js +231 -0
- package/share/web/dist/assets/chunk-AQP2D5EJ-LP7E3x9w.js +231 -0
- package/share/web/dist/assets/chunk-FMBD7UC4-C2O3Bngt.js +15 -0
- package/share/web/dist/assets/chunk-FMBD7UC4-DHpKujDO.js +15 -0
- package/share/web/dist/assets/chunk-FMBD7UC4-DvtGDPYe.js +15 -0
- package/share/web/dist/assets/chunk-ND2GUHAM-B8qCem0k.js +1 -0
- package/share/web/dist/assets/chunk-ND2GUHAM-qGV17DoW.js +1 -0
- package/share/web/dist/assets/chunk-ND2GUHAM-szPdXSrQ.js +1 -0
- package/share/web/dist/assets/chunk-QZHKN3VN-Bgj3z-LO.js +1 -0
- package/share/web/dist/assets/chunk-QZHKN3VN-Bt-x4gum.js +1 -0
- package/share/web/dist/assets/chunk-QZHKN3VN-CDpxoAzy.js +1 -0
- package/share/web/dist/assets/classDiagram-4FO5ZUOK-9VlVOzLG.js +1 -0
- package/share/web/dist/assets/classDiagram-4FO5ZUOK-DVYUx4xg.js +1 -0
- package/share/web/dist/assets/classDiagram-4FO5ZUOK-DphUz-_B.js +1 -0
- package/share/web/dist/assets/classDiagram-v2-Q7XG4LA2-9VlVOzLG.js +1 -0
- package/share/web/dist/assets/classDiagram-v2-Q7XG4LA2-DVYUx4xg.js +1 -0
- package/share/web/dist/assets/classDiagram-v2-Q7XG4LA2-DphUz-_B.js +1 -0
- package/share/web/dist/assets/cose-bilkent-S5V4N54A-B7oR3DyP.js +1 -0
- package/share/web/dist/assets/cose-bilkent-S5V4N54A-ByytJvz1.js +1 -0
- package/share/web/dist/assets/cose-bilkent-S5V4N54A-lFcdH4cW.js +1 -0
- package/share/web/dist/assets/dagre-BM42HDAG-BEZZ70sL.js +4 -0
- package/share/web/dist/assets/dagre-BM42HDAG-C2MUVJvo.js +4 -0
- package/share/web/dist/assets/dagre-BM42HDAG-C9SDvHaG.js +4 -0
- package/share/web/dist/assets/diagram-2AECGRRQ-BYPViLS9.js +43 -0
- package/share/web/dist/assets/diagram-2AECGRRQ-BfysOZsZ.js +43 -0
- package/share/web/dist/assets/diagram-2AECGRRQ-DfNzoPmb.js +43 -0
- package/share/web/dist/assets/diagram-5GNKFQAL-BkzSh7ps.js +10 -0
- package/share/web/dist/assets/diagram-5GNKFQAL-CeibtnH3.js +10 -0
- package/share/web/dist/assets/diagram-5GNKFQAL-iGwAHf9j.js +10 -0
- package/share/web/dist/assets/diagram-KO2AKTUF-Co760L_W.js +3 -0
- package/share/web/dist/assets/diagram-KO2AKTUF-D8egQ8Yg.js +3 -0
- package/share/web/dist/assets/diagram-KO2AKTUF-Fje0YCRr.js +3 -0
- package/share/web/dist/assets/diagram-LMA3HP47-BX1z7xbQ.js +24 -0
- package/share/web/dist/assets/diagram-LMA3HP47-CfQVFz42.js +24 -0
- package/share/web/dist/assets/diagram-LMA3HP47-DsqAP__t.js +24 -0
- package/share/web/dist/assets/diagram-OG6HWLK6-CIswB7UK.js +24 -0
- package/share/web/dist/assets/diagram-OG6HWLK6-D0YeWj_0.js +24 -0
- package/share/web/dist/assets/diagram-OG6HWLK6-DpnuUa1_.js +24 -0
- package/share/web/dist/assets/erDiagram-TEJ5UH35--XzZG3vg.js +85 -0
- package/share/web/dist/assets/erDiagram-TEJ5UH35-C8E_aGnu.js +85 -0
- package/share/web/dist/assets/erDiagram-TEJ5UH35-CsgA00X1.js +85 -0
- package/share/web/dist/assets/flowDiagram-I6XJVG4X-DrEzlHME.js +162 -0
- package/share/web/dist/assets/flowDiagram-I6XJVG4X-N5On9yW7.js +162 -0
- package/share/web/dist/assets/flowDiagram-I6XJVG4X-veDKCmdm.js +162 -0
- package/share/web/dist/assets/ganttDiagram-6RSMTGT7-B38EbWyx.js +292 -0
- package/share/web/dist/assets/ganttDiagram-6RSMTGT7-CWXBp3Nv.js +292 -0
- package/share/web/dist/assets/ganttDiagram-6RSMTGT7-ritdFwn_.js +292 -0
- package/share/web/dist/assets/gitGraphDiagram-PVQCEYII-BvrAMgme.js +106 -0
- package/share/web/dist/assets/gitGraphDiagram-PVQCEYII-Di1N3Q6K.js +106 -0
- package/share/web/dist/assets/gitGraphDiagram-PVQCEYII-JZ_vZk6r.js +106 -0
- package/share/web/dist/assets/index-CUO5Op8Z.js +407 -0
- package/share/web/dist/assets/index-CWmHNAzt.js +407 -0
- package/share/web/dist/assets/index-CfZi-_-W.js +407 -0
- package/share/web/dist/assets/infoDiagram-5YYISTIA-C5klhJkm.js +2 -0
- package/share/web/dist/assets/infoDiagram-5YYISTIA-DGo9iAf1.js +2 -0
- package/share/web/dist/assets/infoDiagram-5YYISTIA-iPXYbEHR.js +2 -0
- package/share/web/dist/assets/ishikawaDiagram-YF4QCWOH-B_fg7YhW.js +70 -0
- package/share/web/dist/assets/ishikawaDiagram-YF4QCWOH-Dn5q76gw.js +70 -0
- package/share/web/dist/assets/ishikawaDiagram-YF4QCWOH-DrSVzjbw.js +70 -0
- package/share/web/dist/assets/journeyDiagram-JHISSGLW-BSOeJkGp.js +139 -0
- package/share/web/dist/assets/journeyDiagram-JHISSGLW-BTMYIf1e.js +139 -0
- package/share/web/dist/assets/journeyDiagram-JHISSGLW-CfDkxnhu.js +139 -0
- package/share/web/dist/assets/kanban-definition-UN3LZRKU-Bf10Hgev.js +89 -0
- package/share/web/dist/assets/kanban-definition-UN3LZRKU-CFvdGbIT.js +89 -0
- package/share/web/dist/assets/kanban-definition-UN3LZRKU-DVCgdsup.js +89 -0
- package/share/web/dist/assets/linear-BuZfoV7P.js +1 -0
- package/share/web/dist/assets/linear-Cl0xue9D.js +1 -0
- package/share/web/dist/assets/linear-DA-PRFNX.js +1 -0
- package/share/web/dist/assets/mindmap-definition-RKZ34NQL-C7mBQtCS.js +96 -0
- package/share/web/dist/assets/mindmap-definition-RKZ34NQL-DPETRY9W.js +96 -0
- package/share/web/dist/assets/mindmap-definition-RKZ34NQL-O3l7txqL.js +96 -0
- package/share/web/dist/assets/pieDiagram-4H26LBE5-CZ9zaHy-.js +30 -0
- package/share/web/dist/assets/pieDiagram-4H26LBE5-DWsr77WB.js +30 -0
- package/share/web/dist/assets/pieDiagram-4H26LBE5-LJC7tux2.js +30 -0
- package/share/web/dist/assets/quadrantDiagram-W4KKPZXB-BgbXUeYZ.js +7 -0
- package/share/web/dist/assets/quadrantDiagram-W4KKPZXB-DbWrqYvW.js +7 -0
- package/share/web/dist/assets/quadrantDiagram-W4KKPZXB-ma2mZhGO.js +7 -0
- package/share/web/dist/assets/requirementDiagram-4Y6WPE33-BaQWRwJt.js +84 -0
- package/share/web/dist/assets/requirementDiagram-4Y6WPE33-CIZXNZTm.js +84 -0
- package/share/web/dist/assets/requirementDiagram-4Y6WPE33-i5shhFXk.js +84 -0
- package/share/web/dist/assets/sankeyDiagram-5OEKKPKP-BHiPKaAt.js +40 -0
- package/share/web/dist/assets/sankeyDiagram-5OEKKPKP-O34VGoeQ.js +40 -0
- package/share/web/dist/assets/sankeyDiagram-5OEKKPKP-ejOS7WnA.js +40 -0
- package/share/web/dist/assets/sequenceDiagram-3UESZ5HK-Cc52z9EG.js +162 -0
- package/share/web/dist/assets/sequenceDiagram-3UESZ5HK-D2XhJ5vw.js +162 -0
- package/share/web/dist/assets/sequenceDiagram-3UESZ5HK-w-6ftIn5.js +162 -0
- package/share/web/dist/assets/stateDiagram-AJRCARHV-CjeYQQJE.js +1 -0
- package/share/web/dist/assets/stateDiagram-AJRCARHV-UvjRu-r1.js +1 -0
- package/share/web/dist/assets/stateDiagram-AJRCARHV-bk2slbvF.js +1 -0
- package/share/web/dist/assets/stateDiagram-v2-BHNVJYJU-BP-EscdR.js +1 -0
- package/share/web/dist/assets/stateDiagram-v2-BHNVJYJU-BsRawmP-.js +1 -0
- package/share/web/dist/assets/stateDiagram-v2-BHNVJYJU-CmaVLj5D.js +1 -0
- package/share/web/dist/assets/timeline-definition-PNZ67QCA-Be2E3Uyb.js +120 -0
- package/share/web/dist/assets/timeline-definition-PNZ67QCA-Bs_476xO.js +120 -0
- package/share/web/dist/assets/timeline-definition-PNZ67QCA-CRy2l2--.js +120 -0
- package/share/web/dist/assets/vennDiagram-CIIHVFJN-4DBut7gE.js +34 -0
- package/share/web/dist/assets/vennDiagram-CIIHVFJN-BD9aC-Oh.js +34 -0
- package/share/web/dist/assets/vennDiagram-CIIHVFJN-Rapi9CcF.js +34 -0
- package/share/web/dist/assets/wardley-L42UT6IY-CnoVwSCl.js +161 -0
- package/share/web/dist/assets/wardley-L42UT6IY-USJaAMFC.js +161 -0
- package/share/web/dist/assets/wardley-L42UT6IY-wgG6Zqzh.js +161 -0
- package/share/web/dist/assets/wardleyDiagram-YWT4CUSO-BKldCrWN.js +78 -0
- package/share/web/dist/assets/wardleyDiagram-YWT4CUSO-CQwbXcsV.js +78 -0
- package/share/web/dist/assets/wardleyDiagram-YWT4CUSO-DXj65Bfs.js +78 -0
- package/share/web/dist/assets/xychartDiagram-2RQKCTM6-D3gg8SrG.js +7 -0
- package/share/web/dist/assets/xychartDiagram-2RQKCTM6-Dsl9_fgE.js +7 -0
- package/share/web/dist/assets/xychartDiagram-2RQKCTM6-mg1o23HG.js +7 -0
- package/share/web/dist/index.html +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{G as S,be as F,h as K,a2 as Q,b1 as Y,a3 as tt,b2 as et,a7 as at,b4 as nt,b as d,aF as R,a5 as rt,t as it,b0 as st,aN as ot,F as lt,u as ct,T as ut}from"./index-CWmHNAzt.js";import{p as dt}from"./chunk-4BX2VUAB-pE7oDAOb.js";import{p as pt}from"./wardley-L42UT6IY-CnoVwSCl.js";import{d as I}from"./arc-qUDY57nl.js";import{o as gt}from"./ordinal-Cboi1Yqb.js";import"./init-Gi6I4Gst.js";function ft(t,a){return a<t?-1:a>t?1:a>=t?0:NaN}function ht(t){return t}function mt(){var t=ht,a=ft,f=null,y=S(0),s=S(F),p=S(0);function o(e){var r,l=(e=K(e)).length,g,h,v=0,c=new Array(l),i=new Array(l),x=+y.apply(this,arguments),w=Math.min(F,Math.max(-F,s.apply(this,arguments)-x)),m,D=Math.min(Math.abs(w)/l,p.apply(this,arguments)),$=D*(w<0?-1:1),u;for(r=0;r<l;++r)(u=i[c[r]=r]=+t(e[r],r,e))>0&&(v+=u);for(a!=null?c.sort(function(A,C){return a(i[A],i[C])}):f!=null&&c.sort(function(A,C){return f(e[A],e[C])}),r=0,h=v?(w-l*$)/v:0;r<l;++r,x=m)g=c[r],u=i[g],m=x+(u>0?u*h:0)+$,i[g]={data:e[g],index:r,value:u,startAngle:x,endAngle:m,padAngle:D};return i}return o.value=function(e){return arguments.length?(t=typeof e=="function"?e:S(+e),o):t},o.sortValues=function(e){return arguments.length?(a=e,f=null,o):a},o.sort=function(e){return arguments.length?(f=e,a=null,o):f},o.startAngle=function(e){return arguments.length?(y=typeof e=="function"?e:S(+e),o):y},o.endAngle=function(e){return arguments.length?(s=typeof e=="function"?e:S(+e),o):s},o.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:S(+e),o):p},o}var vt=ut.pie,W={sections:new Map,showData:!1},T=W.sections,z=W.showData,xt=structuredClone(vt),St=d(()=>structuredClone(xt),"getConfig"),yt=d(()=>{T=new Map,z=W.showData,ct()},"clear"),wt=d(({label:t,value:a})=>{if(a<0)throw new Error(`"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(t)||(T.set(t,a),R.debug(`added new section: ${t}, with value: ${a}`))},"addSection"),At=d(()=>T,"getSections"),Ct=d(t=>{z=t},"setShowData"),Dt=d(()=>z,"getShowData"),_={getConfig:St,clear:yt,setDiagramTitle:nt,getDiagramTitle:at,setAccTitle:et,getAccTitle:tt,setAccDescription:Y,getAccDescription:Q,addSection:wt,getSections:At,setShowData:Ct,getShowData:Dt},$t=d((t,a)=>{dt(t,a),a.setShowData(t.showData),t.sections.map(a.addSection)},"populateDb"),Tt={parse:d(async t=>{const a=await pt("pie",t);R.debug(a),$t(a,_)},"parse")},bt=d(t=>`
|
|
2
|
+
.pieCircle{
|
|
3
|
+
stroke: ${t.pieStrokeColor};
|
|
4
|
+
stroke-width : ${t.pieStrokeWidth};
|
|
5
|
+
opacity : ${t.pieOpacity};
|
|
6
|
+
}
|
|
7
|
+
.pieOuterCircle{
|
|
8
|
+
stroke: ${t.pieOuterStrokeColor};
|
|
9
|
+
stroke-width: ${t.pieOuterStrokeWidth};
|
|
10
|
+
fill: none;
|
|
11
|
+
}
|
|
12
|
+
.pieTitleText {
|
|
13
|
+
text-anchor: middle;
|
|
14
|
+
font-size: ${t.pieTitleTextSize};
|
|
15
|
+
fill: ${t.pieTitleTextColor};
|
|
16
|
+
font-family: ${t.fontFamily};
|
|
17
|
+
}
|
|
18
|
+
.slice {
|
|
19
|
+
font-family: ${t.fontFamily};
|
|
20
|
+
fill: ${t.pieSectionTextColor};
|
|
21
|
+
font-size:${t.pieSectionTextSize};
|
|
22
|
+
// fill: white;
|
|
23
|
+
}
|
|
24
|
+
.legend text {
|
|
25
|
+
fill: ${t.pieLegendTextColor};
|
|
26
|
+
font-family: ${t.fontFamily};
|
|
27
|
+
font-size: ${t.pieLegendTextSize};
|
|
28
|
+
}
|
|
29
|
+
`,"getStyles"),kt=bt,Et=d(t=>{const a=[...t.values()].reduce((s,p)=>s+p,0),f=[...t.entries()].map(([s,p])=>({label:s,value:p})).filter(s=>s.value/a*100>=1);return mt().value(s=>s.value).sort(null)(f)},"createPieArcs"),Mt=d((t,a,f,y)=>{R.debug(`rendering pie chart
|
|
30
|
+
`+t);const s=y.db,p=rt(),o=it(s.getConfig(),p.pie),e=40,r=18,l=4,g=450,h=g,v=st(a),c=v.append("g");c.attr("transform","translate("+h/2+","+g/2+")");const{themeVariables:i}=p;let[x]=ot(i.pieOuterStrokeWidth);x??=2;const w=o.textPosition,m=Math.min(h,g)/2-e,D=I().innerRadius(0).outerRadius(m),$=I().innerRadius(m*w).outerRadius(m*w);c.append("circle").attr("cx",0).attr("cy",0).attr("r",m+x/2).attr("class","pieOuterCircle");const u=s.getSections(),A=Et(u),C=[i.pie1,i.pie2,i.pie3,i.pie4,i.pie5,i.pie6,i.pie7,i.pie8,i.pie9,i.pie10,i.pie11,i.pie12];let b=0;u.forEach(n=>{b+=n});const G=A.filter(n=>(n.data.value/b*100).toFixed(0)!=="0"),k=gt(C).domain([...u.keys()]);c.selectAll("mySlices").data(G).enter().append("path").attr("d",D).attr("fill",n=>k(n.data.label)).attr("class","pieCircle"),c.selectAll("mySlices").data(G).enter().append("text").text(n=>(n.data.value/b*100).toFixed(0)+"%").attr("transform",n=>"translate("+$.centroid(n)+")").style("text-anchor","middle").attr("class","slice");const V=c.append("text").text(s.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),N=[...u.entries()].map(([n,M])=>({label:n,value:M})),E=c.selectAll(".legend").data(N).enter().append("g").attr("class","legend").attr("transform",(n,M)=>{const P=r+l,q=P*N.length/2,H=12*r,J=M*P-q;return"translate("+H+","+J+")"});E.append("rect").attr("width",r).attr("height",r).style("fill",n=>k(n.label)).style("stroke",n=>k(n.label)),E.append("text").attr("x",r+l).attr("y",r-l).text(n=>s.getShowData()?`${n.label} [${n.value}]`:n.label);const U=Math.max(...E.selectAll("text").nodes().map(n=>n?.getBoundingClientRect().width??0)),j=h+e+r+l+U,L=V.node()?.getBoundingClientRect().width??0,X=h/2-L/2,Z=h/2+L/2,B=Math.min(0,X),O=Math.max(j,Z)-B;v.attr("viewBox",`${B} 0 ${O} ${g}`),lt(v,g,O,o.useMaxWidth)},"draw"),Ft={draw:Mt},Ot={parser:Tt,db:_,renderer:Ft,styles:kt};export{Ot as diagram};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{G as S,be as F,h as K,a2 as Q,b1 as Y,a3 as tt,b2 as et,a7 as at,b4 as nt,b as d,aF as R,a5 as rt,t as it,b0 as st,aN as ot,F as lt,u as ct,T as ut}from"./index-CfZi-_-W.js";import{p as dt}from"./chunk-4BX2VUAB-wPqPwSJz.js";import{p as pt}from"./wardley-L42UT6IY-wgG6Zqzh.js";import{d as I}from"./arc-D1-xmnmt.js";import{o as gt}from"./ordinal-Cboi1Yqb.js";import"./init-Gi6I4Gst.js";function ft(t,a){return a<t?-1:a>t?1:a>=t?0:NaN}function ht(t){return t}function mt(){var t=ht,a=ft,f=null,y=S(0),s=S(F),p=S(0);function o(e){var r,l=(e=K(e)).length,g,h,v=0,c=new Array(l),i=new Array(l),x=+y.apply(this,arguments),w=Math.min(F,Math.max(-F,s.apply(this,arguments)-x)),m,D=Math.min(Math.abs(w)/l,p.apply(this,arguments)),$=D*(w<0?-1:1),u;for(r=0;r<l;++r)(u=i[c[r]=r]=+t(e[r],r,e))>0&&(v+=u);for(a!=null?c.sort(function(A,C){return a(i[A],i[C])}):f!=null&&c.sort(function(A,C){return f(e[A],e[C])}),r=0,h=v?(w-l*$)/v:0;r<l;++r,x=m)g=c[r],u=i[g],m=x+(u>0?u*h:0)+$,i[g]={data:e[g],index:r,value:u,startAngle:x,endAngle:m,padAngle:D};return i}return o.value=function(e){return arguments.length?(t=typeof e=="function"?e:S(+e),o):t},o.sortValues=function(e){return arguments.length?(a=e,f=null,o):a},o.sort=function(e){return arguments.length?(f=e,a=null,o):f},o.startAngle=function(e){return arguments.length?(y=typeof e=="function"?e:S(+e),o):y},o.endAngle=function(e){return arguments.length?(s=typeof e=="function"?e:S(+e),o):s},o.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:S(+e),o):p},o}var vt=ut.pie,W={sections:new Map,showData:!1},T=W.sections,z=W.showData,xt=structuredClone(vt),St=d(()=>structuredClone(xt),"getConfig"),yt=d(()=>{T=new Map,z=W.showData,ct()},"clear"),wt=d(({label:t,value:a})=>{if(a<0)throw new Error(`"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(t)||(T.set(t,a),R.debug(`added new section: ${t}, with value: ${a}`))},"addSection"),At=d(()=>T,"getSections"),Ct=d(t=>{z=t},"setShowData"),Dt=d(()=>z,"getShowData"),_={getConfig:St,clear:yt,setDiagramTitle:nt,getDiagramTitle:at,setAccTitle:et,getAccTitle:tt,setAccDescription:Y,getAccDescription:Q,addSection:wt,getSections:At,setShowData:Ct,getShowData:Dt},$t=d((t,a)=>{dt(t,a),a.setShowData(t.showData),t.sections.map(a.addSection)},"populateDb"),Tt={parse:d(async t=>{const a=await pt("pie",t);R.debug(a),$t(a,_)},"parse")},bt=d(t=>`
|
|
2
|
+
.pieCircle{
|
|
3
|
+
stroke: ${t.pieStrokeColor};
|
|
4
|
+
stroke-width : ${t.pieStrokeWidth};
|
|
5
|
+
opacity : ${t.pieOpacity};
|
|
6
|
+
}
|
|
7
|
+
.pieOuterCircle{
|
|
8
|
+
stroke: ${t.pieOuterStrokeColor};
|
|
9
|
+
stroke-width: ${t.pieOuterStrokeWidth};
|
|
10
|
+
fill: none;
|
|
11
|
+
}
|
|
12
|
+
.pieTitleText {
|
|
13
|
+
text-anchor: middle;
|
|
14
|
+
font-size: ${t.pieTitleTextSize};
|
|
15
|
+
fill: ${t.pieTitleTextColor};
|
|
16
|
+
font-family: ${t.fontFamily};
|
|
17
|
+
}
|
|
18
|
+
.slice {
|
|
19
|
+
font-family: ${t.fontFamily};
|
|
20
|
+
fill: ${t.pieSectionTextColor};
|
|
21
|
+
font-size:${t.pieSectionTextSize};
|
|
22
|
+
// fill: white;
|
|
23
|
+
}
|
|
24
|
+
.legend text {
|
|
25
|
+
fill: ${t.pieLegendTextColor};
|
|
26
|
+
font-family: ${t.fontFamily};
|
|
27
|
+
font-size: ${t.pieLegendTextSize};
|
|
28
|
+
}
|
|
29
|
+
`,"getStyles"),kt=bt,Et=d(t=>{const a=[...t.values()].reduce((s,p)=>s+p,0),f=[...t.entries()].map(([s,p])=>({label:s,value:p})).filter(s=>s.value/a*100>=1);return mt().value(s=>s.value).sort(null)(f)},"createPieArcs"),Mt=d((t,a,f,y)=>{R.debug(`rendering pie chart
|
|
30
|
+
`+t);const s=y.db,p=rt(),o=it(s.getConfig(),p.pie),e=40,r=18,l=4,g=450,h=g,v=st(a),c=v.append("g");c.attr("transform","translate("+h/2+","+g/2+")");const{themeVariables:i}=p;let[x]=ot(i.pieOuterStrokeWidth);x??=2;const w=o.textPosition,m=Math.min(h,g)/2-e,D=I().innerRadius(0).outerRadius(m),$=I().innerRadius(m*w).outerRadius(m*w);c.append("circle").attr("cx",0).attr("cy",0).attr("r",m+x/2).attr("class","pieOuterCircle");const u=s.getSections(),A=Et(u),C=[i.pie1,i.pie2,i.pie3,i.pie4,i.pie5,i.pie6,i.pie7,i.pie8,i.pie9,i.pie10,i.pie11,i.pie12];let b=0;u.forEach(n=>{b+=n});const G=A.filter(n=>(n.data.value/b*100).toFixed(0)!=="0"),k=gt(C).domain([...u.keys()]);c.selectAll("mySlices").data(G).enter().append("path").attr("d",D).attr("fill",n=>k(n.data.label)).attr("class","pieCircle"),c.selectAll("mySlices").data(G).enter().append("text").text(n=>(n.data.value/b*100).toFixed(0)+"%").attr("transform",n=>"translate("+$.centroid(n)+")").style("text-anchor","middle").attr("class","slice");const V=c.append("text").text(s.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),N=[...u.entries()].map(([n,M])=>({label:n,value:M})),E=c.selectAll(".legend").data(N).enter().append("g").attr("class","legend").attr("transform",(n,M)=>{const P=r+l,q=P*N.length/2,H=12*r,J=M*P-q;return"translate("+H+","+J+")"});E.append("rect").attr("width",r).attr("height",r).style("fill",n=>k(n.label)).style("stroke",n=>k(n.label)),E.append("text").attr("x",r+l).attr("y",r-l).text(n=>s.getShowData()?`${n.label} [${n.value}]`:n.label);const U=Math.max(...E.selectAll("text").nodes().map(n=>n?.getBoundingClientRect().width??0)),j=h+e+r+l+U,L=V.node()?.getBoundingClientRect().width??0,X=h/2-L/2,Z=h/2+L/2,B=Math.min(0,X),O=Math.max(j,Z)-B;v.attr("viewBox",`${B} 0 ${O} ${g}`),lt(v,g,O,o.useMaxWidth)},"draw"),Ft={draw:Mt},Ot={parser:Tt,db:_,renderer:Ft,styles:kt};export{Ot as diagram};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{G as S,be as F,h as K,a2 as Q,b1 as Y,a3 as tt,b2 as et,a7 as at,b4 as nt,b as d,aF as R,a5 as rt,t as it,b0 as st,aN as ot,F as lt,u as ct,T as ut}from"./index-CUO5Op8Z.js";import{p as dt}from"./chunk-4BX2VUAB-C8Cn-5pC.js";import{p as pt}from"./wardley-L42UT6IY-USJaAMFC.js";import{d as I}from"./arc-lB0tm96X.js";import{o as gt}from"./ordinal-Cboi1Yqb.js";import"./init-Gi6I4Gst.js";function ft(t,a){return a<t?-1:a>t?1:a>=t?0:NaN}function ht(t){return t}function mt(){var t=ht,a=ft,f=null,y=S(0),s=S(F),p=S(0);function o(e){var r,l=(e=K(e)).length,g,h,v=0,c=new Array(l),i=new Array(l),x=+y.apply(this,arguments),w=Math.min(F,Math.max(-F,s.apply(this,arguments)-x)),m,D=Math.min(Math.abs(w)/l,p.apply(this,arguments)),$=D*(w<0?-1:1),u;for(r=0;r<l;++r)(u=i[c[r]=r]=+t(e[r],r,e))>0&&(v+=u);for(a!=null?c.sort(function(A,C){return a(i[A],i[C])}):f!=null&&c.sort(function(A,C){return f(e[A],e[C])}),r=0,h=v?(w-l*$)/v:0;r<l;++r,x=m)g=c[r],u=i[g],m=x+(u>0?u*h:0)+$,i[g]={data:e[g],index:r,value:u,startAngle:x,endAngle:m,padAngle:D};return i}return o.value=function(e){return arguments.length?(t=typeof e=="function"?e:S(+e),o):t},o.sortValues=function(e){return arguments.length?(a=e,f=null,o):a},o.sort=function(e){return arguments.length?(f=e,a=null,o):f},o.startAngle=function(e){return arguments.length?(y=typeof e=="function"?e:S(+e),o):y},o.endAngle=function(e){return arguments.length?(s=typeof e=="function"?e:S(+e),o):s},o.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:S(+e),o):p},o}var vt=ut.pie,W={sections:new Map,showData:!1},T=W.sections,z=W.showData,xt=structuredClone(vt),St=d(()=>structuredClone(xt),"getConfig"),yt=d(()=>{T=new Map,z=W.showData,ct()},"clear"),wt=d(({label:t,value:a})=>{if(a<0)throw new Error(`"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(t)||(T.set(t,a),R.debug(`added new section: ${t}, with value: ${a}`))},"addSection"),At=d(()=>T,"getSections"),Ct=d(t=>{z=t},"setShowData"),Dt=d(()=>z,"getShowData"),_={getConfig:St,clear:yt,setDiagramTitle:nt,getDiagramTitle:at,setAccTitle:et,getAccTitle:tt,setAccDescription:Y,getAccDescription:Q,addSection:wt,getSections:At,setShowData:Ct,getShowData:Dt},$t=d((t,a)=>{dt(t,a),a.setShowData(t.showData),t.sections.map(a.addSection)},"populateDb"),Tt={parse:d(async t=>{const a=await pt("pie",t);R.debug(a),$t(a,_)},"parse")},bt=d(t=>`
|
|
2
|
+
.pieCircle{
|
|
3
|
+
stroke: ${t.pieStrokeColor};
|
|
4
|
+
stroke-width : ${t.pieStrokeWidth};
|
|
5
|
+
opacity : ${t.pieOpacity};
|
|
6
|
+
}
|
|
7
|
+
.pieOuterCircle{
|
|
8
|
+
stroke: ${t.pieOuterStrokeColor};
|
|
9
|
+
stroke-width: ${t.pieOuterStrokeWidth};
|
|
10
|
+
fill: none;
|
|
11
|
+
}
|
|
12
|
+
.pieTitleText {
|
|
13
|
+
text-anchor: middle;
|
|
14
|
+
font-size: ${t.pieTitleTextSize};
|
|
15
|
+
fill: ${t.pieTitleTextColor};
|
|
16
|
+
font-family: ${t.fontFamily};
|
|
17
|
+
}
|
|
18
|
+
.slice {
|
|
19
|
+
font-family: ${t.fontFamily};
|
|
20
|
+
fill: ${t.pieSectionTextColor};
|
|
21
|
+
font-size:${t.pieSectionTextSize};
|
|
22
|
+
// fill: white;
|
|
23
|
+
}
|
|
24
|
+
.legend text {
|
|
25
|
+
fill: ${t.pieLegendTextColor};
|
|
26
|
+
font-family: ${t.fontFamily};
|
|
27
|
+
font-size: ${t.pieLegendTextSize};
|
|
28
|
+
}
|
|
29
|
+
`,"getStyles"),kt=bt,Et=d(t=>{const a=[...t.values()].reduce((s,p)=>s+p,0),f=[...t.entries()].map(([s,p])=>({label:s,value:p})).filter(s=>s.value/a*100>=1);return mt().value(s=>s.value).sort(null)(f)},"createPieArcs"),Mt=d((t,a,f,y)=>{R.debug(`rendering pie chart
|
|
30
|
+
`+t);const s=y.db,p=rt(),o=it(s.getConfig(),p.pie),e=40,r=18,l=4,g=450,h=g,v=st(a),c=v.append("g");c.attr("transform","translate("+h/2+","+g/2+")");const{themeVariables:i}=p;let[x]=ot(i.pieOuterStrokeWidth);x??=2;const w=o.textPosition,m=Math.min(h,g)/2-e,D=I().innerRadius(0).outerRadius(m),$=I().innerRadius(m*w).outerRadius(m*w);c.append("circle").attr("cx",0).attr("cy",0).attr("r",m+x/2).attr("class","pieOuterCircle");const u=s.getSections(),A=Et(u),C=[i.pie1,i.pie2,i.pie3,i.pie4,i.pie5,i.pie6,i.pie7,i.pie8,i.pie9,i.pie10,i.pie11,i.pie12];let b=0;u.forEach(n=>{b+=n});const G=A.filter(n=>(n.data.value/b*100).toFixed(0)!=="0"),k=gt(C).domain([...u.keys()]);c.selectAll("mySlices").data(G).enter().append("path").attr("d",D).attr("fill",n=>k(n.data.label)).attr("class","pieCircle"),c.selectAll("mySlices").data(G).enter().append("text").text(n=>(n.data.value/b*100).toFixed(0)+"%").attr("transform",n=>"translate("+$.centroid(n)+")").style("text-anchor","middle").attr("class","slice");const V=c.append("text").text(s.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),N=[...u.entries()].map(([n,M])=>({label:n,value:M})),E=c.selectAll(".legend").data(N).enter().append("g").attr("class","legend").attr("transform",(n,M)=>{const P=r+l,q=P*N.length/2,H=12*r,J=M*P-q;return"translate("+H+","+J+")"});E.append("rect").attr("width",r).attr("height",r).style("fill",n=>k(n.label)).style("stroke",n=>k(n.label)),E.append("text").attr("x",r+l).attr("y",r-l).text(n=>s.getShowData()?`${n.label} [${n.value}]`:n.label);const U=Math.max(...E.selectAll("text").nodes().map(n=>n?.getBoundingClientRect().width??0)),j=h+e+r+l+U,L=V.node()?.getBoundingClientRect().width??0,X=h/2-L/2,Z=h/2+L/2,B=Math.min(0,X),O=Math.max(j,Z)-B;v.attr("viewBox",`${B} 0 ${O} ${g}`),lt(v,g,O,o.useMaxWidth)},"draw"),Ft={draw:Mt},Ot={parser:Tt,db:_,renderer:Ft,styles:kt};export{Ot as diagram};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{b1 as Ae,a2 as ke,a7 as ae,b4 as Fe,a3 as Pe,b2 as ve,b as o,a5 as zt,aF as bt,a$ as Lt,F as Ce,u as Le,T as z,a_ as Ee,ag as De}from"./index-CWmHNAzt.js";import{l as ie}from"./linear-BuZfoV7P.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-CrowFXzY.js";var Et=(function(){var t=o(function(Y,r,l,x){for(l=l||{},x=Y.length;x--;l[Y[x]]=r);return l},"o"),n=[1,3],f=[1,4],d=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],_=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],k=[2,36],u=[1,37],T=[1,36],q=[1,38],m=[1,35],b=[1,43],g=[1,41],A=[1,45],ht=[1,14],xt=[1,23],ft=[1,18],gt=[1,19],ct=[1,20],_t=[1,21],dt=[1,22],i=[1,24],Vt=[1,25],It=[1,26],wt=[1,27],Bt=[1,28],Rt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],At=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],kt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,x,c,S,e,ut){var s=e.length-1;switch(S){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],c.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),c.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),c.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),c.setAccDescription(this.$);break;case 46:c.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:c.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:c.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:c.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:c.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:c.setXAxisLeftText(e[s-2]),c.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",c.setXAxisLeftText(e[s-1]);break;case 53:c.setXAxisLeftText(e[s]);break;case 54:c.setYAxisBottomText(e[s-2]),c.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",c.setYAxisBottomText(e[s-1]);break;case 56:c.setYAxisBottomText(e[s]);break;case 57:c.setQuadrant1Text(e[s]);break;case 58:c.setQuadrant2Text(e[s]);break;case 59:c.setQuadrant3Text(e[s]);break;case 60:c.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:f,55:d,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:f,55:d,56:h,57:p},{18:n,26:9,27:2,28:f,55:d,56:h,57:p},t(y,[2,33],{29:10}),t(_,[2,61]),t(_,[2,62]),t(_,[2,63]),{1:[2,30]},{1:[2,31]},t(a,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:u,5:T,10:q,12:m,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:Vt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(y,[2,34]),{27:46,55:d,56:h,57:p},t(a,[2,37]),t(a,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:u,5:T,10:q,12:m,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:Vt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(a,[2,45]),t(a,[2,46]),{18:[1,51]},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:65,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,21:64},t(a,[2,53],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(a,[2,56],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(a,[2,57],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,58],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,59],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,60],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(a,[2,52],{58:31,43:84,4:u,5:T,10:q,12:m,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,55],{58:31,43:85,4:u,5:T,10:q,12:m,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:89,23:88},t(w,[2,24]),t(a,[2,51],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,54],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,47],{22:89,16:90,23:101,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{46:[1,102]},t(a,[2,29],{10:At}),t(Zt,[2,27],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(a,[2,49],{10:At}),t(a,[2,48],{22:89,16:90,23:105,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:106},t(N,[2,26]),t(a,[2,50],{10:At}),t(Zt,[2,28],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var x=new Error(r);throw x.hash=l,x}},"parseError"),parse:o(function(r){var l=this,x=[0],c=[],S=[null],e=[],ut=this.table,s="",yt=0,Jt=0,me=2,$t=1,be=e.slice.call(arguments,1),D=Object.create(this.lexer),j={yy:{}};for(var Ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ft)&&(j.yy[Ft]=this.yy[Ft]);D.setInput(r,j.yy),j.yy.lexer=D,j.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Pt=D.yylloc;e.push(Pt);var Se=D.options&&D.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(R){x.length=x.length-2*R,S.length=S.length-R,e.length=e.length-R}o(_e,"popStack");function te(){var R;return R=c.pop()||D.lex()||$t,typeof R!="number"&&(R instanceof Array&&(c=R,R=c.pop()),R=l.symbols_[R]||R),R}o(te,"lex");for(var B,G,W,vt,rt={},Tt,M,ee,qt;;){if(G=x[x.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=te()),W=ut[G]&&ut[G][B]),typeof W>"u"||!W.length||!W[0]){var Ct="";qt=[];for(Tt in ut[G])this.terminals_[Tt]&&Tt>me&&qt.push("'"+this.terminals_[Tt]+"'");D.showPosition?Ct="Parse error on line "+(yt+1)+`:
|
|
2
|
+
`+D.showPosition()+`
|
|
3
|
+
Expecting `+qt.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Ct="Parse error on line "+(yt+1)+": Unexpected "+(B==$t?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Ct,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Pt,expected:qt})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+B);switch(W[0]){case 1:x.push(B),S.push(D.yytext),e.push(D.yylloc),x.push(W[1]),B=null,Jt=D.yyleng,s=D.yytext,yt=D.yylineno,Pt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],rt.$=S[S.length-M],rt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},Se&&(rt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),vt=this.performAction.apply(rt,[s,Jt,yt,j.yy,W[1],S,e].concat(be)),typeof vt<"u")return vt;M&&(x=x.slice(0,-1*M*2),S=S.slice(0,-1*M),e=e.slice(0,-1*M)),x.push(this.productions_[W[1]][0]),S.push(rt.$),e.push(rt._$),ee=ut[x[x.length-2]][x[x.length-1]],x.push(ee);break;case 3:return!0}}return!0},"parse")},qe=(function(){var Y={EOF:1,parseError:o(function(l,x){if(this.yy.parser)this.yy.parser.parseError(l,x);else throw new Error(l)},"parseError"),setInput:o(function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:o(function(r){var l=r.length,x=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===c.length?this.yylloc.first_column:0)+c[c.length-x.length].length-x[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(r){this.unput(this.match.slice(r))},"less"),pastInput:o(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
5
|
+
`+l+"^"},"showPosition"),test_match:o(function(r,l){var x,c,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),c=r[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],x=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var e in S)this[e]=S[e];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,l,x,c;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),e=0;e<S.length;e++)if(x=this._input.match(this.rules[S[e]]),x&&(!l||x[0].length>l[0].length)){if(l=x,c=e,this.options.backtrack_lexer){if(r=this.test_match(x,S[e]),r!==!1)return r;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(r=this.test_match(l,S[c]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var l=this.next();return l||this.lex()},"lex"),begin:o(function(l){this.conditionStack.push(l)},"begin"),popState:o(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:o(function(l){this.begin(l)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(l,x,c,S){switch(c){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return Y})();kt.lexer=qe;function pt(){this.yy={}}return o(pt,"Parser"),pt.prototype=kt,kt.Parser=pt,new pt})();Et.parser=Et;var ze=Et,I=De(),ot,Ve=(ot=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:z.quadrantChart?.chartWidth||500,chartWidth:z.quadrantChart?.chartHeight||500,titlePadding:z.quadrantChart?.titlePadding||10,titleFontSize:z.quadrantChart?.titleFontSize||20,quadrantPadding:z.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:z.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:z.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:z.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:z.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:z.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:z.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:z.quadrantChart?.pointTextPadding||5,pointLabelFontSize:z.quadrantChart?.pointLabelFontSize||12,pointRadius:z.quadrantChart?.pointRadius||5,xAxisPosition:z.quadrantChart?.xAxisPosition||"top",yAxisPosition:z.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:z.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:z.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:I.quadrant1Fill,quadrant2Fill:I.quadrant2Fill,quadrant3Fill:I.quadrant3Fill,quadrant4Fill:I.quadrant4Fill,quadrant1TextFill:I.quadrant1TextFill,quadrant2TextFill:I.quadrant2TextFill,quadrant3TextFill:I.quadrant3TextFill,quadrant4TextFill:I.quadrant4TextFill,quadrantPointFill:I.quadrantPointFill,quadrantPointTextFill:I.quadrantPointTextFill,quadrantXAxisTextFill:I.quadrantXAxisTextFill,quadrantYAxisTextFill:I.quadrantYAxisTextFill,quadrantTitleFill:I.quadrantTitleFill,quadrantInternalBorderStrokeFill:I.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:I.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,bt.info("clear called")}setData(n){this.data={...this.data,...n}}addPoints(n){this.data.points=[...n,...this.data.points]}addClass(n,f){this.classes.set(n,f)}setConfig(n){bt.trace("setConfig called with: ",n),this.config={...this.config,...n}}setThemeConfig(n){bt.trace("setThemeConfig called with: ",n),this.themeConfig={...this.themeConfig,...n}}calculateSpace(n,f,d,h){const p=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,y={top:n==="top"&&f?p:0,bottom:n==="bottom"&&f?p:0},_=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,a={left:this.config.yAxisPosition==="left"&&d?_:0,right:this.config.yAxisPosition==="right"&&d?_:0},k=this.config.titleFontSize+this.config.titlePadding*2,u={top:h?k:0},T=this.config.quadrantPadding+a.left,q=this.config.quadrantPadding+y.top+u.top,m=this.config.chartWidth-this.config.quadrantPadding*2-a.left-a.right,b=this.config.chartHeight-this.config.quadrantPadding*2-y.top-y.bottom-u.top,g=m/2,A=b/2;return{xAxisSpace:y,yAxisSpace:a,titleSpace:u,quadrantSpace:{quadrantLeft:T,quadrantTop:q,quadrantWidth:m,quadrantHalfWidth:g,quadrantHeight:b,quadrantHalfHeight:A}}}getAxisLabels(n,f,d,h){const{quadrantSpace:p,titleSpace:y}=h,{quadrantHalfHeight:_,quadrantHeight:a,quadrantLeft:k,quadrantHalfWidth:u,quadrantTop:T,quadrantWidth:q}=p,m=!!this.data.xAxisRightText,b=!!this.data.yAxisTopText,g=[];return this.data.xAxisLeftText&&f&&g.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:k+(m?u/2:0),y:n==="top"?this.config.xAxisLabelPadding+y.top:this.config.xAxisLabelPadding+T+a+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:m?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&f&&g.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:k+u+(m?u/2:0),y:n==="top"?this.config.xAxisLabelPadding+y.top:this.config.xAxisLabelPadding+T+a+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:m?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&d&&g.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+k+q+this.config.quadrantPadding,y:T+a-(b?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:b?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&d&&g.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+k+q+this.config.quadrantPadding,y:T+_-(b?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:b?"center":"left",horizontalPos:"top",rotation:-90}),g}getQuadrants(n){const{quadrantSpace:f}=n,{quadrantHalfHeight:d,quadrantLeft:h,quadrantHalfWidth:p,quadrantTop:y}=f,_=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h+p,y,width:p,height:d,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h,y,width:p,height:d,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h,y:y+d,width:p,height:d,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h+p,y:y+d,width:p,height:d,fill:this.themeConfig.quadrant4Fill}];for(const a of _)a.text.x=a.x+a.width/2,this.data.points.length===0?(a.text.y=a.y+a.height/2,a.text.horizontalPos="middle"):(a.text.y=a.y+this.config.quadrantTextTopPadding,a.text.horizontalPos="top");return _}getQuadrantPoints(n){const{quadrantSpace:f}=n,{quadrantHeight:d,quadrantLeft:h,quadrantTop:p,quadrantWidth:y}=f,_=ie().domain([0,1]).range([h,y+h]),a=ie().domain([0,1]).range([d+p,p]);return this.data.points.map(u=>{const T=this.classes.get(u.className);return T&&(u={...T,...u}),{x:_(u.x),y:a(u.y),fill:u.color??this.themeConfig.quadrantPointFill,radius:u.radius??this.config.pointRadius,text:{text:u.text,fill:this.themeConfig.quadrantPointTextFill,x:_(u.x),y:a(u.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:u.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:u.strokeWidth??"0px"}})}getBorders(n){const f=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:d}=n,{quadrantHalfHeight:h,quadrantHeight:p,quadrantLeft:y,quadrantHalfWidth:_,quadrantTop:a,quadrantWidth:k}=d;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y-f,y1:a,x2:y+k+f,y2:a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y+k,y1:a+f,x2:y+k,y2:a+p-f},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y-f,y1:a+p,x2:y+k+f,y2:a+p},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y,y1:a+f,x2:y,y2:a+p-f},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:y+_,y1:a+f,x2:y+_,y2:a+p-f},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:y+f,y1:a+h,x2:y+k-f,y2:a+h}]}getTitle(n){if(n)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const n=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),f=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),d=this.config.showTitle&&!!this.data.titleText,h=this.data.points.length>0?"bottom":this.config.xAxisPosition,p=this.calculateSpace(h,n,f,d);return{points:this.getQuadrantPoints(p),quadrants:this.getQuadrants(p),axisLabels:this.getAxisLabels(h,n,f,p),borderLines:this.getBorders(p),title:this.getTitle(d)}}},o(ot,"QuadrantBuilder"),ot),lt,mt=(lt=class extends Error{constructor(n,f,d){super(`value for ${n} ${f} is invalid, please use a valid ${d}`),this.name="InvalidStyleError"}},o(lt,"InvalidStyleError"),lt);function Dt(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}o(Dt,"validateHexCode");function ne(t){return!/^\d+$/.test(t)}o(ne,"validateNumber");function se(t){return!/^\d+px$/.test(t)}o(se,"validateSizeInPixels");var Ie=zt();function O(t){return Ee(t.trim(),Ie)}o(O,"textSanitizer");var V=new Ve;function re(t){V.setData({quadrant1Text:O(t.text)})}o(re,"setQuadrant1Text");function oe(t){V.setData({quadrant2Text:O(t.text)})}o(oe,"setQuadrant2Text");function le(t){V.setData({quadrant3Text:O(t.text)})}o(le,"setQuadrant3Text");function he(t){V.setData({quadrant4Text:O(t.text)})}o(he,"setQuadrant4Text");function ce(t){V.setData({xAxisLeftText:O(t.text)})}o(ce,"setXAxisLeftText");function de(t){V.setData({xAxisRightText:O(t.text)})}o(de,"setXAxisRightText");function ue(t){V.setData({yAxisTopText:O(t.text)})}o(ue,"setYAxisTopText");function xe(t){V.setData({yAxisBottomText:O(t.text)})}o(xe,"setYAxisBottomText");function St(t){const n={};for(const f of t){const[d,h]=f.trim().split(/\s*:\s*/);if(d==="radius"){if(ne(h))throw new mt(d,h,"number");n.radius=parseInt(h)}else if(d==="color"){if(Dt(h))throw new mt(d,h,"hex code");n.color=h}else if(d==="stroke-color"){if(Dt(h))throw new mt(d,h,"hex code");n.strokeColor=h}else if(d==="stroke-width"){if(se(h))throw new mt(d,h,"number of pixels (eg. 10px)");n.strokeWidth=h}else throw new Error(`style named ${d} is not supported.`)}return n}o(St,"parseStyles");function fe(t,n,f,d,h){const p=St(h);V.addPoints([{x:f,y:d,text:O(t.text),className:n,...p}])}o(fe,"addPoint");function ge(t,n){V.addClass(t,St(n))}o(ge,"addClass");function pe(t){V.setConfig({chartWidth:t})}o(pe,"setWidth");function ye(t){V.setConfig({chartHeight:t})}o(ye,"setHeight");function Te(){const t=zt(),{themeVariables:n,quadrantChart:f}=t;return f&&V.setConfig(f),V.setThemeConfig({quadrant1Fill:n.quadrant1Fill,quadrant2Fill:n.quadrant2Fill,quadrant3Fill:n.quadrant3Fill,quadrant4Fill:n.quadrant4Fill,quadrant1TextFill:n.quadrant1TextFill,quadrant2TextFill:n.quadrant2TextFill,quadrant3TextFill:n.quadrant3TextFill,quadrant4TextFill:n.quadrant4TextFill,quadrantPointFill:n.quadrantPointFill,quadrantPointTextFill:n.quadrantPointTextFill,quadrantXAxisTextFill:n.quadrantXAxisTextFill,quadrantYAxisTextFill:n.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:n.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:n.quadrantInternalBorderStrokeFill,quadrantTitleFill:n.quadrantTitleFill}),V.setData({titleText:ae()}),V.build()}o(Te,"getQuadrantData");var we=o(function(){V.clear(),Le()},"clear"),Be={setWidth:pe,setHeight:ye,setQuadrant1Text:re,setQuadrant2Text:oe,setQuadrant3Text:le,setQuadrant4Text:he,setXAxisLeftText:ce,setXAxisRightText:de,setYAxisTopText:ue,setYAxisBottomText:xe,parseStyles:St,addPoint:fe,addClass:ge,getQuadrantData:Te,clear:we,setAccTitle:ve,getAccTitle:Pe,setDiagramTitle:Fe,getDiagramTitle:ae,getAccDescription:ke,setAccDescription:Ae},Re=o((t,n,f,d)=>{function h(i){return i==="top"?"hanging":"middle"}o(h,"getDominantBaseLine");function p(i){return i==="left"?"start":"middle"}o(p,"getTextAnchor");function y(i){return`translate(${i.x}, ${i.y}) rotate(${i.rotation||0})`}o(y,"getTransformation");const _=zt();bt.debug(`Rendering quadrant chart
|
|
7
|
+
`+t);const a=_.securityLevel;let k;a==="sandbox"&&(k=Lt("#i"+n));const T=(a==="sandbox"?Lt(k.nodes()[0].contentDocument.body):Lt("body")).select(`[id="${n}"]`),q=T.append("g").attr("class","main"),m=_.quadrantChart?.chartWidth??500,b=_.quadrantChart?.chartHeight??500;Ce(T,b,m,_.quadrantChart?.useMaxWidth??!0),T.attr("viewBox","0 0 "+m+" "+b),d.db.setHeight(b),d.db.setWidth(m);const g=d.db.getQuadrantData(),A=q.append("g").attr("class","quadrants"),ht=q.append("g").attr("class","border"),xt=q.append("g").attr("class","data-points"),ft=q.append("g").attr("class","labels"),gt=q.append("g").attr("class","title");g.title&>.append("text").attr("x",0).attr("y",0).attr("fill",g.title.fill).attr("font-size",g.title.fontSize).attr("dominant-baseline",h(g.title.horizontalPos)).attr("text-anchor",p(g.title.verticalPos)).attr("transform",y(g.title)).text(g.title.text),g.borderLines&&ht.selectAll("line").data(g.borderLines).enter().append("line").attr("x1",i=>i.x1).attr("y1",i=>i.y1).attr("x2",i=>i.x2).attr("y2",i=>i.y2).style("stroke",i=>i.strokeFill).style("stroke-width",i=>i.strokeWidth);const ct=A.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class","quadrant");ct.append("rect").attr("x",i=>i.x).attr("y",i=>i.y).attr("width",i=>i.width).attr("height",i=>i.height).attr("fill",i=>i.fill),ct.append("text").attr("x",0).attr("y",0).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>y(i.text)).text(i=>i.text.text),ft.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(i=>i.text).attr("fill",i=>i.fill).attr("font-size",i=>i.fontSize).attr("dominant-baseline",i=>h(i.horizontalPos)).attr("text-anchor",i=>p(i.verticalPos)).attr("transform",i=>y(i));const dt=xt.selectAll("g.data-point").data(g.points).enter().append("g").attr("class","data-point");dt.append("circle").attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius).attr("fill",i=>i.fill).attr("stroke",i=>i.strokeColor).attr("stroke-width",i=>i.strokeWidth),dt.append("text").attr("x",0).attr("y",0).text(i=>i.text.text).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>y(i.text))},"draw"),Ne={draw:Re},He={parser:ze,db:Be,renderer:Ne,styles:o(()=>"","styles")};export{He as diagram};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{b1 as Ae,a2 as ke,a7 as ae,b4 as Fe,a3 as Pe,b2 as ve,b as o,a5 as zt,aF as bt,a$ as Lt,F as Ce,u as Le,T as z,a_ as Ee,ag as De}from"./index-CfZi-_-W.js";import{l as ie}from"./linear-Cl0xue9D.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-CrowFXzY.js";var Et=(function(){var t=o(function(Y,r,l,x){for(l=l||{},x=Y.length;x--;l[Y[x]]=r);return l},"o"),n=[1,3],f=[1,4],d=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],_=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],k=[2,36],u=[1,37],T=[1,36],q=[1,38],m=[1,35],b=[1,43],g=[1,41],A=[1,45],ht=[1,14],xt=[1,23],ft=[1,18],gt=[1,19],ct=[1,20],_t=[1,21],dt=[1,22],i=[1,24],Vt=[1,25],It=[1,26],wt=[1,27],Bt=[1,28],Rt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],At=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],kt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,x,c,S,e,ut){var s=e.length-1;switch(S){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],c.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),c.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),c.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),c.setAccDescription(this.$);break;case 46:c.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:c.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:c.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:c.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:c.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:c.setXAxisLeftText(e[s-2]),c.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",c.setXAxisLeftText(e[s-1]);break;case 53:c.setXAxisLeftText(e[s]);break;case 54:c.setYAxisBottomText(e[s-2]),c.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",c.setYAxisBottomText(e[s-1]);break;case 56:c.setYAxisBottomText(e[s]);break;case 57:c.setQuadrant1Text(e[s]);break;case 58:c.setQuadrant2Text(e[s]);break;case 59:c.setQuadrant3Text(e[s]);break;case 60:c.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:f,55:d,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:f,55:d,56:h,57:p},{18:n,26:9,27:2,28:f,55:d,56:h,57:p},t(y,[2,33],{29:10}),t(_,[2,61]),t(_,[2,62]),t(_,[2,63]),{1:[2,30]},{1:[2,31]},t(a,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:u,5:T,10:q,12:m,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:Vt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(y,[2,34]),{27:46,55:d,56:h,57:p},t(a,[2,37]),t(a,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:u,5:T,10:q,12:m,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:Vt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(a,[2,45]),t(a,[2,46]),{18:[1,51]},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:65,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,21:64},t(a,[2,53],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(a,[2,56],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(a,[2,57],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,58],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,59],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,60],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(a,[2,52],{58:31,43:84,4:u,5:T,10:q,12:m,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,55],{58:31,43:85,4:u,5:T,10:q,12:m,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:89,23:88},t(w,[2,24]),t(a,[2,51],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,54],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,47],{22:89,16:90,23:101,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{46:[1,102]},t(a,[2,29],{10:At}),t(Zt,[2,27],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(a,[2,49],{10:At}),t(a,[2,48],{22:89,16:90,23:105,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:106},t(N,[2,26]),t(a,[2,50],{10:At}),t(Zt,[2,28],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var x=new Error(r);throw x.hash=l,x}},"parseError"),parse:o(function(r){var l=this,x=[0],c=[],S=[null],e=[],ut=this.table,s="",yt=0,Jt=0,me=2,$t=1,be=e.slice.call(arguments,1),D=Object.create(this.lexer),j={yy:{}};for(var Ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ft)&&(j.yy[Ft]=this.yy[Ft]);D.setInput(r,j.yy),j.yy.lexer=D,j.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Pt=D.yylloc;e.push(Pt);var Se=D.options&&D.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(R){x.length=x.length-2*R,S.length=S.length-R,e.length=e.length-R}o(_e,"popStack");function te(){var R;return R=c.pop()||D.lex()||$t,typeof R!="number"&&(R instanceof Array&&(c=R,R=c.pop()),R=l.symbols_[R]||R),R}o(te,"lex");for(var B,G,W,vt,rt={},Tt,M,ee,qt;;){if(G=x[x.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=te()),W=ut[G]&&ut[G][B]),typeof W>"u"||!W.length||!W[0]){var Ct="";qt=[];for(Tt in ut[G])this.terminals_[Tt]&&Tt>me&&qt.push("'"+this.terminals_[Tt]+"'");D.showPosition?Ct="Parse error on line "+(yt+1)+`:
|
|
2
|
+
`+D.showPosition()+`
|
|
3
|
+
Expecting `+qt.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Ct="Parse error on line "+(yt+1)+": Unexpected "+(B==$t?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Ct,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Pt,expected:qt})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+B);switch(W[0]){case 1:x.push(B),S.push(D.yytext),e.push(D.yylloc),x.push(W[1]),B=null,Jt=D.yyleng,s=D.yytext,yt=D.yylineno,Pt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],rt.$=S[S.length-M],rt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},Se&&(rt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),vt=this.performAction.apply(rt,[s,Jt,yt,j.yy,W[1],S,e].concat(be)),typeof vt<"u")return vt;M&&(x=x.slice(0,-1*M*2),S=S.slice(0,-1*M),e=e.slice(0,-1*M)),x.push(this.productions_[W[1]][0]),S.push(rt.$),e.push(rt._$),ee=ut[x[x.length-2]][x[x.length-1]],x.push(ee);break;case 3:return!0}}return!0},"parse")},qe=(function(){var Y={EOF:1,parseError:o(function(l,x){if(this.yy.parser)this.yy.parser.parseError(l,x);else throw new Error(l)},"parseError"),setInput:o(function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:o(function(r){var l=r.length,x=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===c.length?this.yylloc.first_column:0)+c[c.length-x.length].length-x[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(r){this.unput(this.match.slice(r))},"less"),pastInput:o(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
5
|
+
`+l+"^"},"showPosition"),test_match:o(function(r,l){var x,c,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),c=r[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],x=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var e in S)this[e]=S[e];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,l,x,c;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),e=0;e<S.length;e++)if(x=this._input.match(this.rules[S[e]]),x&&(!l||x[0].length>l[0].length)){if(l=x,c=e,this.options.backtrack_lexer){if(r=this.test_match(x,S[e]),r!==!1)return r;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(r=this.test_match(l,S[c]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var l=this.next();return l||this.lex()},"lex"),begin:o(function(l){this.conditionStack.push(l)},"begin"),popState:o(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:o(function(l){this.begin(l)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(l,x,c,S){switch(c){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return Y})();kt.lexer=qe;function pt(){this.yy={}}return o(pt,"Parser"),pt.prototype=kt,kt.Parser=pt,new pt})();Et.parser=Et;var ze=Et,I=De(),ot,Ve=(ot=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:z.quadrantChart?.chartWidth||500,chartWidth:z.quadrantChart?.chartHeight||500,titlePadding:z.quadrantChart?.titlePadding||10,titleFontSize:z.quadrantChart?.titleFontSize||20,quadrantPadding:z.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:z.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:z.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:z.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:z.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:z.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:z.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:z.quadrantChart?.pointTextPadding||5,pointLabelFontSize:z.quadrantChart?.pointLabelFontSize||12,pointRadius:z.quadrantChart?.pointRadius||5,xAxisPosition:z.quadrantChart?.xAxisPosition||"top",yAxisPosition:z.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:z.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:z.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:I.quadrant1Fill,quadrant2Fill:I.quadrant2Fill,quadrant3Fill:I.quadrant3Fill,quadrant4Fill:I.quadrant4Fill,quadrant1TextFill:I.quadrant1TextFill,quadrant2TextFill:I.quadrant2TextFill,quadrant3TextFill:I.quadrant3TextFill,quadrant4TextFill:I.quadrant4TextFill,quadrantPointFill:I.quadrantPointFill,quadrantPointTextFill:I.quadrantPointTextFill,quadrantXAxisTextFill:I.quadrantXAxisTextFill,quadrantYAxisTextFill:I.quadrantYAxisTextFill,quadrantTitleFill:I.quadrantTitleFill,quadrantInternalBorderStrokeFill:I.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:I.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,bt.info("clear called")}setData(n){this.data={...this.data,...n}}addPoints(n){this.data.points=[...n,...this.data.points]}addClass(n,f){this.classes.set(n,f)}setConfig(n){bt.trace("setConfig called with: ",n),this.config={...this.config,...n}}setThemeConfig(n){bt.trace("setThemeConfig called with: ",n),this.themeConfig={...this.themeConfig,...n}}calculateSpace(n,f,d,h){const p=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,y={top:n==="top"&&f?p:0,bottom:n==="bottom"&&f?p:0},_=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,a={left:this.config.yAxisPosition==="left"&&d?_:0,right:this.config.yAxisPosition==="right"&&d?_:0},k=this.config.titleFontSize+this.config.titlePadding*2,u={top:h?k:0},T=this.config.quadrantPadding+a.left,q=this.config.quadrantPadding+y.top+u.top,m=this.config.chartWidth-this.config.quadrantPadding*2-a.left-a.right,b=this.config.chartHeight-this.config.quadrantPadding*2-y.top-y.bottom-u.top,g=m/2,A=b/2;return{xAxisSpace:y,yAxisSpace:a,titleSpace:u,quadrantSpace:{quadrantLeft:T,quadrantTop:q,quadrantWidth:m,quadrantHalfWidth:g,quadrantHeight:b,quadrantHalfHeight:A}}}getAxisLabels(n,f,d,h){const{quadrantSpace:p,titleSpace:y}=h,{quadrantHalfHeight:_,quadrantHeight:a,quadrantLeft:k,quadrantHalfWidth:u,quadrantTop:T,quadrantWidth:q}=p,m=!!this.data.xAxisRightText,b=!!this.data.yAxisTopText,g=[];return this.data.xAxisLeftText&&f&&g.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:k+(m?u/2:0),y:n==="top"?this.config.xAxisLabelPadding+y.top:this.config.xAxisLabelPadding+T+a+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:m?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&f&&g.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:k+u+(m?u/2:0),y:n==="top"?this.config.xAxisLabelPadding+y.top:this.config.xAxisLabelPadding+T+a+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:m?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&d&&g.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+k+q+this.config.quadrantPadding,y:T+a-(b?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:b?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&d&&g.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+k+q+this.config.quadrantPadding,y:T+_-(b?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:b?"center":"left",horizontalPos:"top",rotation:-90}),g}getQuadrants(n){const{quadrantSpace:f}=n,{quadrantHalfHeight:d,quadrantLeft:h,quadrantHalfWidth:p,quadrantTop:y}=f,_=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h+p,y,width:p,height:d,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h,y,width:p,height:d,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h,y:y+d,width:p,height:d,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h+p,y:y+d,width:p,height:d,fill:this.themeConfig.quadrant4Fill}];for(const a of _)a.text.x=a.x+a.width/2,this.data.points.length===0?(a.text.y=a.y+a.height/2,a.text.horizontalPos="middle"):(a.text.y=a.y+this.config.quadrantTextTopPadding,a.text.horizontalPos="top");return _}getQuadrantPoints(n){const{quadrantSpace:f}=n,{quadrantHeight:d,quadrantLeft:h,quadrantTop:p,quadrantWidth:y}=f,_=ie().domain([0,1]).range([h,y+h]),a=ie().domain([0,1]).range([d+p,p]);return this.data.points.map(u=>{const T=this.classes.get(u.className);return T&&(u={...T,...u}),{x:_(u.x),y:a(u.y),fill:u.color??this.themeConfig.quadrantPointFill,radius:u.radius??this.config.pointRadius,text:{text:u.text,fill:this.themeConfig.quadrantPointTextFill,x:_(u.x),y:a(u.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:u.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:u.strokeWidth??"0px"}})}getBorders(n){const f=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:d}=n,{quadrantHalfHeight:h,quadrantHeight:p,quadrantLeft:y,quadrantHalfWidth:_,quadrantTop:a,quadrantWidth:k}=d;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y-f,y1:a,x2:y+k+f,y2:a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y+k,y1:a+f,x2:y+k,y2:a+p-f},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y-f,y1:a+p,x2:y+k+f,y2:a+p},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y,y1:a+f,x2:y,y2:a+p-f},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:y+_,y1:a+f,x2:y+_,y2:a+p-f},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:y+f,y1:a+h,x2:y+k-f,y2:a+h}]}getTitle(n){if(n)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const n=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),f=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),d=this.config.showTitle&&!!this.data.titleText,h=this.data.points.length>0?"bottom":this.config.xAxisPosition,p=this.calculateSpace(h,n,f,d);return{points:this.getQuadrantPoints(p),quadrants:this.getQuadrants(p),axisLabels:this.getAxisLabels(h,n,f,p),borderLines:this.getBorders(p),title:this.getTitle(d)}}},o(ot,"QuadrantBuilder"),ot),lt,mt=(lt=class extends Error{constructor(n,f,d){super(`value for ${n} ${f} is invalid, please use a valid ${d}`),this.name="InvalidStyleError"}},o(lt,"InvalidStyleError"),lt);function Dt(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}o(Dt,"validateHexCode");function ne(t){return!/^\d+$/.test(t)}o(ne,"validateNumber");function se(t){return!/^\d+px$/.test(t)}o(se,"validateSizeInPixels");var Ie=zt();function O(t){return Ee(t.trim(),Ie)}o(O,"textSanitizer");var V=new Ve;function re(t){V.setData({quadrant1Text:O(t.text)})}o(re,"setQuadrant1Text");function oe(t){V.setData({quadrant2Text:O(t.text)})}o(oe,"setQuadrant2Text");function le(t){V.setData({quadrant3Text:O(t.text)})}o(le,"setQuadrant3Text");function he(t){V.setData({quadrant4Text:O(t.text)})}o(he,"setQuadrant4Text");function ce(t){V.setData({xAxisLeftText:O(t.text)})}o(ce,"setXAxisLeftText");function de(t){V.setData({xAxisRightText:O(t.text)})}o(de,"setXAxisRightText");function ue(t){V.setData({yAxisTopText:O(t.text)})}o(ue,"setYAxisTopText");function xe(t){V.setData({yAxisBottomText:O(t.text)})}o(xe,"setYAxisBottomText");function St(t){const n={};for(const f of t){const[d,h]=f.trim().split(/\s*:\s*/);if(d==="radius"){if(ne(h))throw new mt(d,h,"number");n.radius=parseInt(h)}else if(d==="color"){if(Dt(h))throw new mt(d,h,"hex code");n.color=h}else if(d==="stroke-color"){if(Dt(h))throw new mt(d,h,"hex code");n.strokeColor=h}else if(d==="stroke-width"){if(se(h))throw new mt(d,h,"number of pixels (eg. 10px)");n.strokeWidth=h}else throw new Error(`style named ${d} is not supported.`)}return n}o(St,"parseStyles");function fe(t,n,f,d,h){const p=St(h);V.addPoints([{x:f,y:d,text:O(t.text),className:n,...p}])}o(fe,"addPoint");function ge(t,n){V.addClass(t,St(n))}o(ge,"addClass");function pe(t){V.setConfig({chartWidth:t})}o(pe,"setWidth");function ye(t){V.setConfig({chartHeight:t})}o(ye,"setHeight");function Te(){const t=zt(),{themeVariables:n,quadrantChart:f}=t;return f&&V.setConfig(f),V.setThemeConfig({quadrant1Fill:n.quadrant1Fill,quadrant2Fill:n.quadrant2Fill,quadrant3Fill:n.quadrant3Fill,quadrant4Fill:n.quadrant4Fill,quadrant1TextFill:n.quadrant1TextFill,quadrant2TextFill:n.quadrant2TextFill,quadrant3TextFill:n.quadrant3TextFill,quadrant4TextFill:n.quadrant4TextFill,quadrantPointFill:n.quadrantPointFill,quadrantPointTextFill:n.quadrantPointTextFill,quadrantXAxisTextFill:n.quadrantXAxisTextFill,quadrantYAxisTextFill:n.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:n.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:n.quadrantInternalBorderStrokeFill,quadrantTitleFill:n.quadrantTitleFill}),V.setData({titleText:ae()}),V.build()}o(Te,"getQuadrantData");var we=o(function(){V.clear(),Le()},"clear"),Be={setWidth:pe,setHeight:ye,setQuadrant1Text:re,setQuadrant2Text:oe,setQuadrant3Text:le,setQuadrant4Text:he,setXAxisLeftText:ce,setXAxisRightText:de,setYAxisTopText:ue,setYAxisBottomText:xe,parseStyles:St,addPoint:fe,addClass:ge,getQuadrantData:Te,clear:we,setAccTitle:ve,getAccTitle:Pe,setDiagramTitle:Fe,getDiagramTitle:ae,getAccDescription:ke,setAccDescription:Ae},Re=o((t,n,f,d)=>{function h(i){return i==="top"?"hanging":"middle"}o(h,"getDominantBaseLine");function p(i){return i==="left"?"start":"middle"}o(p,"getTextAnchor");function y(i){return`translate(${i.x}, ${i.y}) rotate(${i.rotation||0})`}o(y,"getTransformation");const _=zt();bt.debug(`Rendering quadrant chart
|
|
7
|
+
`+t);const a=_.securityLevel;let k;a==="sandbox"&&(k=Lt("#i"+n));const T=(a==="sandbox"?Lt(k.nodes()[0].contentDocument.body):Lt("body")).select(`[id="${n}"]`),q=T.append("g").attr("class","main"),m=_.quadrantChart?.chartWidth??500,b=_.quadrantChart?.chartHeight??500;Ce(T,b,m,_.quadrantChart?.useMaxWidth??!0),T.attr("viewBox","0 0 "+m+" "+b),d.db.setHeight(b),d.db.setWidth(m);const g=d.db.getQuadrantData(),A=q.append("g").attr("class","quadrants"),ht=q.append("g").attr("class","border"),xt=q.append("g").attr("class","data-points"),ft=q.append("g").attr("class","labels"),gt=q.append("g").attr("class","title");g.title&>.append("text").attr("x",0).attr("y",0).attr("fill",g.title.fill).attr("font-size",g.title.fontSize).attr("dominant-baseline",h(g.title.horizontalPos)).attr("text-anchor",p(g.title.verticalPos)).attr("transform",y(g.title)).text(g.title.text),g.borderLines&&ht.selectAll("line").data(g.borderLines).enter().append("line").attr("x1",i=>i.x1).attr("y1",i=>i.y1).attr("x2",i=>i.x2).attr("y2",i=>i.y2).style("stroke",i=>i.strokeFill).style("stroke-width",i=>i.strokeWidth);const ct=A.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class","quadrant");ct.append("rect").attr("x",i=>i.x).attr("y",i=>i.y).attr("width",i=>i.width).attr("height",i=>i.height).attr("fill",i=>i.fill),ct.append("text").attr("x",0).attr("y",0).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>y(i.text)).text(i=>i.text.text),ft.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(i=>i.text).attr("fill",i=>i.fill).attr("font-size",i=>i.fontSize).attr("dominant-baseline",i=>h(i.horizontalPos)).attr("text-anchor",i=>p(i.verticalPos)).attr("transform",i=>y(i));const dt=xt.selectAll("g.data-point").data(g.points).enter().append("g").attr("class","data-point");dt.append("circle").attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius).attr("fill",i=>i.fill).attr("stroke",i=>i.strokeColor).attr("stroke-width",i=>i.strokeWidth),dt.append("text").attr("x",0).attr("y",0).text(i=>i.text.text).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>y(i.text))},"draw"),Ne={draw:Re},He={parser:ze,db:Be,renderer:Ne,styles:o(()=>"","styles")};export{He as diagram};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{b1 as Ae,a2 as ke,a7 as ae,b4 as Fe,a3 as Pe,b2 as ve,b as o,a5 as zt,aF as bt,a$ as Lt,F as Ce,u as Le,T as z,a_ as Ee,ag as De}from"./index-CUO5Op8Z.js";import{l as ie}from"./linear-DA-PRFNX.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-CrowFXzY.js";var Et=(function(){var t=o(function(Y,r,l,x){for(l=l||{},x=Y.length;x--;l[Y[x]]=r);return l},"o"),n=[1,3],f=[1,4],d=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],_=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],k=[2,36],u=[1,37],T=[1,36],q=[1,38],m=[1,35],b=[1,43],g=[1,41],A=[1,45],ht=[1,14],xt=[1,23],ft=[1,18],gt=[1,19],ct=[1,20],_t=[1,21],dt=[1,22],i=[1,24],Vt=[1,25],It=[1,26],wt=[1,27],Bt=[1,28],Rt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],At=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],kt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,x,c,S,e,ut){var s=e.length-1;switch(S){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],c.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),c.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),c.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),c.setAccDescription(this.$);break;case 46:c.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:c.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:c.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:c.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:c.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:c.setXAxisLeftText(e[s-2]),c.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",c.setXAxisLeftText(e[s-1]);break;case 53:c.setXAxisLeftText(e[s]);break;case 54:c.setYAxisBottomText(e[s-2]),c.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",c.setYAxisBottomText(e[s-1]);break;case 56:c.setYAxisBottomText(e[s]);break;case 57:c.setQuadrant1Text(e[s]);break;case 58:c.setQuadrant2Text(e[s]);break;case 59:c.setQuadrant3Text(e[s]);break;case 60:c.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:f,55:d,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:f,55:d,56:h,57:p},{18:n,26:9,27:2,28:f,55:d,56:h,57:p},t(y,[2,33],{29:10}),t(_,[2,61]),t(_,[2,62]),t(_,[2,63]),{1:[2,30]},{1:[2,31]},t(a,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:u,5:T,10:q,12:m,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:Vt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(y,[2,34]),{27:46,55:d,56:h,57:p},t(a,[2,37]),t(a,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:u,5:T,10:q,12:m,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:Vt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(a,[2,45]),t(a,[2,46]),{18:[1,51]},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:65,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,21:64},t(a,[2,53],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(a,[2,56],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(a,[2,57],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,58],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,59],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,60],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(a,[2,52],{58:31,43:84,4:u,5:T,10:q,12:m,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,55],{58:31,43:85,4:u,5:T,10:q,12:m,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:89,23:88},t(w,[2,24]),t(a,[2,51],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,54],{59:60,58:61,4:u,5:T,8:H,10:q,12:m,13:b,14:g,15:A,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,47],{22:89,16:90,23:101,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{46:[1,102]},t(a,[2,29],{10:At}),t(Zt,[2,27],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(a,[2,49],{10:At}),t(a,[2,48],{22:89,16:90,23:105,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:106},t(N,[2,26]),t(a,[2,50],{10:At}),t(Zt,[2,28],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var x=new Error(r);throw x.hash=l,x}},"parseError"),parse:o(function(r){var l=this,x=[0],c=[],S=[null],e=[],ut=this.table,s="",yt=0,Jt=0,me=2,$t=1,be=e.slice.call(arguments,1),D=Object.create(this.lexer),j={yy:{}};for(var Ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ft)&&(j.yy[Ft]=this.yy[Ft]);D.setInput(r,j.yy),j.yy.lexer=D,j.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Pt=D.yylloc;e.push(Pt);var Se=D.options&&D.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(R){x.length=x.length-2*R,S.length=S.length-R,e.length=e.length-R}o(_e,"popStack");function te(){var R;return R=c.pop()||D.lex()||$t,typeof R!="number"&&(R instanceof Array&&(c=R,R=c.pop()),R=l.symbols_[R]||R),R}o(te,"lex");for(var B,G,W,vt,rt={},Tt,M,ee,qt;;){if(G=x[x.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=te()),W=ut[G]&&ut[G][B]),typeof W>"u"||!W.length||!W[0]){var Ct="";qt=[];for(Tt in ut[G])this.terminals_[Tt]&&Tt>me&&qt.push("'"+this.terminals_[Tt]+"'");D.showPosition?Ct="Parse error on line "+(yt+1)+`:
|
|
2
|
+
`+D.showPosition()+`
|
|
3
|
+
Expecting `+qt.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Ct="Parse error on line "+(yt+1)+": Unexpected "+(B==$t?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Ct,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Pt,expected:qt})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+B);switch(W[0]){case 1:x.push(B),S.push(D.yytext),e.push(D.yylloc),x.push(W[1]),B=null,Jt=D.yyleng,s=D.yytext,yt=D.yylineno,Pt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],rt.$=S[S.length-M],rt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},Se&&(rt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),vt=this.performAction.apply(rt,[s,Jt,yt,j.yy,W[1],S,e].concat(be)),typeof vt<"u")return vt;M&&(x=x.slice(0,-1*M*2),S=S.slice(0,-1*M),e=e.slice(0,-1*M)),x.push(this.productions_[W[1]][0]),S.push(rt.$),e.push(rt._$),ee=ut[x[x.length-2]][x[x.length-1]],x.push(ee);break;case 3:return!0}}return!0},"parse")},qe=(function(){var Y={EOF:1,parseError:o(function(l,x){if(this.yy.parser)this.yy.parser.parseError(l,x);else throw new Error(l)},"parseError"),setInput:o(function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:o(function(r){var l=r.length,x=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===c.length?this.yylloc.first_column:0)+c[c.length-x.length].length-x[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(r){this.unput(this.match.slice(r))},"less"),pastInput:o(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
5
|
+
`+l+"^"},"showPosition"),test_match:o(function(r,l){var x,c,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),c=r[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],x=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var e in S)this[e]=S[e];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,l,x,c;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),e=0;e<S.length;e++)if(x=this._input.match(this.rules[S[e]]),x&&(!l||x[0].length>l[0].length)){if(l=x,c=e,this.options.backtrack_lexer){if(r=this.test_match(x,S[e]),r!==!1)return r;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(r=this.test_match(l,S[c]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var l=this.next();return l||this.lex()},"lex"),begin:o(function(l){this.conditionStack.push(l)},"begin"),popState:o(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:o(function(l){this.begin(l)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(l,x,c,S){switch(c){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 15;case 37:return 11;case 38:return 64;case 39:return 10;case 40:return 65;case 41:return 65;case 42:return 14;case 43:return 13;case 44:return 67;case 45:return 66;case 46:return 12;case 47:return 8;case 48:return 5;case 49:return 18;case 50:return 56;case 51:return 63;case 52:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}};return Y})();kt.lexer=qe;function pt(){this.yy={}}return o(pt,"Parser"),pt.prototype=kt,kt.Parser=pt,new pt})();Et.parser=Et;var ze=Et,I=De(),ot,Ve=(ot=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:z.quadrantChart?.chartWidth||500,chartWidth:z.quadrantChart?.chartHeight||500,titlePadding:z.quadrantChart?.titlePadding||10,titleFontSize:z.quadrantChart?.titleFontSize||20,quadrantPadding:z.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:z.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:z.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:z.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:z.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:z.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:z.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:z.quadrantChart?.pointTextPadding||5,pointLabelFontSize:z.quadrantChart?.pointLabelFontSize||12,pointRadius:z.quadrantChart?.pointRadius||5,xAxisPosition:z.quadrantChart?.xAxisPosition||"top",yAxisPosition:z.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:z.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:z.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:I.quadrant1Fill,quadrant2Fill:I.quadrant2Fill,quadrant3Fill:I.quadrant3Fill,quadrant4Fill:I.quadrant4Fill,quadrant1TextFill:I.quadrant1TextFill,quadrant2TextFill:I.quadrant2TextFill,quadrant3TextFill:I.quadrant3TextFill,quadrant4TextFill:I.quadrant4TextFill,quadrantPointFill:I.quadrantPointFill,quadrantPointTextFill:I.quadrantPointTextFill,quadrantXAxisTextFill:I.quadrantXAxisTextFill,quadrantYAxisTextFill:I.quadrantYAxisTextFill,quadrantTitleFill:I.quadrantTitleFill,quadrantInternalBorderStrokeFill:I.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:I.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,bt.info("clear called")}setData(n){this.data={...this.data,...n}}addPoints(n){this.data.points=[...n,...this.data.points]}addClass(n,f){this.classes.set(n,f)}setConfig(n){bt.trace("setConfig called with: ",n),this.config={...this.config,...n}}setThemeConfig(n){bt.trace("setThemeConfig called with: ",n),this.themeConfig={...this.themeConfig,...n}}calculateSpace(n,f,d,h){const p=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,y={top:n==="top"&&f?p:0,bottom:n==="bottom"&&f?p:0},_=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,a={left:this.config.yAxisPosition==="left"&&d?_:0,right:this.config.yAxisPosition==="right"&&d?_:0},k=this.config.titleFontSize+this.config.titlePadding*2,u={top:h?k:0},T=this.config.quadrantPadding+a.left,q=this.config.quadrantPadding+y.top+u.top,m=this.config.chartWidth-this.config.quadrantPadding*2-a.left-a.right,b=this.config.chartHeight-this.config.quadrantPadding*2-y.top-y.bottom-u.top,g=m/2,A=b/2;return{xAxisSpace:y,yAxisSpace:a,titleSpace:u,quadrantSpace:{quadrantLeft:T,quadrantTop:q,quadrantWidth:m,quadrantHalfWidth:g,quadrantHeight:b,quadrantHalfHeight:A}}}getAxisLabels(n,f,d,h){const{quadrantSpace:p,titleSpace:y}=h,{quadrantHalfHeight:_,quadrantHeight:a,quadrantLeft:k,quadrantHalfWidth:u,quadrantTop:T,quadrantWidth:q}=p,m=!!this.data.xAxisRightText,b=!!this.data.yAxisTopText,g=[];return this.data.xAxisLeftText&&f&&g.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:k+(m?u/2:0),y:n==="top"?this.config.xAxisLabelPadding+y.top:this.config.xAxisLabelPadding+T+a+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:m?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&f&&g.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:k+u+(m?u/2:0),y:n==="top"?this.config.xAxisLabelPadding+y.top:this.config.xAxisLabelPadding+T+a+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:m?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&d&&g.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+k+q+this.config.quadrantPadding,y:T+a-(b?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:b?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&d&&g.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+k+q+this.config.quadrantPadding,y:T+_-(b?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:b?"center":"left",horizontalPos:"top",rotation:-90}),g}getQuadrants(n){const{quadrantSpace:f}=n,{quadrantHalfHeight:d,quadrantLeft:h,quadrantHalfWidth:p,quadrantTop:y}=f,_=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h+p,y,width:p,height:d,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h,y,width:p,height:d,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h,y:y+d,width:p,height:d,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h+p,y:y+d,width:p,height:d,fill:this.themeConfig.quadrant4Fill}];for(const a of _)a.text.x=a.x+a.width/2,this.data.points.length===0?(a.text.y=a.y+a.height/2,a.text.horizontalPos="middle"):(a.text.y=a.y+this.config.quadrantTextTopPadding,a.text.horizontalPos="top");return _}getQuadrantPoints(n){const{quadrantSpace:f}=n,{quadrantHeight:d,quadrantLeft:h,quadrantTop:p,quadrantWidth:y}=f,_=ie().domain([0,1]).range([h,y+h]),a=ie().domain([0,1]).range([d+p,p]);return this.data.points.map(u=>{const T=this.classes.get(u.className);return T&&(u={...T,...u}),{x:_(u.x),y:a(u.y),fill:u.color??this.themeConfig.quadrantPointFill,radius:u.radius??this.config.pointRadius,text:{text:u.text,fill:this.themeConfig.quadrantPointTextFill,x:_(u.x),y:a(u.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:u.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:u.strokeWidth??"0px"}})}getBorders(n){const f=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:d}=n,{quadrantHalfHeight:h,quadrantHeight:p,quadrantLeft:y,quadrantHalfWidth:_,quadrantTop:a,quadrantWidth:k}=d;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y-f,y1:a,x2:y+k+f,y2:a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y+k,y1:a+f,x2:y+k,y2:a+p-f},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y-f,y1:a+p,x2:y+k+f,y2:a+p},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y,y1:a+f,x2:y,y2:a+p-f},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:y+_,y1:a+f,x2:y+_,y2:a+p-f},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:y+f,y1:a+h,x2:y+k-f,y2:a+h}]}getTitle(n){if(n)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const n=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),f=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),d=this.config.showTitle&&!!this.data.titleText,h=this.data.points.length>0?"bottom":this.config.xAxisPosition,p=this.calculateSpace(h,n,f,d);return{points:this.getQuadrantPoints(p),quadrants:this.getQuadrants(p),axisLabels:this.getAxisLabels(h,n,f,p),borderLines:this.getBorders(p),title:this.getTitle(d)}}},o(ot,"QuadrantBuilder"),ot),lt,mt=(lt=class extends Error{constructor(n,f,d){super(`value for ${n} ${f} is invalid, please use a valid ${d}`),this.name="InvalidStyleError"}},o(lt,"InvalidStyleError"),lt);function Dt(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}o(Dt,"validateHexCode");function ne(t){return!/^\d+$/.test(t)}o(ne,"validateNumber");function se(t){return!/^\d+px$/.test(t)}o(se,"validateSizeInPixels");var Ie=zt();function O(t){return Ee(t.trim(),Ie)}o(O,"textSanitizer");var V=new Ve;function re(t){V.setData({quadrant1Text:O(t.text)})}o(re,"setQuadrant1Text");function oe(t){V.setData({quadrant2Text:O(t.text)})}o(oe,"setQuadrant2Text");function le(t){V.setData({quadrant3Text:O(t.text)})}o(le,"setQuadrant3Text");function he(t){V.setData({quadrant4Text:O(t.text)})}o(he,"setQuadrant4Text");function ce(t){V.setData({xAxisLeftText:O(t.text)})}o(ce,"setXAxisLeftText");function de(t){V.setData({xAxisRightText:O(t.text)})}o(de,"setXAxisRightText");function ue(t){V.setData({yAxisTopText:O(t.text)})}o(ue,"setYAxisTopText");function xe(t){V.setData({yAxisBottomText:O(t.text)})}o(xe,"setYAxisBottomText");function St(t){const n={};for(const f of t){const[d,h]=f.trim().split(/\s*:\s*/);if(d==="radius"){if(ne(h))throw new mt(d,h,"number");n.radius=parseInt(h)}else if(d==="color"){if(Dt(h))throw new mt(d,h,"hex code");n.color=h}else if(d==="stroke-color"){if(Dt(h))throw new mt(d,h,"hex code");n.strokeColor=h}else if(d==="stroke-width"){if(se(h))throw new mt(d,h,"number of pixels (eg. 10px)");n.strokeWidth=h}else throw new Error(`style named ${d} is not supported.`)}return n}o(St,"parseStyles");function fe(t,n,f,d,h){const p=St(h);V.addPoints([{x:f,y:d,text:O(t.text),className:n,...p}])}o(fe,"addPoint");function ge(t,n){V.addClass(t,St(n))}o(ge,"addClass");function pe(t){V.setConfig({chartWidth:t})}o(pe,"setWidth");function ye(t){V.setConfig({chartHeight:t})}o(ye,"setHeight");function Te(){const t=zt(),{themeVariables:n,quadrantChart:f}=t;return f&&V.setConfig(f),V.setThemeConfig({quadrant1Fill:n.quadrant1Fill,quadrant2Fill:n.quadrant2Fill,quadrant3Fill:n.quadrant3Fill,quadrant4Fill:n.quadrant4Fill,quadrant1TextFill:n.quadrant1TextFill,quadrant2TextFill:n.quadrant2TextFill,quadrant3TextFill:n.quadrant3TextFill,quadrant4TextFill:n.quadrant4TextFill,quadrantPointFill:n.quadrantPointFill,quadrantPointTextFill:n.quadrantPointTextFill,quadrantXAxisTextFill:n.quadrantXAxisTextFill,quadrantYAxisTextFill:n.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:n.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:n.quadrantInternalBorderStrokeFill,quadrantTitleFill:n.quadrantTitleFill}),V.setData({titleText:ae()}),V.build()}o(Te,"getQuadrantData");var we=o(function(){V.clear(),Le()},"clear"),Be={setWidth:pe,setHeight:ye,setQuadrant1Text:re,setQuadrant2Text:oe,setQuadrant3Text:le,setQuadrant4Text:he,setXAxisLeftText:ce,setXAxisRightText:de,setYAxisTopText:ue,setYAxisBottomText:xe,parseStyles:St,addPoint:fe,addClass:ge,getQuadrantData:Te,clear:we,setAccTitle:ve,getAccTitle:Pe,setDiagramTitle:Fe,getDiagramTitle:ae,getAccDescription:ke,setAccDescription:Ae},Re=o((t,n,f,d)=>{function h(i){return i==="top"?"hanging":"middle"}o(h,"getDominantBaseLine");function p(i){return i==="left"?"start":"middle"}o(p,"getTextAnchor");function y(i){return`translate(${i.x}, ${i.y}) rotate(${i.rotation||0})`}o(y,"getTransformation");const _=zt();bt.debug(`Rendering quadrant chart
|
|
7
|
+
`+t);const a=_.securityLevel;let k;a==="sandbox"&&(k=Lt("#i"+n));const T=(a==="sandbox"?Lt(k.nodes()[0].contentDocument.body):Lt("body")).select(`[id="${n}"]`),q=T.append("g").attr("class","main"),m=_.quadrantChart?.chartWidth??500,b=_.quadrantChart?.chartHeight??500;Ce(T,b,m,_.quadrantChart?.useMaxWidth??!0),T.attr("viewBox","0 0 "+m+" "+b),d.db.setHeight(b),d.db.setWidth(m);const g=d.db.getQuadrantData(),A=q.append("g").attr("class","quadrants"),ht=q.append("g").attr("class","border"),xt=q.append("g").attr("class","data-points"),ft=q.append("g").attr("class","labels"),gt=q.append("g").attr("class","title");g.title&>.append("text").attr("x",0).attr("y",0).attr("fill",g.title.fill).attr("font-size",g.title.fontSize).attr("dominant-baseline",h(g.title.horizontalPos)).attr("text-anchor",p(g.title.verticalPos)).attr("transform",y(g.title)).text(g.title.text),g.borderLines&&ht.selectAll("line").data(g.borderLines).enter().append("line").attr("x1",i=>i.x1).attr("y1",i=>i.y1).attr("x2",i=>i.x2).attr("y2",i=>i.y2).style("stroke",i=>i.strokeFill).style("stroke-width",i=>i.strokeWidth);const ct=A.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class","quadrant");ct.append("rect").attr("x",i=>i.x).attr("y",i=>i.y).attr("width",i=>i.width).attr("height",i=>i.height).attr("fill",i=>i.fill),ct.append("text").attr("x",0).attr("y",0).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>y(i.text)).text(i=>i.text.text),ft.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(i=>i.text).attr("fill",i=>i.fill).attr("font-size",i=>i.fontSize).attr("dominant-baseline",i=>h(i.horizontalPos)).attr("text-anchor",i=>p(i.verticalPos)).attr("transform",i=>y(i));const dt=xt.selectAll("g.data-point").data(g.points).enter().append("g").attr("class","data-point");dt.append("circle").attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius).attr("fill",i=>i.fill).attr("stroke",i=>i.strokeColor).attr("stroke-width",i=>i.strokeWidth),dt.append("text").attr("x",0).attr("y",0).text(i=>i.text.text).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>y(i.text))},"draw"),Ne={draw:Re},He={parser:ze,db:Be,renderer:Ne,styles:o(()=>"","styles")};export{He as diagram};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import{g as ze}from"./chunk-55IACEB6-CNgdotn1.js";import{s as Xe}from"./chunk-2J33WTMH-cdZ9jzPc.js";import{b as f,a4 as Be,b2 as Je,a3 as Ze,b1 as et,a2 as tt,b4 as st,a7 as it,a5 as Ne,aF as qe,u as rt,_ as nt,ac as at,aW as lt,bl as ct}from"./index-CUO5Op8Z.js";var Ce=(function(){var e=f(function($,i,l,o){for(l=l||{},o=$.length;o--;l[$[o]]=i);return l},"o"),n=[1,3],u=[1,4],h=[1,5],r=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],m=[1,22],p=[2,7],y=[1,26],S=[1,27],k=[1,28],q=[1,29],C=[1,33],A=[1,34],V=[1,35],v=[1,36],L=[1,37],x=[1,38],O=[1,24],w=[1,31],D=[1,32],M=[1,30],R=[1,39],g=[1,40],E=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],P=[1,61],X=[89,90],Ae=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Ee=[27,29],Ve=[1,70],ve=[1,71],Le=[1,72],xe=[1,73],Oe=[1,74],we=[1,75],De=[1,76],ee=[1,83],U=[1,80],te=[1,84],se=[1,85],ie=[1,86],re=[1,87],ne=[1,88],ae=[1,89],le=[1,90],ce=[1,91],oe=[1,92],pe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],Me=[1,101],Fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],he=[1,116],ue=[1,117],fe=[1,114],me=[1,115],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:f(function(i,l,o,s,d,t,de){var c=t.length-1;switch(d){case 4:this.$=t[c].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[c].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[c-3],t[c-4]);break;case 22:s.addRequirement(t[c-5],t[c-6]),s.setClass([t[c-5]],t[c-3]);break;case 23:s.setNewReqId(t[c-2]);break;case 24:s.setNewReqText(t[c-2]);break;case 25:s.setNewReqRisk(t[c-2]);break;case 26:s.setNewReqVerifyMethod(t[c-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[c-3]);break;case 43:s.addElement(t[c-5]),s.setClass([t[c-5]],t[c-3]);break;case 44:s.setNewElementType(t[c-2]);break;case 45:s.setNewElementDocRef(t[c-2]);break;case 48:s.addRelationship(t[c-2],t[c],t[c-4]);break;case 49:s.addRelationship(t[c-2],t[c-4],t[c]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[c-2],s.defineClass(t[c-1],t[c]);break;case 58:s.setClass(t[c-1],t[c]);break;case 59:s.setClass([t[c-2]],t[c]);break;case 60:case 62:this.$=[t[c]];break;case 61:case 63:this.$=t[c-2].concat([t[c]]);break;case 64:this.$=t[c-2],s.setCssStyle(t[c-1],t[c]);break;case 65:this.$=[t[c]];break;case 66:t[c-2].push(t[c]),this.$=t[c-2];break;case 68:this.$=t[c-1]+t[c];break}},"anonymous"),table:[{3:1,4:2,6:n,9:u,11:h,13:r},{1:[3]},{3:8,4:2,5:[1,7],6:n,9:u,11:h,13:r},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(a,[2,6]),{3:12,4:2,6:n,9:u,11:h,13:r},{1:[2,2]},{4:17,5:m,7:13,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},e(a,[2,4]),e(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:m,7:42,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{4:17,5:m,7:43,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{4:17,5:m,7:44,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{4:17,5:m,7:45,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{4:17,5:m,7:46,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{4:17,5:m,7:47,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{4:17,5:m,7:48,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{4:17,5:m,7:49,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{4:17,5:m,7:50,8:p,9:u,11:h,13:r,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:y,22:S,23:k,24:q,25:23,33:25,41:C,42:A,43:V,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:R,90:g},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(E,[2,17]),e(E,[2,18]),e(E,[2,19]),e(E,[2,20]),{30:60,33:62,75:P,89:R,90:g},{30:63,33:62,75:P,89:R,90:g},{30:64,33:62,75:P,89:R,90:g},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ae,[2,81]),e(Ae,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(Ee,[2,79]),e(Ee,[2,80]),{27:[1,67],29:[1,68]},e(Ee,[2,85]),e(Ee,[2,86]),{62:69,65:Ve,66:ve,67:Le,68:xe,69:Oe,70:we,71:De},{62:77,65:Ve,66:ve,67:Le,68:xe,69:Oe,70:we,71:De},{30:78,33:62,75:P,89:R,90:g},{73:79,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,60]),e(pe,[2,62]),{73:93,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},{30:94,33:62,75:P,76:U,89:R,90:g},{5:[1,95]},{30:96,33:62,75:P,89:R,90:g},{5:[1,97]},{30:98,33:62,75:P,89:R,90:g},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(E,[2,59],{76:U}),e(E,[2,64],{76:Me}),{33:103,75:[1,102],89:R,90:g},e(Fe,[2,65],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),e(T,[2,67]),e(T,[2,69]),e(T,[2,70]),e(T,[2,71]),e(T,[2,72]),e(T,[2,73]),e(T,[2,74]),e(T,[2,75]),e(T,[2,76]),e(T,[2,77]),e(T,[2,78]),e(E,[2,57],{76:Me}),e(E,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:he,40:ue,56:113,57:fe,59:me},{27:[1,118],76:U},{33:119,89:R,90:g},{33:120,89:R,90:g},{75:ee,78:121,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,61]),e(pe,[2,63]),e(T,[2,68]),e(E,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(E,[2,28]),{5:[1,127]},e(E,[2,42]),{32:[1,128]},{32:[1,129]},{5:he,40:ue,56:130,57:fe,59:me},e(E,[2,47]),{5:[1,131]},e(E,[2,48]),e(E,[2,49]),e(Fe,[2,66],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),{33:132,89:R,90:g},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(E,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(E,[2,46]),{5:he,40:ue,56:152,57:fe,59:me},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(E,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(E,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:he,40:ue,56:163,57:fe,59:me},{5:he,40:ue,56:164,57:fe,59:me},e(E,[2,23]),e(E,[2,24]),e(E,[2,25]),e(E,[2,26]),e(E,[2,44]),e(E,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:f(function(i,l){if(l.recoverable)this.trace(i);else{var o=new Error(i);throw o.hash=l,o}},"parseError"),parse:f(function(i){var l=this,o=[0],s=[],d=[null],t=[],de=this.table,c="",ge=0,$e=0,Ke=2,Pe=1,We=t.slice.call(arguments,1),_=Object.create(this.lexer),G={yy:{}};for(var be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,be)&&(G.yy[be]=this.yy[be]);_.setInput(i,G.yy),G.yy.lexer=_,G.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Ie=_.yylloc;t.push(Ie);var je=_.options&&_.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ge(I){o.length=o.length-2*I,d.length=d.length-I,t.length=t.length-I}f(Ge,"popStack");function Ue(){var I;return I=s.pop()||_.lex()||Pe,typeof I!="number"&&(I instanceof Array&&(s=I,I=s.pop()),I=l.symbols_[I]||I),I}f(Ue,"lex");for(var b,z,N,ke,J={},ye,F,Ye,_e;;){if(z=o[o.length-1],this.defaultActions[z]?N=this.defaultActions[z]:((b===null||typeof b>"u")&&(b=Ue()),N=de[z]&&de[z][b]),typeof N>"u"||!N.length||!N[0]){var Te="";_e=[];for(ye in de[z])this.terminals_[ye]&&ye>Ke&&_e.push("'"+this.terminals_[ye]+"'");_.showPosition?Te="Parse error on line "+(ge+1)+`:
|
|
2
|
+
`+_.showPosition()+`
|
|
3
|
+
Expecting `+_e.join(", ")+", got '"+(this.terminals_[b]||b)+"'":Te="Parse error on line "+(ge+1)+": Unexpected "+(b==Pe?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(Te,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Ie,expected:_e})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+b);switch(N[0]){case 1:o.push(b),d.push(_.yytext),t.push(_.yylloc),o.push(N[1]),b=null,$e=_.yyleng,c=_.yytext,ge=_.yylineno,Ie=_.yylloc;break;case 2:if(F=this.productions_[N[1]][1],J.$=d[d.length-F],J._$={first_line:t[t.length-(F||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(F||1)].first_column,last_column:t[t.length-1].last_column},je&&(J._$.range=[t[t.length-(F||1)].range[0],t[t.length-1].range[1]]),ke=this.performAction.apply(J,[c,$e,ge,G.yy,N[1],d,t].concat(We)),typeof ke<"u")return ke;F&&(o=o.slice(0,-1*F*2),d=d.slice(0,-1*F),t=t.slice(0,-1*F)),o.push(this.productions_[N[1]][0]),d.push(J.$),t.push(J._$),Ye=de[o[o.length-2]][o[o.length-1]],o.push(Ye);break;case 3:return!0}}return!0},"parse")},He=(function(){var $={EOF:1,parseError:f(function(l,o){if(this.yy.parser)this.yy.parser.parseError(l,o);else throw new Error(l)},"parseError"),setInput:f(function(i,l){return this.yy=l||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var l=i.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:f(function(i){var l=i.length,o=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===s.length?this.yylloc.first_column:0)+s[s.length-o.length].length-o[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(i){this.unput(this.match.slice(i))},"less"),pastInput:f(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var i=this.pastInput(),l=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
5
|
+
`+l+"^"},"showPosition"),test_match:f(function(i,l){var o,s,d;if(this.options.backtrack_lexer&&(d={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(d.yylloc.range=this.yylloc.range.slice(0))),s=i[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],o=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var t in d)this[t]=d[t];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,l,o,s;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),t=0;t<d.length;t++)if(o=this._input.match(this.rules[d[t]]),o&&(!l||o[0].length>l[0].length)){if(l=o,s=t,this.options.backtrack_lexer){if(i=this.test_match(o,d[t]),i!==!1)return i;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(i=this.test_match(l,d[s]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:f(function(){var l=this.next();return l||this.lex()},"lex"),begin:f(function(l){this.conditionStack.push(l)},"begin"),popState:f(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:f(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:f(function(l){this.begin(l)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(l,o,s,d){switch(s){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return o.yytext=o.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return $})();Se.lexer=He;function Re(){this.yy={}}return f(Re,"Parser"),Re.prototype=Se,Se.Parser=Re,new Re})();Ce.parser=Ce;var ot=Ce,Z,ht=(Z=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Je,this.getAccTitle=Ze,this.setAccDescription=et,this.getAccDescription=tt,this.setDiagramTitle=st,this.getDiagramTitle=it,this.getConfig=f(()=>Ne().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(n){this.direction=n}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(n,u){return this.requirements.has(n)||this.requirements.set(n,{name:n,type:u,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(n)}getRequirements(){return this.requirements}setNewReqId(n){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=n)}setNewReqText(n){this.latestRequirement!==void 0&&(this.latestRequirement.text=n)}setNewReqRisk(n){this.latestRequirement!==void 0&&(this.latestRequirement.risk=n)}setNewReqVerifyMethod(n){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=n)}addElement(n){return this.elements.has(n)||(this.elements.set(n,{name:n,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),qe.info("Added new element: ",n)),this.resetLatestElement(),this.elements.get(n)}getElements(){return this.elements}setNewElementType(n){this.latestElement!==void 0&&(this.latestElement.type=n)}setNewElementDocRef(n){this.latestElement!==void 0&&(this.latestElement.docRef=n)}addRelationship(n,u,h){this.relations.push({type:n,src:u,dst:h})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,rt()}setCssStyle(n,u){for(const h of n){const r=this.requirements.get(h)??this.elements.get(h);if(!u||!r)return;for(const a of u)a.includes(",")?r.cssStyles.push(...a.split(",")):r.cssStyles.push(a)}}setClass(n,u){for(const h of n){const r=this.requirements.get(h)??this.elements.get(h);if(r)for(const a of u){r.classes.push(a);const m=this.classes.get(a)?.styles;m&&r.cssStyles.push(...m)}}}defineClass(n,u){for(const h of n){let r=this.classes.get(h);r===void 0&&(r={id:h,styles:[],textStyles:[]},this.classes.set(h,r)),u&&u.forEach(function(a){if(/color/.exec(a)){const m=a.replace("fill","bgFill");r.textStyles.push(m)}r.styles.push(a)}),this.requirements.forEach(a=>{a.classes.includes(h)&&a.cssStyles.push(...u.flatMap(m=>m.split(",")))}),this.elements.forEach(a=>{a.classes.includes(h)&&a.cssStyles.push(...u.flatMap(m=>m.split(",")))})}}getClasses(){return this.classes}getData(){const n=Ne(),u=[],h=[];for(const r of this.requirements.values()){const a=r;a.id=r.name,a.cssStyles=r.cssStyles,a.cssClasses=r.classes.join(" "),a.shape="requirementBox",a.look=n.look,a.colorIndex=u.length,u.push(a)}for(const r of this.elements.values()){const a=r;a.shape="requirementBox",a.look=n.look,a.id=r.name,a.cssStyles=r.cssStyles,a.cssClasses=r.classes.join(" "),a.colorIndex=u.length,u.push(a)}for(const r of this.relations){let a=0;const m=r.type===this.Relationships.CONTAINS,p={id:`${r.src}-${r.dst}-${a}`,start:this.requirements.get(r.src)?.name??this.elements.get(r.src)?.name,end:this.requirements.get(r.dst)?.name??this.elements.get(r.dst)?.name,label:`<<${r.type}>>`,classes:"relationshipLine",style:["fill:none",m?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:m?"normal":"dashed",arrowTypeStart:m?"requirement_contains":"",arrowTypeEnd:m?"":"requirement_arrow",look:n.look,labelType:"markdown"};h.push(p),a++}return{nodes:u,edges:h,other:{},config:n,direction:this.getDirection()}}},f(Z,"RequirementDB"),Z),ut=f(e=>{const n=Be(),{themeVariables:u,look:h}=n,{bkgColorArray:r,borderColorArray:a}=u;if(!a?.length)return"";let m="";for(let p=0;p<e.THEME_COLOR_LIMIT;p++)m+=`
|
|
7
|
+
|
|
8
|
+
[data-look="${h}"][data-color-id="color-${p}"].node path {
|
|
9
|
+
stroke: ${a[p]};
|
|
10
|
+
fill: ${r?.length?r[p]:""};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-look="${h}"][data-color-id="color-${p}"].node rect {
|
|
14
|
+
stroke: ${a[p]};
|
|
15
|
+
fill: ${r?.length?r[p]:""};
|
|
16
|
+
}
|
|
17
|
+
`;return m},"genColor"),ft=f(e=>{const n=Be(),{look:u,themeVariables:h}=n,{requirementEdgeLabelBackground:r}=h;return`
|
|
18
|
+
${ut(e)}
|
|
19
|
+
marker {
|
|
20
|
+
fill: ${e.relationColor};
|
|
21
|
+
stroke: ${e.relationColor};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
marker.cross {
|
|
25
|
+
stroke: ${e.lineColor};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
svg {
|
|
29
|
+
font-family: ${e.fontFamily};
|
|
30
|
+
font-size: ${e.fontSize};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.reqBox {
|
|
34
|
+
fill: ${e.requirementBackground};
|
|
35
|
+
fill-opacity: 1.0;
|
|
36
|
+
stroke: ${e.requirementBorderColor};
|
|
37
|
+
stroke-width: ${e.requirementBorderSize};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.reqTitle, .reqLabel{
|
|
41
|
+
fill: ${e.requirementTextColor};
|
|
42
|
+
}
|
|
43
|
+
.reqLabelBox {
|
|
44
|
+
fill: ${e.relationLabelBackground};
|
|
45
|
+
fill-opacity: 1.0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.req-title-line {
|
|
49
|
+
stroke: ${e.requirementBorderColor};
|
|
50
|
+
stroke-width: ${e.requirementBorderSize};
|
|
51
|
+
}
|
|
52
|
+
.relationshipLine {
|
|
53
|
+
stroke: ${e.relationColor};
|
|
54
|
+
stroke-width: ${u==="neo"?e.strokeWidth:"1px"};
|
|
55
|
+
}
|
|
56
|
+
.relationshipLabel {
|
|
57
|
+
fill: ${e.relationLabelColor};
|
|
58
|
+
}
|
|
59
|
+
.edgeLabel {
|
|
60
|
+
background-color: ${e.edgeLabelBackground};
|
|
61
|
+
}
|
|
62
|
+
.edgeLabel .label rect {
|
|
63
|
+
fill: ${e.edgeLabelBackground};
|
|
64
|
+
}
|
|
65
|
+
.edgeLabel .label text {
|
|
66
|
+
fill: ${e.relationLabelColor};
|
|
67
|
+
}
|
|
68
|
+
.divider {
|
|
69
|
+
stroke: ${e.nodeBorder};
|
|
70
|
+
stroke-width: 1;
|
|
71
|
+
}
|
|
72
|
+
.label {
|
|
73
|
+
font-family: ${e.fontFamily};
|
|
74
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
75
|
+
}
|
|
76
|
+
.label text,span {
|
|
77
|
+
fill: ${e.nodeTextColor||e.textColor};
|
|
78
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
79
|
+
}
|
|
80
|
+
.labelBkg {
|
|
81
|
+
background-color: ${r??e.edgeLabelBackground};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
`},"getStyles"),mt=ft,Qe={};nt(Qe,{draw:()=>dt});var dt=f(async function(e,n,u,h){qe.info("REF0:"),qe.info("Drawing requirement diagram (unified)",n);const{securityLevel:r,state:a,layout:m,look:p}=Ne(),y=h.db.getData(),S=ze(n,r);y.type=h.type,y.layoutAlgorithm=at(m),y.nodeSpacing=a?.nodeSpacing??50,y.rankSpacing=a?.rankSpacing??50,y.markers=p==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],y.diagramId=n,await lt(y,S);const k=8;ct.insertTitle(S,"requirementDiagramTitleText",a?.titleTopMargin??25,h.db.getDiagramTitle()),Xe(S,k,"requirementDiagram",a?.useMaxWidth??!0)},"draw"),gt={parser:ot,get db(){return new ht},renderer:Qe,styles:mt};export{gt as diagram};
|