@wandox/sdk 0.1.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/README.md +59 -0
- package/dist/arc-BJMRTG9S.cjs +1 -0
- package/dist/arc-Vdco0qfw.js +83 -0
- package/dist/architectureDiagram-3BPJPVTR-BjEqcvey.js +4695 -0
- package/dist/architectureDiagram-3BPJPVTR-BvjJfAkh.cjs +36 -0
- package/dist/blockDiagram-GPEHLZMM-B1xf7RE9.js +2427 -0
- package/dist/blockDiagram-GPEHLZMM-B5VqovGY.cjs +132 -0
- package/dist/c4Diagram-AAUBKEIU-C4kjMRea.js +1578 -0
- package/dist/c4Diagram-AAUBKEIU-Ck5uEnJI.cjs +10 -0
- package/dist/channel-DlRtLuYv.js +5 -0
- package/dist/channel-Dm_yrRYJ.cjs +1 -0
- package/dist/chunk-2J33WTMH-CG2n_n4y.cjs +1 -0
- package/dist/chunk-2J33WTMH-CWvmGb4H.js +20 -0
- package/dist/chunk-4BX2VUAB-Bq3GzsD8.js +9 -0
- package/dist/chunk-4BX2VUAB-CdMctZeT.cjs +1 -0
- package/dist/chunk-55IACEB6-BdJhzL0d.js +8 -0
- package/dist/chunk-55IACEB6-sHyHtvg8.cjs +1 -0
- package/dist/chunk-727SXJPM-D-Vmam30.cjs +206 -0
- package/dist/chunk-727SXJPM-DmruCqjM.js +1529 -0
- package/dist/chunk-AQP2D5EJ-CWhKjcV3.cjs +231 -0
- package/dist/chunk-AQP2D5EJ-Ca0ak6w7.js +1399 -0
- package/dist/chunk-FMBD7UC4-CqV0NWQQ.js +19 -0
- package/dist/chunk-FMBD7UC4-DOxtd0OO.cjs +15 -0
- package/dist/chunk-ND2GUHAM-6EMX5Mu8.js +68 -0
- package/dist/chunk-ND2GUHAM-BXeDBtSC.cjs +1 -0
- package/dist/chunk-QZHKN3VN-B7FSI55w.js +15 -0
- package/dist/chunk-QZHKN3VN-CbbdNKnD.cjs +1 -0
- package/dist/classDiagram-4FO5ZUOK-0Kaf7WfA.js +16 -0
- package/dist/classDiagram-4FO5ZUOK-C4it2xBI.cjs +1 -0
- package/dist/classDiagram-v2-Q7XG4LA2-Byom5adL.js +16 -0
- package/dist/classDiagram-v2-Q7XG4LA2-C4it2xBI.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-CuUv9oIm.js +2606 -0
- package/dist/cose-bilkent-S5V4N54A-Dh6nTopA.cjs +1 -0
- package/dist/cytoscape.esm-Cp8cXbK2.js +18729 -0
- package/dist/cytoscape.esm-fcqEUasK.cjs +331 -0
- package/dist/dagre-BM42HDAG-CwxJjZ2n.cjs +4 -0
- package/dist/dagre-BM42HDAG-DMBidMxP.js +448 -0
- package/dist/defaultLocale-BDVPUiG2.js +171 -0
- package/dist/defaultLocale-k2G_58r6.cjs +1 -0
- package/dist/diagram-2AECGRRQ-B2a4nXgJ.js +221 -0
- package/dist/diagram-2AECGRRQ-r7De7taS.cjs +43 -0
- package/dist/diagram-5GNKFQAL-CDiO79WC.cjs +10 -0
- package/dist/diagram-5GNKFQAL-DrHBNZzF.js +123 -0
- package/dist/diagram-KO2AKTUF-BcjWCXZr.js +466 -0
- package/dist/diagram-KO2AKTUF-CDlJCxVO.cjs +3 -0
- package/dist/diagram-LMA3HP47-BXFSAyNV.cjs +24 -0
- package/dist/diagram-LMA3HP47-DJxmyqn0.js +143 -0
- package/dist/diagram-OG6HWLK6-ATK__ca8.js +531 -0
- package/dist/diagram-OG6HWLK6-CgIyEO8_.cjs +24 -0
- package/dist/erDiagram-TEJ5UH35-D4baWNzQ.js +900 -0
- package/dist/erDiagram-TEJ5UH35-Dyuc5EB6.cjs +85 -0
- package/dist/flowDiagram-I6XJVG4X-BMZOncyU.js +1635 -0
- package/dist/flowDiagram-I6XJVG4X-C45fICr4.cjs +162 -0
- package/dist/ganttDiagram-6RSMTGT7-CiYZmmke.js +2526 -0
- package/dist/ganttDiagram-6RSMTGT7-Cxoj6IK8.cjs +292 -0
- package/dist/gitGraphDiagram-PVQCEYII-CQ9bNuwN.js +828 -0
- package/dist/gitGraphDiagram-PVQCEYII-rlaY9dfj.cjs +106 -0
- package/dist/graph-CBizzZ7K.js +1545 -0
- package/dist/graph-V5BNIbHU.cjs +1 -0
- package/dist/index-jBRold1l.js +173159 -0
- package/dist/index-sFrjovbM.cjs +804 -0
- package/dist/index.d.ts +54 -0
- package/dist/infoDiagram-5YYISTIA-CAzYIvUX.js +24 -0
- package/dist/infoDiagram-5YYISTIA-zX5rQglQ.cjs +2 -0
- package/dist/init-CHZsXQcr.cjs +1 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/ishikawaDiagram-YF4QCWOH-09prKBsn.cjs +70 -0
- package/dist/ishikawaDiagram-YF4QCWOH-Co8BnN24.js +622 -0
- package/dist/journeyDiagram-JHISSGLW-DkdWRF_-.cjs +139 -0
- package/dist/journeyDiagram-JHISSGLW-riCLiMCC.js +836 -0
- package/dist/kanban-definition-UN3LZRKU-DWipOCsx.cjs +89 -0
- package/dist/kanban-definition-UN3LZRKU-SRyCSn2H.js +725 -0
- package/dist/katex-Cf_UVKIT.cjs +257 -0
- package/dist/katex-RNjvZ8pg.js +11681 -0
- package/dist/layout-CbksXFOD.js +1728 -0
- package/dist/layout-Dh52gsIJ.cjs +1 -0
- package/dist/linear-C3xSMJV8.cjs +1 -0
- package/dist/linear-CmUCzX9U.js +259 -0
- package/dist/mermaid.core-BzNKr-OJ.cjs +308 -0
- package/dist/mermaid.core-CdBIz6FY.js +15475 -0
- package/dist/mindmap-definition-RKZ34NQL-Cs63oyIX.cjs +96 -0
- package/dist/mindmap-definition-RKZ34NQL-Gcma5iTd.js +830 -0
- package/dist/ordinal-CagbB1m8.cjs +1 -0
- package/dist/ordinal-DfAQgscy.js +61 -0
- package/dist/pieDiagram-4H26LBE5-CBGkD8dp.cjs +30 -0
- package/dist/pieDiagram-4H26LBE5-DSL8cVK1.js +164 -0
- package/dist/quadrantDiagram-W4KKPZXB-D3nCWRjF.cjs +7 -0
- package/dist/quadrantDiagram-W4KKPZXB-uod6bhUy.js +1026 -0
- package/dist/requirementDiagram-4Y6WPE33-Bc_6y7SM.js +884 -0
- package/dist/requirementDiagram-4Y6WPE33-D2mHlh5i.cjs +84 -0
- package/dist/sankeyDiagram-5OEKKPKP-DL_kXejW.cjs +40 -0
- package/dist/sankeyDiagram-5OEKKPKP-DMsjY4G4.js +847 -0
- package/dist/sequenceDiagram-3UESZ5HK-CBGalGOV.cjs +162 -0
- package/dist/sequenceDiagram-3UESZ5HK-CH2Z-Pis.js +2901 -0
- package/dist/stateDiagram-AJRCARHV-gEqlAI6t.js +263 -0
- package/dist/stateDiagram-AJRCARHV-rNMrAI-A.cjs +1 -0
- package/dist/stateDiagram-v2-BHNVJYJU-CDj7L1wi.js +16 -0
- package/dist/stateDiagram-v2-BHNVJYJU-LLlFJ1GM.cjs +1 -0
- package/dist/timeline-definition-PNZ67QCA-Bbuv3uu-.cjs +120 -0
- package/dist/timeline-definition-PNZ67QCA-DrGFbQdC.js +1068 -0
- package/dist/types.d.ts +295 -0
- package/dist/vennDiagram-CIIHVFJN-CGcAwVxU.js +1564 -0
- package/dist/vennDiagram-CIIHVFJN-DsSjXluJ.cjs +34 -0
- package/dist/wandox.cjs +1 -0
- package/dist/wandox.css +1 -0
- package/dist/wandox.js +6 -0
- package/dist/wandox.umd.js +4172 -0
- package/dist/wardley-L42UT6IY-DUnkyH_z.js +22539 -0
- package/dist/wardley-L42UT6IY-tDp0NbFW.cjs +165 -0
- package/dist/wardleyDiagram-YWT4CUSO-CB_Qa4lR.js +684 -0
- package/dist/wardleyDiagram-YWT4CUSO-D0BUmvVW.cjs +78 -0
- package/dist/xychartDiagram-2RQKCTM6-Bcq-ACuw.js +1342 -0
- package/dist/xychartDiagram-2RQKCTM6-BjeAPKLo.cjs +7 -0
- package/package.json +42 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("./init-CHZsXQcr.cjs");class o extends Map{constructor(n,t=p){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),n!=null)for(const[r,s]of n)this.set(r,s)}get(n){return super.get(c(this,n))}has(n){return super.has(c(this,n))}set(n,t){return super.set(g(this,n),t)}delete(n){return super.delete(h(this,n))}}function c({_intern:e,_key:n},t){const r=n(t);return e.has(r)?e.get(r):t}function g({_intern:e,_key:n},t){const r=n(t);return e.has(r)?e.get(r):(e.set(r,t),t)}function h({_intern:e,_key:n},t){const r=n(t);return e.has(r)&&(t=e.get(r),e.delete(r)),t}function p(e){return e!==null&&typeof e=="object"?e.valueOf():e}const f=Symbol("implicit");function a(){var e=new o,n=[],t=[],r=f;function s(i){let u=e.get(i);if(u===void 0){if(r!==f)return r;e.set(i,u=n.push(i)-1)}return t[u%t.length]}return s.domain=function(i){if(!arguments.length)return n.slice();n=[],e=new o;for(const u of i)e.has(u)||e.set(u,n.push(u)-1);return s},s.range=function(i){return arguments.length?(t=Array.from(i),s):t.slice()},s.unknown=function(i){return arguments.length?(r=i,s):r},s.copy=function(){return a(n,t).unknown(r)},l.initRange.apply(s,arguments),s}exports.ordinal=a;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { i as a } from "./init-DjUOC4st.js";
|
|
2
|
+
class o extends Map {
|
|
3
|
+
constructor(n, t = g) {
|
|
4
|
+
if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: t } }), n != null) for (const [r, s] of n) this.set(r, s);
|
|
5
|
+
}
|
|
6
|
+
get(n) {
|
|
7
|
+
return super.get(c(this, n));
|
|
8
|
+
}
|
|
9
|
+
has(n) {
|
|
10
|
+
return super.has(c(this, n));
|
|
11
|
+
}
|
|
12
|
+
set(n, t) {
|
|
13
|
+
return super.set(l(this, n), t);
|
|
14
|
+
}
|
|
15
|
+
delete(n) {
|
|
16
|
+
return super.delete(p(this, n));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function c({ _intern: e, _key: n }, t) {
|
|
20
|
+
const r = n(t);
|
|
21
|
+
return e.has(r) ? e.get(r) : t;
|
|
22
|
+
}
|
|
23
|
+
function l({ _intern: e, _key: n }, t) {
|
|
24
|
+
const r = n(t);
|
|
25
|
+
return e.has(r) ? e.get(r) : (e.set(r, t), t);
|
|
26
|
+
}
|
|
27
|
+
function p({ _intern: e, _key: n }, t) {
|
|
28
|
+
const r = n(t);
|
|
29
|
+
return e.has(r) && (t = e.get(r), e.delete(r)), t;
|
|
30
|
+
}
|
|
31
|
+
function g(e) {
|
|
32
|
+
return e !== null && typeof e == "object" ? e.valueOf() : e;
|
|
33
|
+
}
|
|
34
|
+
const f = Symbol("implicit");
|
|
35
|
+
function h() {
|
|
36
|
+
var e = new o(), n = [], t = [], r = f;
|
|
37
|
+
function s(u) {
|
|
38
|
+
let i = e.get(u);
|
|
39
|
+
if (i === void 0) {
|
|
40
|
+
if (r !== f) return r;
|
|
41
|
+
e.set(u, i = n.push(u) - 1);
|
|
42
|
+
}
|
|
43
|
+
return t[i % t.length];
|
|
44
|
+
}
|
|
45
|
+
return s.domain = function(u) {
|
|
46
|
+
if (!arguments.length) return n.slice();
|
|
47
|
+
n = [], e = new o();
|
|
48
|
+
for (const i of u)
|
|
49
|
+
e.has(i) || e.set(i, n.push(i) - 1);
|
|
50
|
+
return s;
|
|
51
|
+
}, s.range = function(u) {
|
|
52
|
+
return arguments.length ? (t = Array.from(u), s) : t.slice();
|
|
53
|
+
}, s.unknown = function(u) {
|
|
54
|
+
return arguments.length ? (r = u, s) : r;
|
|
55
|
+
}, s.copy = function() {
|
|
56
|
+
return h(n, t).unknown(r);
|
|
57
|
+
}, a.apply(s, arguments), s;
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
h as o
|
|
61
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./mermaid.core-BzNKr-OJ.cjs"),Z=require("./chunk-4BX2VUAB-CdMctZeT.cjs"),H=require("./wardley-L42UT6IY-tDp0NbFW.cjs"),N=require("./arc-BJMRTG9S.cjs"),J=require("./ordinal-CagbB1m8.cjs");function K(e,n){return n<e?-1:n>e?1:n>=e?0:NaN}function Q(e){return e}function ee(){var e=Q,n=K,f=null,$=t.constant(0),o=t.constant(t.tau),g=t.constant(0);function s(a){var i,c=(a=t.array(a)).length,p,h,v=0,u=new Array(c),l=new Array(c),S=+$.apply(this,arguments),x=Math.min(t.tau,Math.max(-t.tau,o.apply(this,arguments)-S)),m,A=Math.min(Math.abs(x)/c,g.apply(this,arguments)),D=A*(x<0?-1:1),d;for(i=0;i<c;++i)(d=l[u[i]=i]=+e(a[i],i,a))>0&&(v+=d);for(n!=null?u.sort(function(y,w){return n(l[y],l[w])}):f!=null&&u.sort(function(y,w){return f(a[y],a[w])}),i=0,h=v?(x-c*D)/v:0;i<c;++i,S=m)p=u[i],d=l[p],m=S+(d>0?d*h:0)+D,l[p]={data:a[p],index:i,value:d,startAngle:S,endAngle:m,padAngle:A};return l}return s.value=function(a){return arguments.length?(e=typeof a=="function"?a:t.constant(+a),s):e},s.sortValues=function(a){return arguments.length?(n=a,f=null,s):n},s.sort=function(a){return arguments.length?(f=a,n=null,s):f},s.startAngle=function(a){return arguments.length?($=typeof a=="function"?a:t.constant(+a),s):$},s.endAngle=function(a){return arguments.length?(o=typeof a=="function"?a:t.constant(+a),s):o},s.padAngle=function(a){return arguments.length?(g=typeof a=="function"?a:t.constant(+a),s):g},s}var te=t.defaultConfig_default.pie,M={sections:new Map,showData:!1},T=M.sections,E=M.showData,ae=structuredClone(te),ne=t.__name(()=>structuredClone(ae),"getConfig"),re=t.__name(()=>{T=new Map,E=M.showData,t.clear()},"clear"),ie=t.__name(({label:e,value:n})=>{if(n<0)throw new Error(`"${e}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(e)||(T.set(e,n),t.log.debug(`added new section: ${e}, with value: ${n}`))},"addSection"),le=t.__name(()=>T,"getSections"),oe=t.__name(e=>{E=e},"setShowData"),se=t.__name(()=>E,"getShowData"),O={getConfig:ne,clear:re,setDiagramTitle:t.setDiagramTitle,getDiagramTitle:t.getDiagramTitle,setAccTitle:t.setAccTitle,getAccTitle:t.getAccTitle,setAccDescription:t.setAccDescription,getAccDescription:t.getAccDescription,addSection:ie,getSections:le,setShowData:oe,getShowData:se},ce=t.__name((e,n)=>{Z.populateCommonDb(e,n),n.setShowData(e.showData),e.sections.map(n.addSection)},"populateDb"),ue={parse:t.__name(async e=>{const n=await H.parse("pie",e);t.log.debug(n),ce(n,O)},"parse")},de=t.__name(e=>`
|
|
2
|
+
.pieCircle{
|
|
3
|
+
stroke: ${e.pieStrokeColor};
|
|
4
|
+
stroke-width : ${e.pieStrokeWidth};
|
|
5
|
+
opacity : ${e.pieOpacity};
|
|
6
|
+
}
|
|
7
|
+
.pieOuterCircle{
|
|
8
|
+
stroke: ${e.pieOuterStrokeColor};
|
|
9
|
+
stroke-width: ${e.pieOuterStrokeWidth};
|
|
10
|
+
fill: none;
|
|
11
|
+
}
|
|
12
|
+
.pieTitleText {
|
|
13
|
+
text-anchor: middle;
|
|
14
|
+
font-size: ${e.pieTitleTextSize};
|
|
15
|
+
fill: ${e.pieTitleTextColor};
|
|
16
|
+
font-family: ${e.fontFamily};
|
|
17
|
+
}
|
|
18
|
+
.slice {
|
|
19
|
+
font-family: ${e.fontFamily};
|
|
20
|
+
fill: ${e.pieSectionTextColor};
|
|
21
|
+
font-size:${e.pieSectionTextSize};
|
|
22
|
+
// fill: white;
|
|
23
|
+
}
|
|
24
|
+
.legend text {
|
|
25
|
+
fill: ${e.pieLegendTextColor};
|
|
26
|
+
font-family: ${e.fontFamily};
|
|
27
|
+
font-size: ${e.pieLegendTextSize};
|
|
28
|
+
}
|
|
29
|
+
`,"getStyles"),ge=de,pe=t.__name(e=>{const n=[...e.values()].reduce((o,g)=>o+g,0),f=[...e.entries()].map(([o,g])=>({label:o,value:g})).filter(o=>o.value/n*100>=1);return ee().value(o=>o.value).sort(null)(f)},"createPieArcs"),fe=t.__name((e,n,f,$)=>{var L;t.log.debug(`rendering pie chart
|
|
30
|
+
`+e);const o=$.db,g=t.getConfig2(),s=t.cleanAndMerge(o.getConfig(),g.pie),a=40,i=18,c=4,p=450,h=p,v=t.selectSvgElement(n),u=v.append("g");u.attr("transform","translate("+h/2+","+p/2+")");const{themeVariables:l}=g;let[S]=t.parseFontSize(l.pieOuterStrokeWidth);S??(S=2);const x=s.textPosition,m=Math.min(h,p)/2-a,A=N.d3arc().innerRadius(0).outerRadius(m),D=N.d3arc().innerRadius(m*x).outerRadius(m*x);u.append("circle").attr("cx",0).attr("cy",0).attr("r",m+S/2).attr("class","pieOuterCircle");const d=o.getSections(),y=pe(d),w=[l.pie1,l.pie2,l.pie3,l.pie4,l.pie5,l.pie6,l.pie7,l.pie8,l.pie9,l.pie10,l.pie11,l.pie12];let C=0;d.forEach(r=>{C+=r});const R=y.filter(r=>(r.data.value/C*100).toFixed(0)!=="0"),_=J.ordinal(w).domain([...d.keys()]);u.selectAll("mySlices").data(R).enter().append("path").attr("d",A).attr("fill",r=>_(r.data.label)).attr("class","pieCircle"),u.selectAll("mySlices").data(R).enter().append("text").text(r=>(r.data.value/C*100).toFixed(0)+"%").attr("transform",r=>"translate("+D.centroid(r)+")").style("text-anchor","middle").attr("class","slice");const P=u.append("text").text(o.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),W=[...d.entries()].map(([r,k])=>({label:r,value:k})),b=u.selectAll(".legend").data(W).enter().append("g").attr("class","legend").attr("transform",(r,k)=>{const G=i+c,j=G*W.length/2,X=12*i,Y=k*G-j;return"translate("+X+","+Y+")"});b.append("rect").attr("width",i).attr("height",i).style("fill",r=>_(r.label)).style("stroke",r=>_(r.label)),b.append("text").attr("x",i+c).attr("y",i-c).text(r=>o.getShowData()?`${r.label} [${r.value}]`:r.label);const I=Math.max(...b.selectAll("text").nodes().map(r=>(r==null?void 0:r.getBoundingClientRect().width)??0)),q=h+a+i+c+I,z=((L=P.node())==null?void 0:L.getBoundingClientRect().width)??0,U=h/2-z/2,V=h/2+z/2,B=Math.min(0,U),F=Math.max(q,V)-B;v.attr("viewBox",`${B} 0 ${F} ${p}`),t.configureSvgSize(v,p,F,s.useMaxWidth)},"draw"),he={draw:fe},me={parser:ue,db:O,renderer:he,styles:ge};exports.diagram=me;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { F as x, bc as R, g as J, $ as Y, a$ as tt, a0 as et, b0 as at, a3 as rt, b2 as nt, b as d, aB as F, a2 as it, s as st, a_ as lt, aK as ot, E as ct, t as ut, Q as dt } from "./mermaid.core-CdBIz6FY.js";
|
|
2
|
+
import { p as gt } from "./chunk-4BX2VUAB-Bq3GzsD8.js";
|
|
3
|
+
import { p as pt } from "./wardley-L42UT6IY-DUnkyH_z.js";
|
|
4
|
+
import { d as _ } from "./arc-Vdco0qfw.js";
|
|
5
|
+
import { o as ft } from "./ordinal-DfAQgscy.js";
|
|
6
|
+
function ht(t, a) {
|
|
7
|
+
return a < t ? -1 : a > t ? 1 : a >= t ? 0 : NaN;
|
|
8
|
+
}
|
|
9
|
+
function mt(t) {
|
|
10
|
+
return t;
|
|
11
|
+
}
|
|
12
|
+
function vt() {
|
|
13
|
+
var t = mt, a = ht, f = null, S = x(0), s = x(R), g = x(0);
|
|
14
|
+
function l(e) {
|
|
15
|
+
var n, o = (e = J(e)).length, p, h, v = 0, c = new Array(o), i = new Array(o), $ = +S.apply(this, arguments), w = Math.min(R, Math.max(-R, s.apply(this, arguments) - $)), m, C = Math.min(Math.abs(w) / o, g.apply(this, arguments)), D = C * (w < 0 ? -1 : 1), u;
|
|
16
|
+
for (n = 0; n < o; ++n)
|
|
17
|
+
(u = i[c[n] = n] = +t(e[n], n, e)) > 0 && (v += u);
|
|
18
|
+
for (a != null ? c.sort(function(y, A) {
|
|
19
|
+
return a(i[y], i[A]);
|
|
20
|
+
}) : f != null && c.sort(function(y, A) {
|
|
21
|
+
return f(e[y], e[A]);
|
|
22
|
+
}), n = 0, h = v ? (w - o * D) / v : 0; n < o; ++n, $ = m)
|
|
23
|
+
p = c[n], u = i[p], m = $ + (u > 0 ? u * h : 0) + D, i[p] = {
|
|
24
|
+
data: e[p],
|
|
25
|
+
index: n,
|
|
26
|
+
value: u,
|
|
27
|
+
startAngle: $,
|
|
28
|
+
endAngle: m,
|
|
29
|
+
padAngle: C
|
|
30
|
+
};
|
|
31
|
+
return i;
|
|
32
|
+
}
|
|
33
|
+
return l.value = function(e) {
|
|
34
|
+
return arguments.length ? (t = typeof e == "function" ? e : x(+e), l) : t;
|
|
35
|
+
}, l.sortValues = function(e) {
|
|
36
|
+
return arguments.length ? (a = e, f = null, l) : a;
|
|
37
|
+
}, l.sort = function(e) {
|
|
38
|
+
return arguments.length ? (f = e, a = null, l) : f;
|
|
39
|
+
}, l.startAngle = function(e) {
|
|
40
|
+
return arguments.length ? (S = typeof e == "function" ? e : x(+e), l) : S;
|
|
41
|
+
}, l.endAngle = function(e) {
|
|
42
|
+
return arguments.length ? (s = typeof e == "function" ? e : x(+e), l) : s;
|
|
43
|
+
}, l.padAngle = function(e) {
|
|
44
|
+
return arguments.length ? (g = typeof e == "function" ? e : x(+e), l) : g;
|
|
45
|
+
}, l;
|
|
46
|
+
}
|
|
47
|
+
var $t = dt.pie, W = {
|
|
48
|
+
sections: /* @__PURE__ */ new Map(),
|
|
49
|
+
showData: !1
|
|
50
|
+
}, T = W.sections, z = W.showData, xt = structuredClone($t), St = /* @__PURE__ */ d(() => structuredClone(xt), "getConfig"), wt = /* @__PURE__ */ d(() => {
|
|
51
|
+
T = /* @__PURE__ */ new Map(), z = W.showData, ut();
|
|
52
|
+
}, "clear"), yt = /* @__PURE__ */ d(({ label: t, value: a }) => {
|
|
53
|
+
if (a < 0)
|
|
54
|
+
throw new Error(
|
|
55
|
+
`"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`
|
|
56
|
+
);
|
|
57
|
+
T.has(t) || (T.set(t, a), F.debug(`added new section: ${t}, with value: ${a}`));
|
|
58
|
+
}, "addSection"), At = /* @__PURE__ */ d(() => T, "getSections"), Ct = /* @__PURE__ */ d((t) => {
|
|
59
|
+
z = t;
|
|
60
|
+
}, "setShowData"), Dt = /* @__PURE__ */ d(() => z, "getShowData"), V = {
|
|
61
|
+
getConfig: St,
|
|
62
|
+
clear: wt,
|
|
63
|
+
setDiagramTitle: nt,
|
|
64
|
+
getDiagramTitle: rt,
|
|
65
|
+
setAccTitle: at,
|
|
66
|
+
getAccTitle: et,
|
|
67
|
+
setAccDescription: tt,
|
|
68
|
+
getAccDescription: Y,
|
|
69
|
+
addSection: yt,
|
|
70
|
+
getSections: At,
|
|
71
|
+
setShowData: Ct,
|
|
72
|
+
getShowData: Dt
|
|
73
|
+
}, Tt = /* @__PURE__ */ d((t, a) => {
|
|
74
|
+
gt(t, a), a.setShowData(t.showData), t.sections.map(a.addSection);
|
|
75
|
+
}, "populateDb"), bt = {
|
|
76
|
+
parse: /* @__PURE__ */ d(async (t) => {
|
|
77
|
+
const a = await pt("pie", t);
|
|
78
|
+
F.debug(a), Tt(a, V);
|
|
79
|
+
}, "parse")
|
|
80
|
+
}, Et = /* @__PURE__ */ d((t) => `
|
|
81
|
+
.pieCircle{
|
|
82
|
+
stroke: ${t.pieStrokeColor};
|
|
83
|
+
stroke-width : ${t.pieStrokeWidth};
|
|
84
|
+
opacity : ${t.pieOpacity};
|
|
85
|
+
}
|
|
86
|
+
.pieOuterCircle{
|
|
87
|
+
stroke: ${t.pieOuterStrokeColor};
|
|
88
|
+
stroke-width: ${t.pieOuterStrokeWidth};
|
|
89
|
+
fill: none;
|
|
90
|
+
}
|
|
91
|
+
.pieTitleText {
|
|
92
|
+
text-anchor: middle;
|
|
93
|
+
font-size: ${t.pieTitleTextSize};
|
|
94
|
+
fill: ${t.pieTitleTextColor};
|
|
95
|
+
font-family: ${t.fontFamily};
|
|
96
|
+
}
|
|
97
|
+
.slice {
|
|
98
|
+
font-family: ${t.fontFamily};
|
|
99
|
+
fill: ${t.pieSectionTextColor};
|
|
100
|
+
font-size:${t.pieSectionTextSize};
|
|
101
|
+
// fill: white;
|
|
102
|
+
}
|
|
103
|
+
.legend text {
|
|
104
|
+
fill: ${t.pieLegendTextColor};
|
|
105
|
+
font-family: ${t.fontFamily};
|
|
106
|
+
font-size: ${t.pieLegendTextSize};
|
|
107
|
+
}
|
|
108
|
+
`, "getStyles"), kt = Et, Mt = /* @__PURE__ */ d((t) => {
|
|
109
|
+
const a = [...t.values()].reduce((s, g) => s + g, 0), f = [...t.entries()].map(([s, g]) => ({ label: s, value: g })).filter((s) => s.value / a * 100 >= 1);
|
|
110
|
+
return vt().value((s) => s.value).sort(null)(f);
|
|
111
|
+
}, "createPieArcs"), Rt = /* @__PURE__ */ d((t, a, f, S) => {
|
|
112
|
+
var P;
|
|
113
|
+
F.debug(`rendering pie chart
|
|
114
|
+
` + t);
|
|
115
|
+
const s = S.db, g = it(), l = st(s.getConfig(), g.pie), e = 40, n = 18, o = 4, p = 450, h = p, v = lt(a), c = v.append("g");
|
|
116
|
+
c.attr("transform", "translate(" + h / 2 + "," + p / 2 + ")");
|
|
117
|
+
const { themeVariables: i } = g;
|
|
118
|
+
let [$] = ot(i.pieOuterStrokeWidth);
|
|
119
|
+
$ ?? ($ = 2);
|
|
120
|
+
const w = l.textPosition, m = Math.min(h, p) / 2 - e, C = _().innerRadius(0).outerRadius(m), D = _().innerRadius(m * w).outerRadius(m * w);
|
|
121
|
+
c.append("circle").attr("cx", 0).attr("cy", 0).attr("r", m + $ / 2).attr("class", "pieOuterCircle");
|
|
122
|
+
const u = s.getSections(), y = Mt(u), A = [
|
|
123
|
+
i.pie1,
|
|
124
|
+
i.pie2,
|
|
125
|
+
i.pie3,
|
|
126
|
+
i.pie4,
|
|
127
|
+
i.pie5,
|
|
128
|
+
i.pie6,
|
|
129
|
+
i.pie7,
|
|
130
|
+
i.pie8,
|
|
131
|
+
i.pie9,
|
|
132
|
+
i.pie10,
|
|
133
|
+
i.pie11,
|
|
134
|
+
i.pie12
|
|
135
|
+
];
|
|
136
|
+
let b = 0;
|
|
137
|
+
u.forEach((r) => {
|
|
138
|
+
b += r;
|
|
139
|
+
});
|
|
140
|
+
const B = y.filter((r) => (r.data.value / b * 100).toFixed(0) !== "0"), E = ft(A).domain([
|
|
141
|
+
...u.keys()
|
|
142
|
+
]);
|
|
143
|
+
c.selectAll("mySlices").data(B).enter().append("path").attr("d", C).attr("fill", (r) => E(r.data.label)).attr("class", "pieCircle"), c.selectAll("mySlices").data(B).enter().append("text").text((r) => (r.data.value / b * 100).toFixed(0) + "%").attr("transform", (r) => "translate(" + D.centroid(r) + ")").style("text-anchor", "middle").attr("class", "slice");
|
|
144
|
+
const U = c.append("text").text(s.getDiagramTitle()).attr("x", 0).attr("y", -400 / 2).attr("class", "pieTitleText"), G = [...u.entries()].map(([r, M]) => ({
|
|
145
|
+
label: r,
|
|
146
|
+
value: M
|
|
147
|
+
})), k = c.selectAll(".legend").data(G).enter().append("g").attr("class", "legend").attr("transform", (r, M) => {
|
|
148
|
+
const I = n + o, Z = I * G.length / 2, q = 12 * n, H = M * I - Z;
|
|
149
|
+
return "translate(" + q + "," + H + ")";
|
|
150
|
+
});
|
|
151
|
+
k.append("rect").attr("width", n).attr("height", n).style("fill", (r) => E(r.label)).style("stroke", (r) => E(r.label)), k.append("text").attr("x", n + o).attr("y", n - o).text((r) => s.getShowData() ? `${r.label} [${r.value}]` : r.label);
|
|
152
|
+
const j = Math.max(
|
|
153
|
+
...k.selectAll("text").nodes().map((r) => (r == null ? void 0 : r.getBoundingClientRect().width) ?? 0)
|
|
154
|
+
), K = h + e + n + o + j, L = ((P = U.node()) == null ? void 0 : P.getBoundingClientRect().width) ?? 0, Q = h / 2 - L / 2, X = h / 2 + L / 2, N = Math.min(0, Q), O = Math.max(K, X) - N;
|
|
155
|
+
v.attr("viewBox", `${N} 0 ${O} ${p}`), ct(v, p, O, l.useMaxWidth);
|
|
156
|
+
}, "draw"), Ft = { draw: Rt }, Ot = {
|
|
157
|
+
parser: bt,
|
|
158
|
+
db: V,
|
|
159
|
+
renderer: Ft,
|
|
160
|
+
styles: kt
|
|
161
|
+
};
|
|
162
|
+
export {
|
|
163
|
+
Ot as diagram
|
|
164
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./mermaid.core-BzNKr-OJ.cjs"),$t=require("./linear-C3xSMJV8.cjs");var Et=function(){var t=e.__name(function(Y,l,o,g){for(o=o||{},g=Y.length;g--;o[Y[g]]=l);return o},"o"),s=[1,3],u=[1,4],h=[1,5],c=[1,6],p=[1,7],_=[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],b=[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],n=[55,56,57],k=[2,36],d=[1,37],y=[1,36],m=[1,38],T=[1,35],q=[1,43],f=[1,41],S=[1,45],M=[1,14],j=[1,23],pt=[1,18],_t=[1,19],ht=[1,20],At=[1,21],dt=[1,22],ut=[1,24],ft=[1,25],xt=[1,26],i=[1,27],zt=[1,28],Vt=[1,29],W=[1,32],U=[1,33],F=[1,34],P=[1,39],C=[1,40],v=[1,42],L=[1,44],O=[1,63],H=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],It=[1,66],wt=[1,67],Bt=[1,68],Rt=[1,69],Nt=[1,70],Wt=[1,71],Ut=[1,72],Qt=[1,73],Ot=[1,74],Ht=[1,75],Xt=[1,76],Mt=[1,77],I=[4,5,6,7,8,9,10,11,12,13,14,15,18],Z=[1,91],$=[1,92],J=[1,93],tt=[1,100],et=[1,94],at=[1,97],it=[1,95],nt=[1,96],st=[1,98],rt=[1,99],kt=[1,103],Yt=[10,55,56,57],R=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],Ft={trace:e.__name(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:e.__name(function(l,o,g,x,A,a,gt){var r=a.length-1;switch(A){case 23:this.$=a[r];break;case 24:this.$=a[r-1]+""+a[r];break;case 26:this.$=a[r-1]+a[r];break;case 27:this.$=[a[r].trim()];break;case 28:a[r-2].push(a[r].trim()),this.$=a[r-2];break;case 29:this.$=a[r-4],x.addClass(a[r-2],a[r]);break;case 37:this.$=[];break;case 42:this.$=a[r].trim(),x.setDiagramTitle(this.$);break;case 43:this.$=a[r].trim(),x.setAccTitle(this.$);break;case 44:case 45:this.$=a[r].trim(),x.setAccDescription(this.$);break;case 46:x.addSection(a[r].substr(8)),this.$=a[r].substr(8);break;case 47:x.addPoint(a[r-3],"",a[r-1],a[r],[]);break;case 48:x.addPoint(a[r-4],a[r-3],a[r-1],a[r],[]);break;case 49:x.addPoint(a[r-4],"",a[r-2],a[r-1],a[r]);break;case 50:x.addPoint(a[r-5],a[r-4],a[r-2],a[r-1],a[r]);break;case 51:x.setXAxisLeftText(a[r-2]),x.setXAxisRightText(a[r]);break;case 52:a[r-1].text+=" ⟶ ",x.setXAxisLeftText(a[r-1]);break;case 53:x.setXAxisLeftText(a[r]);break;case 54:x.setYAxisBottomText(a[r-2]),x.setYAxisTopText(a[r]);break;case 55:a[r-1].text+=" ⟶ ",x.setYAxisBottomText(a[r-1]);break;case 56:x.setYAxisBottomText(a[r]);break;case 57:x.setQuadrant1Text(a[r]);break;case 58:x.setQuadrant2Text(a[r]);break;case 59:x.setQuadrant3Text(a[r]);break;case 60:x.setQuadrant4Text(a[r]);break;case 64:this.$={text:a[r],type:"text"};break;case 65:this.$={text:a[r-1].text+""+a[r],type:a[r-1].type};break;case 66:this.$={text:a[r],type:"text"};break;case 67:this.$={text:a[r],type:"markdown"};break;case 68:this.$=a[r];break;case 69:this.$=a[r-1]+""+a[r];break}},"anonymous"),table:[{18:s,26:1,27:2,28:u,55:h,56:c,57:p},{1:[3]},{18:s,26:8,27:2,28:u,55:h,56:c,57:p},{18:s,26:9,27:2,28:u,55:h,56:c,57:p},t(_,[2,33],{29:10}),t(b,[2,61]),t(b,[2,62]),t(b,[2,63]),{1:[2,30]},{1:[2,31]},t(n,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:y,10:m,12:T,13:q,14:f,15:S,18:M,25:j,35:pt,37:_t,39:ht,41:At,42:dt,48:ut,50:ft,51:xt,52:i,53:zt,54:Vt,60:W,61:U,63:F,64:P,65:C,66:v,67:L}),t(_,[2,34]),{27:46,55:h,56:c,57:p},t(n,[2,37]),t(n,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:d,5:y,10:m,12:T,13:q,14:f,15:S,18:M,25:j,35:pt,37:_t,39:ht,41:At,42:dt,48:ut,50:ft,51:xt,52:i,53:zt,54:Vt,60:W,61:U,63:F,64:P,65:C,66:v,67:L}),t(n,[2,39]),t(n,[2,40]),t(n,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(n,[2,45]),t(n,[2,46]),{18:[1,51]},{4:d,5:y,10:m,12:T,13:q,14:f,15:S,43:52,58:31,60:W,61:U,63:F,64:P,65:C,66:v,67:L},{4:d,5:y,10:m,12:T,13:q,14:f,15:S,43:53,58:31,60:W,61:U,63:F,64:P,65:C,66:v,67:L},{4:d,5:y,10:m,12:T,13:q,14:f,15:S,43:54,58:31,60:W,61:U,63:F,64:P,65:C,66:v,67:L},{4:d,5:y,10:m,12:T,13:q,14:f,15:S,43:55,58:31,60:W,61:U,63:F,64:P,65:C,66:v,67:L},{4:d,5:y,10:m,12:T,13:q,14:f,15:S,43:56,58:31,60:W,61:U,63:F,64:P,65:C,66:v,67:L},{4:d,5:y,10:m,12:T,13:q,14:f,15:S,43:57,58:31,60:W,61:U,63:F,64:P,65:C,66:v,67:L},{4:d,5:y,8:O,10:m,12:T,13:q,14:f,15:S,18:H,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:C,66:v,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(_,[2,35]),t(n,[2,38]),t(n,[2,42]),t(n,[2,43]),t(n,[2,44]),{3:65,4:It,5:wt,6:Bt,7:Rt,8:Nt,9:Wt,10:Ut,11:Qt,12:Ot,13:Ht,14:Xt,15:Mt,21:64},t(n,[2,53],{59:60,58:61,4:d,5:y,8:O,10:m,12:T,13:q,14:f,15:S,18:H,49:[1,78],63:F,64:P,65:C,66:v,67:L}),t(n,[2,56],{59:60,58:61,4:d,5:y,8:O,10:m,12:T,13:q,14:f,15:S,18:H,49:[1,79],63:F,64:P,65:C,66:v,67:L}),t(n,[2,57],{59:60,58:61,4:d,5:y,8:O,10:m,12:T,13:q,14:f,15:S,18:H,63:F,64:P,65:C,66:v,67:L}),t(n,[2,58],{59:60,58:61,4:d,5:y,8:O,10:m,12:T,13:q,14:f,15:S,18:H,63:F,64:P,65:C,66:v,67:L}),t(n,[2,59],{59:60,58:61,4:d,5:y,8:O,10:m,12:T,13:q,14:f,15:S,18:H,63:F,64:P,65:C,66:v,67:L}),t(n,[2,60],{59:60,58:61,4:d,5:y,8:O,10:m,12:T,13:q,14:f,15:S,18:H,63:F,64:P,65:C,66:v,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:It,5:wt,6:Bt,7:Rt,8:Nt,9:Wt,10:Ut,11:Qt,12:Ot,13:Ht,14:Xt,15:Mt,18:[1,82]},t(I,[2,23]),t(I,[2,1]),t(I,[2,2]),t(I,[2,3]),t(I,[2,4]),t(I,[2,5]),t(I,[2,6]),t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,10]),t(I,[2,11]),t(I,[2,12]),t(n,[2,52],{58:31,43:84,4:d,5:y,10:m,12:T,13:q,14:f,15:S,60:W,61:U,63:F,64:P,65:C,66:v,67:L}),t(n,[2,55],{58:31,43:85,4:d,5:y,10:m,12:T,13:q,14:f,15:S,60:W,61:U,63:F,64:P,65:C,66:v,67:L}),{46:[1,86]},{45:[1,87]},{4:Z,5:$,6:J,8:tt,11:et,13:at,16:90,17:it,18:nt,19:st,20:rt,22:89,23:88},t(I,[2,24]),t(n,[2,51],{59:60,58:61,4:d,5:y,8:O,10:m,12:T,13:q,14:f,15:S,18:H,63:F,64:P,65:C,66:v,67:L}),t(n,[2,54],{59:60,58:61,4:d,5:y,8:O,10:m,12:T,13:q,14:f,15:S,18:H,63:F,64:P,65:C,66:v,67:L}),t(n,[2,47],{22:89,16:90,23:101,4:Z,5:$,6:J,8:tt,11:et,13:at,17:it,18:nt,19:st,20:rt}),{46:[1,102]},t(n,[2,29],{10:kt}),t(Yt,[2,27],{16:104,4:Z,5:$,6:J,8:tt,11:et,13:at,17:it,18:nt,19:st,20:rt}),t(R,[2,25]),t(R,[2,13]),t(R,[2,14]),t(R,[2,15]),t(R,[2,16]),t(R,[2,17]),t(R,[2,18]),t(R,[2,19]),t(R,[2,20]),t(R,[2,21]),t(R,[2,22]),t(n,[2,49],{10:kt}),t(n,[2,48],{22:89,16:90,23:105,4:Z,5:$,6:J,8:tt,11:et,13:at,17:it,18:nt,19:st,20:rt}),{4:Z,5:$,6:J,8:tt,11:et,13:at,16:90,17:it,18:nt,19:st,20:rt,22:106},t(R,[2,26]),t(n,[2,50],{10:kt}),t(Yt,[2,28],{16:104,4:Z,5:$,6:J,8:tt,11:et,13:at,17:it,18:nt,19:st,20:rt})],defaultActions:{8:[2,30],9:[2,31]},parseError:e.__name(function(l,o){if(o.recoverable)this.trace(l);else{var g=new Error(l);throw g.hash=o,g}},"parseError"),parse:e.__name(function(l){var o=this,g=[0],x=[],A=[null],a=[],gt=this.table,r="",mt=0,jt=0,ge=2,Gt=1,pe=a.slice.call(arguments,1),D=Object.create(this.lexer),G={yy:{}};for(var Pt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Pt)&&(G.yy[Pt]=this.yy[Pt]);D.setInput(l,G.yy),G.yy.lexer=D,G.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Ct=D.yylloc;a.push(Ct);var _e=D.options&&D.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ye(B){g.length=g.length-2*B,A.length=A.length-B,a.length=a.length-B}e.__name(ye,"popStack");function Kt(){var B;return B=x.pop()||D.lex()||Gt,typeof B!="number"&&(B instanceof Array&&(x=B,B=x.pop()),B=o.symbols_[B]||B),B}e.__name(Kt,"lex");for(var w,K,N,vt,lt={},Tt,X,Zt,qt;;){if(K=g[g.length-1],this.defaultActions[K]?N=this.defaultActions[K]:((w===null||typeof w>"u")&&(w=Kt()),N=gt[K]&>[K][w]),typeof N>"u"||!N.length||!N[0]){var Lt="";qt=[];for(Tt in gt[K])this.terminals_[Tt]&&Tt>ge&&qt.push("'"+this.terminals_[Tt]+"'");D.showPosition?Lt="Parse error on line "+(mt+1)+`:
|
|
2
|
+
`+D.showPosition()+`
|
|
3
|
+
Expecting `+qt.join(", ")+", got '"+(this.terminals_[w]||w)+"'":Lt="Parse error on line "+(mt+1)+": Unexpected "+(w==Gt?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(Lt,{text:D.match,token:this.terminals_[w]||w,line:D.yylineno,loc:Ct,expected:qt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+K+", token: "+w);switch(N[0]){case 1:g.push(w),A.push(D.yytext),a.push(D.yylloc),g.push(N[1]),w=null,jt=D.yyleng,r=D.yytext,mt=D.yylineno,Ct=D.yylloc;break;case 2:if(X=this.productions_[N[1]][1],lt.$=A[A.length-X],lt._$={first_line:a[a.length-(X||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(X||1)].first_column,last_column:a[a.length-1].last_column},_e&&(lt._$.range=[a[a.length-(X||1)].range[0],a[a.length-1].range[1]]),vt=this.performAction.apply(lt,[r,jt,mt,G.yy,N[1],A,a].concat(pe)),typeof vt<"u")return vt;X&&(g=g.slice(0,-1*X*2),A=A.slice(0,-1*X),a=a.slice(0,-1*X)),g.push(this.productions_[N[1]][0]),A.push(lt.$),a.push(lt._$),Zt=gt[g[g.length-2]][g[g.length-1]],g.push(Zt);break;case 3:return!0}}return!0},"parse")},xe=function(){var Y={EOF:1,parseError:e.__name(function(o,g){if(this.yy.parser)this.yy.parser.parseError(o,g);else throw new Error(o)},"parseError"),setInput:e.__name(function(l,o){return this.yy=o||this.yy||{},this._input=l,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:e.__name(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var o=l.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:e.__name(function(l){var o=l.length,g=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var x=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),g.length-1&&(this.yylineno-=g.length-1);var A=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:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:e.__name(function(){return this._more=!0,this},"more"),reject:e.__name(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:e.__name(function(l){this.unput(this.match.slice(l))},"less"),pastInput:e.__name(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e.__name(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e.__name(function(){var l=this.pastInput(),o=new Array(l.length+1).join("-");return l+this.upcomingInput()+`
|
|
5
|
+
`+o+"^"},"showPosition"),test_match:e.__name(function(l,o){var g,x,A;if(this.options.backtrack_lexer&&(A={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&&(A.yylloc.range=this.yylloc.range.slice(0))),x=l[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,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(l[0].length),this.matched+=l[0],g=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var a in A)this[a]=A[a];return!1}return!1},"test_match"),next:e.__name(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,o,g,x;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),a=0;a<A.length;a++)if(g=this._input.match(this.rules[A[a]]),g&&(!o||g[0].length>o[0].length)){if(o=g,x=a,this.options.backtrack_lexer){if(l=this.test_match(g,A[a]),l!==!1)return l;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(l=this.test_match(o,A[x]),l!==!1?l:!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:e.__name(function(){var o=this.next();return o||this.lex()},"lex"),begin:e.__name(function(o){this.conditionStack.push(o)},"begin"),popState:e.__name(function(){var o=this.conditionStack.length-1;return o>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:e.__name(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:e.__name(function(o){return o=this.conditionStack.length-1-Math.abs(o||0),o>=0?this.conditionStack[o]:"INITIAL"},"topState"),pushState:e.__name(function(o){this.begin(o)},"pushState"),stateStackSize:e.__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e.__name(function(o,g,x,A){switch(x){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}();Ft.lexer=xe;function yt(){this.yy={}}return e.__name(yt,"Parser"),yt.prototype=Ft,Ft.Parser=yt,new yt}();Et.parser=Et;var me=Et,V=e.getThemeVariables3(),ot,Te=(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(){var s,u,h,c,p,_,b,n,k,d,y,m,T,q,f,S,M,j;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((s=e.defaultConfig_default.quadrantChart)==null?void 0:s.chartWidth)||500,chartWidth:((u=e.defaultConfig_default.quadrantChart)==null?void 0:u.chartHeight)||500,titlePadding:((h=e.defaultConfig_default.quadrantChart)==null?void 0:h.titlePadding)||10,titleFontSize:((c=e.defaultConfig_default.quadrantChart)==null?void 0:c.titleFontSize)||20,quadrantPadding:((p=e.defaultConfig_default.quadrantChart)==null?void 0:p.quadrantPadding)||5,xAxisLabelPadding:((_=e.defaultConfig_default.quadrantChart)==null?void 0:_.xAxisLabelPadding)||5,yAxisLabelPadding:((b=e.defaultConfig_default.quadrantChart)==null?void 0:b.yAxisLabelPadding)||5,xAxisLabelFontSize:((n=e.defaultConfig_default.quadrantChart)==null?void 0:n.xAxisLabelFontSize)||16,yAxisLabelFontSize:((k=e.defaultConfig_default.quadrantChart)==null?void 0:k.yAxisLabelFontSize)||16,quadrantLabelFontSize:((d=e.defaultConfig_default.quadrantChart)==null?void 0:d.quadrantLabelFontSize)||16,quadrantTextTopPadding:((y=e.defaultConfig_default.quadrantChart)==null?void 0:y.quadrantTextTopPadding)||5,pointTextPadding:((m=e.defaultConfig_default.quadrantChart)==null?void 0:m.pointTextPadding)||5,pointLabelFontSize:((T=e.defaultConfig_default.quadrantChart)==null?void 0:T.pointLabelFontSize)||12,pointRadius:((q=e.defaultConfig_default.quadrantChart)==null?void 0:q.pointRadius)||5,xAxisPosition:((f=e.defaultConfig_default.quadrantChart)==null?void 0:f.xAxisPosition)||"top",yAxisPosition:((S=e.defaultConfig_default.quadrantChart)==null?void 0:S.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((M=e.defaultConfig_default.quadrantChart)==null?void 0:M.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((j=e.defaultConfig_default.quadrantChart)==null?void 0:j.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:V.quadrant1Fill,quadrant2Fill:V.quadrant2Fill,quadrant3Fill:V.quadrant3Fill,quadrant4Fill:V.quadrant4Fill,quadrant1TextFill:V.quadrant1TextFill,quadrant2TextFill:V.quadrant2TextFill,quadrant3TextFill:V.quadrant3TextFill,quadrant4TextFill:V.quadrant4TextFill,quadrantPointFill:V.quadrantPointFill,quadrantPointTextFill:V.quadrantPointTextFill,quadrantXAxisTextFill:V.quadrantXAxisTextFill,quadrantYAxisTextFill:V.quadrantYAxisTextFill,quadrantTitleFill:V.quadrantTitleFill,quadrantInternalBorderStrokeFill:V.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:V.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,e.log.info("clear called")}setData(s){this.data={...this.data,...s}}addPoints(s){this.data.points=[...s,...this.data.points]}addClass(s,u){this.classes.set(s,u)}setConfig(s){e.log.trace("setConfig called with: ",s),this.config={...this.config,...s}}setThemeConfig(s){e.log.trace("setThemeConfig called with: ",s),this.themeConfig={...this.themeConfig,...s}}calculateSpace(s,u,h,c){const p=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,_={top:s==="top"&&u?p:0,bottom:s==="bottom"&&u?p:0},b=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,n={left:this.config.yAxisPosition==="left"&&h?b:0,right:this.config.yAxisPosition==="right"&&h?b:0},k=this.config.titleFontSize+this.config.titlePadding*2,d={top:c?k:0},y=this.config.quadrantPadding+n.left,m=this.config.quadrantPadding+_.top+d.top,T=this.config.chartWidth-this.config.quadrantPadding*2-n.left-n.right,q=this.config.chartHeight-this.config.quadrantPadding*2-_.top-_.bottom-d.top,f=T/2,S=q/2;return{xAxisSpace:_,yAxisSpace:n,titleSpace:d,quadrantSpace:{quadrantLeft:y,quadrantTop:m,quadrantWidth:T,quadrantHalfWidth:f,quadrantHeight:q,quadrantHalfHeight:S}}}getAxisLabels(s,u,h,c){const{quadrantSpace:p,titleSpace:_}=c,{quadrantHalfHeight:b,quadrantHeight:n,quadrantLeft:k,quadrantHalfWidth:d,quadrantTop:y,quadrantWidth:m}=p,T=!!this.data.xAxisRightText,q=!!this.data.yAxisTopText,f=[];return this.data.xAxisLeftText&&u&&f.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:k+(T?d/2:0),y:s==="top"?this.config.xAxisLabelPadding+_.top:this.config.xAxisLabelPadding+y+n+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:T?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&u&&f.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:k+d+(T?d/2:0),y:s==="top"?this.config.xAxisLabelPadding+_.top:this.config.xAxisLabelPadding+y+n+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:T?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&h&&f.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+k+m+this.config.quadrantPadding,y:y+n-(q?b/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:q?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&h&&f.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+k+m+this.config.quadrantPadding,y:y+b-(q?b/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:q?"center":"left",horizontalPos:"top",rotation:-90}),f}getQuadrants(s){const{quadrantSpace:u}=s,{quadrantHalfHeight:h,quadrantLeft:c,quadrantHalfWidth:p,quadrantTop:_}=u,b=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:c+p,y:_,width:p,height:h,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:c,y:_,width:p,height:h,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:c,y:_+h,width:p,height:h,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:c+p,y:_+h,width:p,height:h,fill:this.themeConfig.quadrant4Fill}];for(const n of b)n.text.x=n.x+n.width/2,this.data.points.length===0?(n.text.y=n.y+n.height/2,n.text.horizontalPos="middle"):(n.text.y=n.y+this.config.quadrantTextTopPadding,n.text.horizontalPos="top");return b}getQuadrantPoints(s){const{quadrantSpace:u}=s,{quadrantHeight:h,quadrantLeft:c,quadrantTop:p,quadrantWidth:_}=u,b=$t.linear().domain([0,1]).range([c,_+c]),n=$t.linear().domain([0,1]).range([h+p,p]);return this.data.points.map(d=>{const y=this.classes.get(d.className);return y&&(d={...y,...d}),{x:b(d.x),y:n(d.y),fill:d.color??this.themeConfig.quadrantPointFill,radius:d.radius??this.config.pointRadius,text:{text:d.text,fill:this.themeConfig.quadrantPointTextFill,x:b(d.x),y:n(d.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:d.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:d.strokeWidth??"0px"}})}getBorders(s){const u=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:h}=s,{quadrantHalfHeight:c,quadrantHeight:p,quadrantLeft:_,quadrantHalfWidth:b,quadrantTop:n,quadrantWidth:k}=h;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:_-u,y1:n,x2:_+k+u,y2:n},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:_+k,y1:n+u,x2:_+k,y2:n+p-u},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:_-u,y1:n+p,x2:_+k+u,y2:n+p},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:_,y1:n+u,x2:_,y2:n+p-u},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:_+b,y1:n+u,x2:_+b,y2:n+p-u},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:_+u,y1:n+c,x2:_+k-u,y2:n+c}]}getTitle(s){if(s)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 s=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),u=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),h=this.config.showTitle&&!!this.data.titleText,c=this.data.points.length>0?"bottom":this.config.xAxisPosition,p=this.calculateSpace(c,s,u,h);return{points:this.getQuadrantPoints(p),quadrants:this.getQuadrants(p),axisLabels:this.getAxisLabels(c,s,u,p),borderLines:this.getBorders(p),title:this.getTitle(h)}}},e.__name(ot,"QuadrantBuilder"),ot),ct,bt=(ct=class extends Error{constructor(s,u,h){super(`value for ${s} ${u} is invalid, please use a valid ${h}`),this.name="InvalidStyleError"}},e.__name(ct,"InvalidStyleError"),ct);function Dt(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}e.__name(Dt,"validateHexCode");function Jt(t){return!/^\d+$/.test(t)}e.__name(Jt,"validateNumber");function te(t){return!/^\d+px$/.test(t)}e.__name(te,"validateSizeInPixels");var qe=e.getConfig2();function Q(t){return e.sanitizeText(t.trim(),qe)}e.__name(Q,"textSanitizer");var z=new Te;function ee(t){z.setData({quadrant1Text:Q(t.text)})}e.__name(ee,"setQuadrant1Text");function ae(t){z.setData({quadrant2Text:Q(t.text)})}e.__name(ae,"setQuadrant2Text");function ie(t){z.setData({quadrant3Text:Q(t.text)})}e.__name(ie,"setQuadrant3Text");function ne(t){z.setData({quadrant4Text:Q(t.text)})}e.__name(ne,"setQuadrant4Text");function se(t){z.setData({xAxisLeftText:Q(t.text)})}e.__name(se,"setXAxisLeftText");function re(t){z.setData({xAxisRightText:Q(t.text)})}e.__name(re,"setXAxisRightText");function le(t){z.setData({yAxisTopText:Q(t.text)})}e.__name(le,"setYAxisTopText");function oe(t){z.setData({yAxisBottomText:Q(t.text)})}e.__name(oe,"setYAxisBottomText");function St(t){const s={};for(const u of t){const[h,c]=u.trim().split(/\s*:\s*/);if(h==="radius"){if(Jt(c))throw new bt(h,c,"number");s.radius=parseInt(c)}else if(h==="color"){if(Dt(c))throw new bt(h,c,"hex code");s.color=c}else if(h==="stroke-color"){if(Dt(c))throw new bt(h,c,"hex code");s.strokeColor=c}else if(h==="stroke-width"){if(te(c))throw new bt(h,c,"number of pixels (eg. 10px)");s.strokeWidth=c}else throw new Error(`style named ${h} is not supported.`)}return s}e.__name(St,"parseStyles");function ce(t,s,u,h,c){const p=St(c);z.addPoints([{x:u,y:h,text:Q(t.text),className:s,...p}])}e.__name(ce,"addPoint");function he(t,s){z.addClass(t,St(s))}e.__name(he,"addClass");function de(t){z.setConfig({chartWidth:t})}e.__name(de,"setWidth");function ue(t){z.setConfig({chartHeight:t})}e.__name(ue,"setHeight");function fe(){const t=e.getConfig2(),{themeVariables:s,quadrantChart:u}=t;return u&&z.setConfig(u),z.setThemeConfig({quadrant1Fill:s.quadrant1Fill,quadrant2Fill:s.quadrant2Fill,quadrant3Fill:s.quadrant3Fill,quadrant4Fill:s.quadrant4Fill,quadrant1TextFill:s.quadrant1TextFill,quadrant2TextFill:s.quadrant2TextFill,quadrant3TextFill:s.quadrant3TextFill,quadrant4TextFill:s.quadrant4TextFill,quadrantPointFill:s.quadrantPointFill,quadrantPointTextFill:s.quadrantPointTextFill,quadrantXAxisTextFill:s.quadrantXAxisTextFill,quadrantYAxisTextFill:s.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:s.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:s.quadrantInternalBorderStrokeFill,quadrantTitleFill:s.quadrantTitleFill}),z.setData({titleText:e.getDiagramTitle()}),z.build()}e.__name(fe,"getQuadrantData");var be=e.__name(function(){z.clear(),e.clear()},"clear"),Se={setWidth:de,setHeight:ue,setQuadrant1Text:ee,setQuadrant2Text:ae,setQuadrant3Text:ie,setQuadrant4Text:ne,setXAxisLeftText:se,setXAxisRightText:re,setYAxisTopText:le,setYAxisBottomText:oe,parseStyles:St,addPoint:ce,addClass:he,getQuadrantData:fe,clear:be,setAccTitle:e.setAccTitle,getAccTitle:e.getAccTitle,setDiagramTitle:e.setDiagramTitle,getDiagramTitle:e.getDiagramTitle,getAccDescription:e.getAccDescription,setAccDescription:e.setAccDescription},Ae=e.__name((t,s,u,h)=>{var ut,ft,xt;function c(i){return i==="top"?"hanging":"middle"}e.__name(c,"getDominantBaseLine");function p(i){return i==="left"?"start":"middle"}e.__name(p,"getTextAnchor");function _(i){return`translate(${i.x}, ${i.y}) rotate(${i.rotation||0})`}e.__name(_,"getTransformation");const b=e.getConfig2();e.log.debug(`Rendering quadrant chart
|
|
7
|
+
`+t);const n=b.securityLevel;let k;n==="sandbox"&&(k=e.select("#i"+s));const y=(n==="sandbox"?e.select(k.nodes()[0].contentDocument.body):e.select("body")).select(`[id="${s}"]`),m=y.append("g").attr("class","main"),T=((ut=b.quadrantChart)==null?void 0:ut.chartWidth)??500,q=((ft=b.quadrantChart)==null?void 0:ft.chartHeight)??500;e.configureSvgSize(y,q,T,((xt=b.quadrantChart)==null?void 0:xt.useMaxWidth)??!0),y.attr("viewBox","0 0 "+T+" "+q),h.db.setHeight(q),h.db.setWidth(T);const f=h.db.getQuadrantData(),S=m.append("g").attr("class","quadrants"),M=m.append("g").attr("class","border"),j=m.append("g").attr("class","data-points"),pt=m.append("g").attr("class","labels"),_t=m.append("g").attr("class","title");f.title&&_t.append("text").attr("x",0).attr("y",0).attr("fill",f.title.fill).attr("font-size",f.title.fontSize).attr("dominant-baseline",c(f.title.horizontalPos)).attr("text-anchor",p(f.title.verticalPos)).attr("transform",_(f.title)).text(f.title.text),f.borderLines&&M.selectAll("line").data(f.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 ht=S.selectAll("g.quadrant").data(f.quadrants).enter().append("g").attr("class","quadrant");ht.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),ht.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=>c(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>_(i.text)).text(i=>i.text.text),pt.selectAll("g.label").data(f.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=>c(i.horizontalPos)).attr("text-anchor",i=>p(i.verticalPos)).attr("transform",i=>_(i));const dt=j.selectAll("g.data-point").data(f.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=>c(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>_(i.text))},"draw"),ke={draw:Ae},Fe={parser:me,db:Se,renderer:ke,styles:e.__name(()=>"","styles")};exports.diagram=Fe;
|