@openbkn/workshop 0.2.2-rc.5 → 0.2.2
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 +83 -13
- package/component.d.ts +10 -0
- package/dist/ActionConfirm-DJ91X3ml.js +236 -0
- package/dist/ActionFailure-ZgPt_3B-.js +37 -0
- package/dist/AgentChat-CRYai8ge.js +1062 -0
- package/dist/AppFormModal-D73ucaHK.js +4282 -0
- package/dist/AppListPage-D87piiOw.js +1364 -0
- package/dist/AskDrawer-BUMYsRnt.js +38 -0
- package/dist/ComputedView-CgYrDbx1.js +3221 -0
- package/dist/ConclusionApply-sjGfoEBY.js +153 -0
- package/dist/CypherEditor-lus6FA5L.js +485 -0
- package/dist/LandingList-6JI6864C.js +230 -0
- package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
- package/dist/ModelTrial-ClHFGTpQ.js +359 -0
- package/dist/PageRenderer-DBd_g6mN.js +85480 -0
- package/dist/README-DjRyTQSR.js +76 -0
- package/dist/ScenarioApply-DtW_hh47.js +590 -0
- package/dist/SimulateForm-C-i08Jjd.js +153 -0
- package/dist/Subgraph-CnrkH9AN.js +32586 -0
- package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
- package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
- package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
- package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
- package/dist/actionButton-DA5CNEzx.js +94 -0
- package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
- package/dist/agentChat-EoDznd58.js +116 -0
- package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
- package/dist/alertList-DqditwM8.js +84 -0
- package/dist/alertList.en-US-BAXAgltP.js +84 -0
- package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
- package/dist/asOfSlider-QPvHWUMV.js +83 -0
- package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
- package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
- package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
- package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
- package/dist/channel-B034hcOF.js +5 -0
- package/dist/china-C6m7zXIv.js +9 -0
- package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
- package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
- package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
- package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
- package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
- package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
- package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
- package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
- package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
- package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
- package/dist/component.d-DFoMKuUv.js +179 -0
- package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
- package/dist/customComponents-DasaZ6pq.js +4 -0
- package/dist/customComponents.en-US-CkabuCXg.js +79 -0
- package/dist/customParseFormat-C0uLEpdq.js +182 -0
- package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
- package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
- package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
- package/dist/d3-scale-DA8IHmf0.js +1841 -0
- package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
- package/dist/dateRange-BbkLMg8L.js +79 -0
- package/dist/dateRange.en-US-CV12Q02G.js +79 -0
- package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
- package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
- package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
- package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
- package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
- package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
- package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
- package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
- package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
- package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
- package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
- package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
- package/dist/eventList-CnsAwfDS.js +115 -0
- package/dist/eventList.en-US-Cof3rCLq.js +115 -0
- package/dist/eventReport-XS-HegnH.js +76 -0
- package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
- package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
- package/dist/ganttChart-DEeSvTJA.js +77 -0
- package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
- package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
- package/dist/generateCypher-Ch9_lQa6.js +399 -0
- package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
- package/dist/graph-CKJmgLki.js +1541 -0
- package/dist/index-BA-GzCXt.js +441 -0
- package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
- package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
- package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
- package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
- package/dist/katex-BsrBVQKd.js +11314 -0
- package/dist/manifest-BjV1PJ6u.js +41 -0
- package/dist/mermaid.core-yQghUlIz.js +17642 -0
- package/dist/metricCards-CSb-_cT2.js +104 -0
- package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
- package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
- package/dist/modelTrial-Bvb-RhGt.js +137 -0
- package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
- package/dist/models-DekiCOuZ.js +6 -0
- package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
- package/dist/object-metric.service-flZgBMRX.js +233 -0
- package/dist/objectDetail-SQUbp4Py.js +117 -0
- package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
- package/dist/objectList-D99wPtJH.js +97 -0
- package/dist/objectList.en-US-PBBNyVLW.js +97 -0
- package/dist/objectTable-0jsFFMN3.js +127 -0
- package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
- package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
- package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
- package/dist/pivotTable-CHmQw18-.js +102 -0
- package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
- package/dist/prompt-DYrjlEFr.js +373 -0
- package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
- package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
- package/dist/regionMap-Cme-JyV_.js +128 -0
- package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
- package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
- package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
- package/dist/scenarioBar-BV43p7n-.js +122 -0
- package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
- package/dist/scheduleGantt-CTYO-zYP.js +180 -0
- package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
- package/dist/searchBox-Ca7w0f_6.js +67 -0
- package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
- package/dist/segmentedFilter-MhjVcWo0.js +80 -0
- package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
- package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
- package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
- package/dist/stageChain-BxBafwjD.js +74 -0
- package/dist/stageChain.en-US-CP0G27n8.js +74 -0
- package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
- package/dist/subgraph-7n4SwliR.js +71 -0
- package/dist/subgraph.en-US-BNvY18IW.js +71 -0
- package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
- package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
- package/dist/taskInbox-DGWYeI2b.js +118 -0
- package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
- package/dist/text-BqSVQKS6.js +78 -0
- package/dist/text.en-US-BhAxy_LE.js +78 -0
- package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
- package/dist/trendChart-BjEeRS5_.js +135 -0
- package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
- package/dist/useLabData-Df-jEHKs.js +20470 -0
- package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
- package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
- package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
- package/dist/workshop-app-DnHNjBqy.js +86038 -0
- package/dist/workshop-app.css +1 -0
- package/dist/workshop-app.js +4 -0
- package/dist/world-Djau1JyJ.js +9 -0
- package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
- package/dist-cli/workshop.js +341 -218
- package/example/host.js +109 -0
- package/example/index.html +93 -0
- package/example/server.mjs +237 -0
- package/index.d.ts +48 -0
- package/lib/validate.js +47 -1
- package/package.json +17 -5
- package/runtime/frame-runtime.js +13 -1
- package/workshop-component.js +32 -12
- package/workshop.js +2 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import { p as re } from "./chunk-JWPE2WC7-CDBrSjU7.js";
|
|
2
|
+
import { x as oe, v as se, s as de, g as le, a as ce, b as me, _ as o, l as g, c as $, k as ue, P as xe, D as fe, Q as ge, O as B, R as he, j as P, w as S, ah as pe } from "./mermaid.core-yQghUlIz.js";
|
|
3
|
+
import { p as be, i as ve } from "./cynefin-EF2NZ3EQ-D7MVnMHu.js";
|
|
4
|
+
var D = "position frame", N = "frame positioned", k = "position relation", T = "relation positioned", we = /* @__PURE__ */ o(function(e) {
|
|
5
|
+
g.debug("options str", e);
|
|
6
|
+
}, "setOptions"), ye = /* @__PURE__ */ o(function() {
|
|
7
|
+
return {};
|
|
8
|
+
}, "getOptions"), Pe = /* @__PURE__ */ o(function() {
|
|
9
|
+
C(), fe();
|
|
10
|
+
}, "clear");
|
|
11
|
+
function C() {
|
|
12
|
+
w = {};
|
|
13
|
+
}
|
|
14
|
+
o(C, "reset");
|
|
15
|
+
var Se = he.eventmodeling, ke = /* @__PURE__ */ o(() => ge({
|
|
16
|
+
...Se,
|
|
17
|
+
...B().eventmodeling
|
|
18
|
+
}), "getConfig"), w = {};
|
|
19
|
+
function O() {
|
|
20
|
+
let e = Fe;
|
|
21
|
+
const { ast: n } = w, t = E();
|
|
22
|
+
if (!n)
|
|
23
|
+
throw new Error("No data for EventModel");
|
|
24
|
+
return n.frames.forEach((i, a) => {
|
|
25
|
+
const r = G(i, n.dataEntities, t);
|
|
26
|
+
e = v(e, {
|
|
27
|
+
$kind: D,
|
|
28
|
+
index: a,
|
|
29
|
+
frame: i,
|
|
30
|
+
textProps: r
|
|
31
|
+
});
|
|
32
|
+
let d;
|
|
33
|
+
K(i) ? (g.debug("source frame", i.sourceFrames), d = n.frames.filter((l) => i.sourceFrames.some((c) => c.$refText === l.name)), d.forEach((l) => {
|
|
34
|
+
e = v(e, {
|
|
35
|
+
$kind: k,
|
|
36
|
+
index: a,
|
|
37
|
+
frame: i,
|
|
38
|
+
sourceFrame: l
|
|
39
|
+
});
|
|
40
|
+
})) : e = v(e, {
|
|
41
|
+
$kind: k,
|
|
42
|
+
index: a,
|
|
43
|
+
frame: i
|
|
44
|
+
});
|
|
45
|
+
}), e = {
|
|
46
|
+
...e,
|
|
47
|
+
sortedSwimlanesArray: A(e.swimlanes)
|
|
48
|
+
}, e;
|
|
49
|
+
}
|
|
50
|
+
o(O, "getState");
|
|
51
|
+
function I(e) {
|
|
52
|
+
w.ast = void 0;
|
|
53
|
+
const n = /* @__PURE__ */ new Set();
|
|
54
|
+
for (const t of e.frames) {
|
|
55
|
+
if (n.has(t.name)) {
|
|
56
|
+
const i = t.$cstNode?.range.start.line, a = i === void 0 ? "" : ` on line ${i + 1}`;
|
|
57
|
+
throw new Error(`Duplicate event modeling frame ID "${t.name}"${a}`);
|
|
58
|
+
}
|
|
59
|
+
n.add(t.name);
|
|
60
|
+
}
|
|
61
|
+
w.ast = e;
|
|
62
|
+
}
|
|
63
|
+
o(I, "setAst");
|
|
64
|
+
var s = {
|
|
65
|
+
swimlaneMinHeight: 70,
|
|
66
|
+
swimlanePadding: 15,
|
|
67
|
+
swimlaneGap: 10,
|
|
68
|
+
boxPadding: 10,
|
|
69
|
+
boxOverlap: 90,
|
|
70
|
+
boxDefaultY: 0,
|
|
71
|
+
boxMinWidth: 80,
|
|
72
|
+
boxMaxWidth: 450,
|
|
73
|
+
boxMinHeight: 80,
|
|
74
|
+
boxMaxHeight: 750,
|
|
75
|
+
contentStartX: 250,
|
|
76
|
+
textMaxWidth: 430,
|
|
77
|
+
boxTextFontWeight: "bold",
|
|
78
|
+
boxTextPadding: 10,
|
|
79
|
+
swimlaneTextFontWeight: "bold",
|
|
80
|
+
labelUiAutomation: "UI/Automation",
|
|
81
|
+
labelUiAutomationPrefix: "UI/A: ",
|
|
82
|
+
labelCommandReadModel: "Command/Read Model",
|
|
83
|
+
labelCommandReadModelPrefix: "C/RM: ",
|
|
84
|
+
labelEvents: "Events",
|
|
85
|
+
labelEventsPrefix: "Stream: "
|
|
86
|
+
};
|
|
87
|
+
function E() {
|
|
88
|
+
return s;
|
|
89
|
+
}
|
|
90
|
+
o(E, "getDiagramProps");
|
|
91
|
+
var Fe = {
|
|
92
|
+
boxes: [],
|
|
93
|
+
swimlanes: {},
|
|
94
|
+
relations: [],
|
|
95
|
+
maxR: 0,
|
|
96
|
+
sortedSwimlanesArray: []
|
|
97
|
+
};
|
|
98
|
+
function W(e) {
|
|
99
|
+
const n = e.split(".");
|
|
100
|
+
if (n.length === 2)
|
|
101
|
+
return n[0];
|
|
102
|
+
}
|
|
103
|
+
o(W, "extractNamespace");
|
|
104
|
+
function H(e) {
|
|
105
|
+
const n = e.split(".");
|
|
106
|
+
return n.length === 2 ? n[1] : e;
|
|
107
|
+
}
|
|
108
|
+
o(H, "extractName");
|
|
109
|
+
function U(e, n) {
|
|
110
|
+
if (!(!n || n.length === 0))
|
|
111
|
+
return Object.values(e).find((t) => t.namespace === n);
|
|
112
|
+
}
|
|
113
|
+
o(U, "findSwimlaneByNamespace");
|
|
114
|
+
function b(e, n, t) {
|
|
115
|
+
return Math.max(
|
|
116
|
+
n,
|
|
117
|
+
...Object.keys(e).filter((i) => {
|
|
118
|
+
const a = Number.parseInt(i);
|
|
119
|
+
return a > n && a < t;
|
|
120
|
+
}).map((i) => Number.parseInt(i))
|
|
121
|
+
) + 1;
|
|
122
|
+
}
|
|
123
|
+
o(b, "findNextAvailableIndex");
|
|
124
|
+
function _(e, n) {
|
|
125
|
+
const t = W(e.entityIdentifier), i = U(n, t);
|
|
126
|
+
switch (e.modelEntityType) {
|
|
127
|
+
case "ui":
|
|
128
|
+
case "pcr":
|
|
129
|
+
case "processor":
|
|
130
|
+
return i ? {
|
|
131
|
+
index: i.index,
|
|
132
|
+
label: i.namespace || s.labelUiAutomation
|
|
133
|
+
} : t ? {
|
|
134
|
+
index: b(n, 0, 100),
|
|
135
|
+
label: s.labelUiAutomationPrefix + t
|
|
136
|
+
} : { index: 0, label: s.labelUiAutomation };
|
|
137
|
+
case "rmo":
|
|
138
|
+
case "readmodel":
|
|
139
|
+
case "cmd":
|
|
140
|
+
case "command":
|
|
141
|
+
return i ? {
|
|
142
|
+
index: i.index,
|
|
143
|
+
label: i.namespace || s.labelCommandReadModel
|
|
144
|
+
} : t ? {
|
|
145
|
+
index: b(n, 100, 200),
|
|
146
|
+
label: s.labelCommandReadModelPrefix + t
|
|
147
|
+
} : { index: 100, label: s.labelCommandReadModel };
|
|
148
|
+
default:
|
|
149
|
+
return i ? {
|
|
150
|
+
index: i.index,
|
|
151
|
+
label: i.namespace || s.labelEvents
|
|
152
|
+
} : t ? {
|
|
153
|
+
index: b(n, 200, 300),
|
|
154
|
+
label: s.labelEventsPrefix + t
|
|
155
|
+
} : { index: 200, label: s.labelEvents };
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
o(_, "calculateSwimlaneProps");
|
|
159
|
+
function L(e) {
|
|
160
|
+
const { themeVariables: n } = B();
|
|
161
|
+
switch (e.modelEntityType) {
|
|
162
|
+
case "ui":
|
|
163
|
+
return {
|
|
164
|
+
fill: n.emUiFill ?? "white",
|
|
165
|
+
stroke: n.emUiStroke ?? "#dbdada"
|
|
166
|
+
};
|
|
167
|
+
case "pcr":
|
|
168
|
+
case "processor":
|
|
169
|
+
return {
|
|
170
|
+
fill: n.emProcessorFill ?? "#edb3f6",
|
|
171
|
+
stroke: n.emProcessorStroke ?? "#b88cbf"
|
|
172
|
+
};
|
|
173
|
+
case "rmo":
|
|
174
|
+
case "readmodel":
|
|
175
|
+
return {
|
|
176
|
+
fill: n.emReadModelFill ?? "#d3f1a2",
|
|
177
|
+
stroke: n.emReadModelStroke ?? "#a3b732"
|
|
178
|
+
};
|
|
179
|
+
case "cmd":
|
|
180
|
+
case "command":
|
|
181
|
+
return {
|
|
182
|
+
fill: n.emCommandFill ?? "#bcd6fe",
|
|
183
|
+
stroke: n.emCommandStroke ?? "#679ac3"
|
|
184
|
+
};
|
|
185
|
+
case "evt":
|
|
186
|
+
case "event":
|
|
187
|
+
return {
|
|
188
|
+
fill: n.emEventFill ?? "#ffb778",
|
|
189
|
+
stroke: n.emEventStroke ?? "#c19a0f"
|
|
190
|
+
};
|
|
191
|
+
default:
|
|
192
|
+
return {
|
|
193
|
+
fill: "red",
|
|
194
|
+
stroke: "black"
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
o(L, "calculateEntityVisualProps");
|
|
199
|
+
function G(e, n, t) {
|
|
200
|
+
const i = B(), a = P(H(e.entityIdentifier) ?? "", i);
|
|
201
|
+
let r;
|
|
202
|
+
const d = {
|
|
203
|
+
fontSize: 16,
|
|
204
|
+
fontWeight: 700,
|
|
205
|
+
fontFamily: '"trebuchet ms", verdana, arial, sans-serif',
|
|
206
|
+
joinWith: "<br/>"
|
|
207
|
+
};
|
|
208
|
+
let c = `<b>${S(a, t.textMaxWidth, d)}</b>`;
|
|
209
|
+
if (e.dataInlineValue && (r = e.dataInlineValue, r = r.substring(r.indexOf("{") + 1), r = r.substring(0, r.lastIndexOf("}") - 1), r = P(r, i), r = S(r, t.textMaxWidth, d), r = r.replaceAll(" ", " ")), e.dataReference) {
|
|
210
|
+
const p = n.find(
|
|
211
|
+
(y) => y.name === e.dataReference?.$refText
|
|
212
|
+
);
|
|
213
|
+
p && (r = p.dataBlockValue, r = r.substring(r.indexOf(`{
|
|
214
|
+
`) + 2), r = r.substring(0, r.lastIndexOf("}") - 1), r = P(r, i), r = S(r, t.textMaxWidth, d), r = r.replaceAll(" ", " "), r += "<br/>");
|
|
215
|
+
}
|
|
216
|
+
const m = r !== void 0;
|
|
217
|
+
m && (c += `<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);
|
|
218
|
+
const x = {
|
|
219
|
+
fontSize: d.fontSize,
|
|
220
|
+
fontWeight: d.fontWeight,
|
|
221
|
+
fontFamily: d.fontFamily
|
|
222
|
+
}, u = pe(c, x), h = m ? u.width / 3 : u.width, f = {
|
|
223
|
+
content: c,
|
|
224
|
+
width: h,
|
|
225
|
+
height: u.height
|
|
226
|
+
};
|
|
227
|
+
return g.debug(`[${e.name}] ${e.entityIdentifier} text`, f), f;
|
|
228
|
+
}
|
|
229
|
+
o(G, "calculateTextProps");
|
|
230
|
+
function V(e, n) {
|
|
231
|
+
const t = n, i = L(t.frame), a = {
|
|
232
|
+
width: t.textProps.width + 2 * s.boxTextPadding,
|
|
233
|
+
height: t.textProps.height + 2 * s.boxTextPadding
|
|
234
|
+
};
|
|
235
|
+
return [{
|
|
236
|
+
$kind: N,
|
|
237
|
+
frame: t.frame,
|
|
238
|
+
index: t.index,
|
|
239
|
+
visual: i,
|
|
240
|
+
dimension: a,
|
|
241
|
+
textProps: t.textProps
|
|
242
|
+
}];
|
|
243
|
+
}
|
|
244
|
+
o(V, "decidePositionFrame");
|
|
245
|
+
function X(e, n, t) {
|
|
246
|
+
return n === void 0 ? s.contentStartX : n.index === e.index && e.r ? e.r + s.boxPadding : t === void 0 ? s.contentStartX : t.r - s.boxOverlap + s.boxPadding;
|
|
247
|
+
}
|
|
248
|
+
o(X, "calculateX");
|
|
249
|
+
function j(e, n) {
|
|
250
|
+
const t = [...e.map((i) => i.r), n];
|
|
251
|
+
return Math.max(...t);
|
|
252
|
+
}
|
|
253
|
+
o(j, "calculateMaxRight");
|
|
254
|
+
function A(e) {
|
|
255
|
+
return Object.values(e).sort((n, t) => n.index - t.index);
|
|
256
|
+
}
|
|
257
|
+
o(A, "sortedSwimlanesArray");
|
|
258
|
+
function Y(e, n) {
|
|
259
|
+
const t = n, i = _(t.frame, e.swimlanes);
|
|
260
|
+
let a;
|
|
261
|
+
i.index in e.swimlanes ? a = e.swimlanes[i.index] : a = {
|
|
262
|
+
index: i.index,
|
|
263
|
+
label: i.label,
|
|
264
|
+
r: 0,
|
|
265
|
+
y: i.index * s.swimlaneMinHeight + s.swimlaneGap,
|
|
266
|
+
height: s.swimlaneMinHeight,
|
|
267
|
+
maxHeight: s.swimlaneMinHeight
|
|
268
|
+
};
|
|
269
|
+
const r = e.boxes.length > 0 ? e.boxes[e.boxes.length - 1] : void 0, d = e.previousSwimlaneNumber !== void 0 ? e.swimlanes[e.previousSwimlaneNumber] : void 0, l = {
|
|
270
|
+
width: Math.max(
|
|
271
|
+
s.boxMinWidth,
|
|
272
|
+
Math.min(s.boxMaxWidth, t.dimension.width)
|
|
273
|
+
) + 2 * s.boxPadding,
|
|
274
|
+
height: Math.max(
|
|
275
|
+
s.boxMinHeight,
|
|
276
|
+
Math.min(s.boxMaxHeight, t.dimension.height)
|
|
277
|
+
) + 2 * s.boxPadding
|
|
278
|
+
}, c = X(a, d, r), m = c + l.width + s.boxPadding, x = j(Object.values(e.swimlanes), m);
|
|
279
|
+
a.r = c + l.width, a.maxHeight = Math.max(a.maxHeight, l.height), a.height = Math.max(s.swimlaneMinHeight, a.maxHeight) + 2 * s.swimlanePadding;
|
|
280
|
+
const u = {
|
|
281
|
+
x: c,
|
|
282
|
+
y: s.swimlanePadding + a.y,
|
|
283
|
+
// y: diagramProps.swimlanePadding + (swimlane.y || diagramProps.boxDefaultY),
|
|
284
|
+
r: m,
|
|
285
|
+
dimension: l,
|
|
286
|
+
leftSibling: !1,
|
|
287
|
+
swimlane: a,
|
|
288
|
+
visual: t.visual,
|
|
289
|
+
text: t.textProps.content,
|
|
290
|
+
frame: t.frame,
|
|
291
|
+
index: t.index
|
|
292
|
+
}, h = {
|
|
293
|
+
...e,
|
|
294
|
+
boxes: [...e.boxes, u],
|
|
295
|
+
swimlanes: {
|
|
296
|
+
...e.swimlanes,
|
|
297
|
+
[`${a.index}`]: a
|
|
298
|
+
},
|
|
299
|
+
previousSwimlaneNumber: i.index,
|
|
300
|
+
previousFrame: t.frame,
|
|
301
|
+
maxR: x
|
|
302
|
+
}, f = A(h.swimlanes);
|
|
303
|
+
f.length > 0 && (f[0].y = 0);
|
|
304
|
+
for (let p = 1; p < f.length; p++) {
|
|
305
|
+
const y = f[p], R = f[p - 1];
|
|
306
|
+
y.y = R.y + R.height + s.swimlaneGap;
|
|
307
|
+
}
|
|
308
|
+
return h;
|
|
309
|
+
}
|
|
310
|
+
o(Y, "evolveFramePositioned");
|
|
311
|
+
function z(e, n) {
|
|
312
|
+
return e === 0 && n.sourceFrames.length === 0;
|
|
313
|
+
}
|
|
314
|
+
o(z, "isFirstFrame");
|
|
315
|
+
function K(e) {
|
|
316
|
+
return e.sourceFrames !== void 0 && e.sourceFrames !== null && e.sourceFrames.length > 0;
|
|
317
|
+
}
|
|
318
|
+
o(K, "hasSourceFrame");
|
|
319
|
+
function F(e, n) {
|
|
320
|
+
if (n != null)
|
|
321
|
+
return e.find((t) => t.frame.name === n.name);
|
|
322
|
+
}
|
|
323
|
+
o(F, "findBoxByFrame");
|
|
324
|
+
function Q(e, n, t) {
|
|
325
|
+
if (!(t < 0))
|
|
326
|
+
for (let i = t; i >= 0; i--) {
|
|
327
|
+
const a = e[i];
|
|
328
|
+
if (a.swimlane.index !== n)
|
|
329
|
+
return a;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
o(Q, "findBoxByLineIndex");
|
|
333
|
+
function q(e, n) {
|
|
334
|
+
const t = n;
|
|
335
|
+
if (z(t.index, t.frame))
|
|
336
|
+
return [];
|
|
337
|
+
const i = F(e.boxes, t.frame);
|
|
338
|
+
if (i === void 0)
|
|
339
|
+
throw new Error(`Target box not found for frame ${t.frame.name}`);
|
|
340
|
+
let a;
|
|
341
|
+
if (t.sourceFrame)
|
|
342
|
+
a = F(e.boxes, t.sourceFrame);
|
|
343
|
+
else {
|
|
344
|
+
if (ve(t.frame))
|
|
345
|
+
return [];
|
|
346
|
+
a = Q(e.boxes, i.swimlane.index, t.index - 1);
|
|
347
|
+
}
|
|
348
|
+
return a === void 0 ? [] : [{
|
|
349
|
+
$kind: T,
|
|
350
|
+
frame: t.frame,
|
|
351
|
+
index: t.index,
|
|
352
|
+
sourceBox: a,
|
|
353
|
+
targetBox: i
|
|
354
|
+
}];
|
|
355
|
+
}
|
|
356
|
+
o(q, "decidePositionRelation");
|
|
357
|
+
function J(e, n) {
|
|
358
|
+
const t = n, i = {
|
|
359
|
+
visual: {
|
|
360
|
+
fill: "none",
|
|
361
|
+
stroke: "#000"
|
|
362
|
+
},
|
|
363
|
+
source: {
|
|
364
|
+
x: t.sourceBox.x,
|
|
365
|
+
y: t.sourceBox.y
|
|
366
|
+
},
|
|
367
|
+
target: {
|
|
368
|
+
x: t.targetBox.x,
|
|
369
|
+
y: t.targetBox.y
|
|
370
|
+
},
|
|
371
|
+
sourceBox: t.sourceBox,
|
|
372
|
+
targetBox: t.targetBox
|
|
373
|
+
};
|
|
374
|
+
return {
|
|
375
|
+
...e,
|
|
376
|
+
relations: [...e.relations, i]
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
o(J, "evolveRelationPositioned");
|
|
380
|
+
var Me = {
|
|
381
|
+
[D]: V,
|
|
382
|
+
[k]: q
|
|
383
|
+
}, Be = {
|
|
384
|
+
[N]: Y,
|
|
385
|
+
[T]: J
|
|
386
|
+
};
|
|
387
|
+
function Z(e, n) {
|
|
388
|
+
const t = Me[n.$kind];
|
|
389
|
+
if (t == null)
|
|
390
|
+
return [];
|
|
391
|
+
const i = t(e, n);
|
|
392
|
+
return g.debug("decided events", i), i;
|
|
393
|
+
}
|
|
394
|
+
o(Z, "decide");
|
|
395
|
+
function ee(e, n) {
|
|
396
|
+
const t = n.reduce((i, a) => {
|
|
397
|
+
const r = Be[a.$kind];
|
|
398
|
+
return r == null ? i : r(i, a);
|
|
399
|
+
}, e);
|
|
400
|
+
return g.debug("evolve events", { state: e, newState: t, events: n }), t;
|
|
401
|
+
}
|
|
402
|
+
o(ee, "evolve");
|
|
403
|
+
function v(e, n) {
|
|
404
|
+
const t = Z(e, n);
|
|
405
|
+
return ee(e, t);
|
|
406
|
+
}
|
|
407
|
+
o(v, "dispatch");
|
|
408
|
+
var M = {
|
|
409
|
+
getConfig: ke,
|
|
410
|
+
preserveCommentsWhenParsing: !0,
|
|
411
|
+
setOptions: we,
|
|
412
|
+
getOptions: ye,
|
|
413
|
+
clear: Pe,
|
|
414
|
+
setAccTitle: me,
|
|
415
|
+
getAccTitle: ce,
|
|
416
|
+
getAccDescription: le,
|
|
417
|
+
setAccDescription: de,
|
|
418
|
+
setDiagramTitle: se,
|
|
419
|
+
getDiagramTitle: oe,
|
|
420
|
+
setAst: I,
|
|
421
|
+
getDiagramProps: E,
|
|
422
|
+
getState: O
|
|
423
|
+
}, Ee = {
|
|
424
|
+
parse: /* @__PURE__ */ o(async (e) => {
|
|
425
|
+
const n = await be("eventmodeling", e);
|
|
426
|
+
g.debug(n), M.setAst(n), re(n, M);
|
|
427
|
+
}, "parse")
|
|
428
|
+
}, Ae = $(), Re = Ae?.eventmodeling;
|
|
429
|
+
function te(e, n) {
|
|
430
|
+
return (t) => {
|
|
431
|
+
const i = t.swimlane.y + n.swimlanePadding, a = e.append("g").attr("class", "em-box");
|
|
432
|
+
a.append("rect").attr("x", t.x).attr("y", i).attr("rx", "3").attr("width", t.dimension.width).attr("height", t.dimension.height).attr("stroke", t.visual.stroke).attr("fill", t.visual.fill), a.append("foreignObject").attr("x", t.x + n.boxPadding).attr("y", i + 10).attr("width", t.dimension.width - 2 * n.boxPadding).attr("height", t.dimension.height - 2 * n.boxPadding).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%").append("span").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").html(t.text);
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
o(te, "renderD3Box");
|
|
436
|
+
function ne(e, n) {
|
|
437
|
+
return e > n;
|
|
438
|
+
}
|
|
439
|
+
o(ne, "dirUpwards");
|
|
440
|
+
function ie(e, n, t, i) {
|
|
441
|
+
return (a) => {
|
|
442
|
+
const r = a.sourceBox.swimlane.y + n.swimlanePadding, d = a.targetBox.swimlane.y + n.swimlanePadding, l = ne(r, d), c = a.sourceBox.x + a.sourceBox.dimension.width * 2 / 3, m = a.targetBox.x + a.targetBox.dimension.width / 3;
|
|
443
|
+
let x, u;
|
|
444
|
+
g.debug(`rendering relation up=${l} for `, {
|
|
445
|
+
sourceBox: a.sourceBox,
|
|
446
|
+
targetBox: a.targetBox
|
|
447
|
+
}), l ? (x = r, u = d + a.targetBox.dimension.height) : (x = r + a.sourceBox.dimension.height, u = d);
|
|
448
|
+
const h = i.emRelationStroke ?? a.visual.stroke;
|
|
449
|
+
e.append("path").attr("class", "em-relation").attr("fill", a.visual.fill).attr("stroke", h).attr("stroke-width", "1").attr("marker-end", `url(#${t})`).attr("d", `M${c} ${x} L${m} ${u}`);
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
o(ie, "renderD3Relation");
|
|
453
|
+
function ae(e, n, t, i) {
|
|
454
|
+
return (a) => {
|
|
455
|
+
const r = e.append("g").attr("class", "em-swimlane"), d = i.emSwimlaneBackgroundOdd ?? "rgb(250,250,250)", l = i.emSwimlaneBackgroundStroke ?? "rgb(240,240,240)";
|
|
456
|
+
r.append("rect").attr("x", 0).attr("y", a.y).attr("rx", "3").attr("width", n + t.swimlanePadding).attr("height", a.height).attr("fill", d).attr("stroke", l), r.append("text").attr("font-weight", t.swimlaneTextFontWeight).attr("x", 30).attr("y", a.y + 30).text(a.label);
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
o(ae, "renderD3Swimlane");
|
|
460
|
+
var $e = /* @__PURE__ */ o(function(e, n, t, i) {
|
|
461
|
+
if (g.debug("in eventmodeling renderer", e + `
|
|
462
|
+
`, "id:", n, t), !Re)
|
|
463
|
+
throw new Error("EventModeling config not found");
|
|
464
|
+
const a = i.db, { themeVariables: r, eventmodeling: d } = $(), l = ue(`[id="${n}"]`), c = a.getDiagramProps(), m = a.getState(), x = `em-arrowhead-${n}`, u = r.emArrowhead ?? "#000000";
|
|
465
|
+
m.sortedSwimlanesArray.forEach(
|
|
466
|
+
ae(l, m.maxR, c, r)
|
|
467
|
+
), m.boxes.forEach(te(l, c)), m.relations.forEach(ie(l, c, x, r)), l.append("defs").append("marker").attr("id", x).attr("markerWidth", "10").attr("markerHeight", "7").attr("refX", "10").attr("refY", "3.5").attr("orient", "auto").append("polygon").attr("points", "0 0, 10 3.5, 0 7").attr("fill", u), xe(void 0, l, d?.padding ?? 30, d?.useMaxWidth);
|
|
468
|
+
}, "draw"), De = {
|
|
469
|
+
draw: $e
|
|
470
|
+
}, Ne = /* @__PURE__ */ o((e) => "", "getStyles"), Te = Ne, We = {
|
|
471
|
+
parser: Ee,
|
|
472
|
+
db: M,
|
|
473
|
+
renderer: De,
|
|
474
|
+
styles: Te
|
|
475
|
+
};
|
|
476
|
+
export {
|
|
477
|
+
We as diagram
|
|
478
|
+
};
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { p as I } from "./chunk-JWPE2WC7-CDBrSjU7.js";
|
|
2
|
+
import { s as _, g as D, x as E, v as F, a as P, b as z, _ as c, T as G, D as B, Q as w, O as C, R as W, l as b, Y as V, d as H } from "./mermaid.core-yQghUlIz.js";
|
|
3
|
+
import { p as j } from "./cynefin-EF2NZ3EQ-D7MVnMHu.js";
|
|
4
|
+
var m = {
|
|
5
|
+
showLegend: !0,
|
|
6
|
+
ticks: 5,
|
|
7
|
+
max: null,
|
|
8
|
+
min: 0,
|
|
9
|
+
graticule: "circle"
|
|
10
|
+
}, y = 32, A = {
|
|
11
|
+
axes: [],
|
|
12
|
+
curves: [],
|
|
13
|
+
options: m
|
|
14
|
+
}, x = structuredClone(A), U = W.radar, X = /* @__PURE__ */ c(() => w({
|
|
15
|
+
...U,
|
|
16
|
+
...C().radar
|
|
17
|
+
}), "getConfig"), M = /* @__PURE__ */ c(() => x.axes, "getAxes"), Y = /* @__PURE__ */ c(() => x.curves, "getCurves"), K = /* @__PURE__ */ c(() => x.options, "getOptions"), N = /* @__PURE__ */ c((a) => {
|
|
18
|
+
x.axes = a.map((t) => ({
|
|
19
|
+
name: t.name,
|
|
20
|
+
label: t.label ?? t.name
|
|
21
|
+
}));
|
|
22
|
+
}, "setAxes"), Q = /* @__PURE__ */ c((a) => {
|
|
23
|
+
x.curves = a.map((t) => ({
|
|
24
|
+
name: t.name,
|
|
25
|
+
label: t.label ?? t.name,
|
|
26
|
+
entries: Z(t.entries)
|
|
27
|
+
}));
|
|
28
|
+
}, "setCurves"), Z = /* @__PURE__ */ c((a) => {
|
|
29
|
+
if (a[0].axis == null)
|
|
30
|
+
return a.map((e) => e.value);
|
|
31
|
+
const t = M();
|
|
32
|
+
if (t.length === 0)
|
|
33
|
+
throw new Error("Axes must be populated before curves for reference entries");
|
|
34
|
+
return t.map((e) => {
|
|
35
|
+
const r = a.find((s) => s.axis?.$refText === e.name);
|
|
36
|
+
if (r === void 0)
|
|
37
|
+
throw new Error("Missing entry for axis " + e.label);
|
|
38
|
+
return r.value;
|
|
39
|
+
});
|
|
40
|
+
}, "computeCurveEntries"), q = /* @__PURE__ */ c((a) => {
|
|
41
|
+
const t = a.reduce(
|
|
42
|
+
(e, r) => (e[r.name] = r, e),
|
|
43
|
+
{}
|
|
44
|
+
);
|
|
45
|
+
x.options = {
|
|
46
|
+
showLegend: t.showLegend?.value ?? m.showLegend,
|
|
47
|
+
ticks: t.ticks?.value ?? m.ticks,
|
|
48
|
+
max: t.max?.value ?? m.max,
|
|
49
|
+
min: t.min?.value ?? m.min,
|
|
50
|
+
graticule: t.graticule?.value ?? m.graticule
|
|
51
|
+
}, x.options.ticks > y && (b.warn(
|
|
52
|
+
`Radar diagram ticks (${x.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`
|
|
53
|
+
), x.options.ticks = y);
|
|
54
|
+
}, "setOptions"), J = /* @__PURE__ */ c(() => {
|
|
55
|
+
B(), x = structuredClone(A);
|
|
56
|
+
}, "clear"), $ = {
|
|
57
|
+
getAxes: M,
|
|
58
|
+
getCurves: Y,
|
|
59
|
+
getOptions: K,
|
|
60
|
+
setAxes: N,
|
|
61
|
+
setCurves: Q,
|
|
62
|
+
setOptions: q,
|
|
63
|
+
getConfig: X,
|
|
64
|
+
clear: J,
|
|
65
|
+
setAccTitle: z,
|
|
66
|
+
getAccTitle: P,
|
|
67
|
+
setDiagramTitle: F,
|
|
68
|
+
getDiagramTitle: E,
|
|
69
|
+
getAccDescription: D,
|
|
70
|
+
setAccDescription: _
|
|
71
|
+
}, tt = /* @__PURE__ */ c((a) => {
|
|
72
|
+
I(a, $);
|
|
73
|
+
const { axes: t, curves: e, options: r } = a;
|
|
74
|
+
$.setAxes(t), $.setCurves(e), $.setOptions(r);
|
|
75
|
+
}, "populate"), et = {
|
|
76
|
+
parse: /* @__PURE__ */ c(async (a) => {
|
|
77
|
+
const t = await j("radar", a);
|
|
78
|
+
b.debug(t), tt(t);
|
|
79
|
+
}, "parse")
|
|
80
|
+
}, at = /* @__PURE__ */ c((a, t, e, r) => {
|
|
81
|
+
const s = r.db, i = s.getAxes(), l = s.getCurves(), n = s.getOptions(), o = s.getConfig(), d = s.getDiagramTitle(), p = G(t), u = rt(p, o), g = n.max ?? Math.max(...l.map((f) => Math.max(...f.entries))), h = n.min, v = Math.min(o.width, o.height) / 2;
|
|
82
|
+
st(u, i, v, n.ticks, n.graticule), nt(u, i, v, o), L(u, i, l, h, g, n.graticule, o), k(u, l, n.showLegend, o), u.append("text").attr("class", "radarTitle").text(d).attr("x", 0).attr("y", -o.height / 2 - o.marginTop);
|
|
83
|
+
}, "draw"), rt = /* @__PURE__ */ c((a, t) => {
|
|
84
|
+
const e = t.width + t.marginLeft + t.marginRight, r = t.height + t.marginTop + t.marginBottom, s = {
|
|
85
|
+
x: t.marginLeft + t.width / 2,
|
|
86
|
+
y: t.marginTop + t.height / 2
|
|
87
|
+
};
|
|
88
|
+
return H(a, r, e, t.useMaxWidth ?? !0), a.attr("viewBox", `0 0 ${e} ${r}`).attr("overflow", "visible"), a.append("g").attr("transform", `translate(${s.x}, ${s.y})`);
|
|
89
|
+
}, "drawFrame"), st = /* @__PURE__ */ c((a, t, e, r, s) => {
|
|
90
|
+
if (s === "circle")
|
|
91
|
+
for (let i = 0; i < r; i++) {
|
|
92
|
+
const l = e * (i + 1) / r;
|
|
93
|
+
a.append("circle").attr("r", l).attr("class", "radarGraticule");
|
|
94
|
+
}
|
|
95
|
+
else if (s === "polygon") {
|
|
96
|
+
const i = t.length;
|
|
97
|
+
for (let l = 0; l < r; l++) {
|
|
98
|
+
const n = e * (l + 1) / r, o = t.map((d, p) => {
|
|
99
|
+
const u = 2 * p * Math.PI / i - Math.PI / 2, g = n * Math.cos(u), h = n * Math.sin(u);
|
|
100
|
+
return `${g},${h}`;
|
|
101
|
+
}).join(" ");
|
|
102
|
+
a.append("polygon").attr("points", o).attr("class", "radarGraticule");
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}, "drawGraticule"), nt = /* @__PURE__ */ c((a, t, e, r) => {
|
|
106
|
+
const s = t.length;
|
|
107
|
+
for (let i = 0; i < s; i++) {
|
|
108
|
+
const l = t[i].label, n = 2 * i * Math.PI / s - Math.PI / 2, o = Math.cos(n), d = Math.sin(n);
|
|
109
|
+
a.append("line").attr("x1", 0).attr("y1", 0).attr("x2", e * r.axisScaleFactor * o).attr("y2", e * r.axisScaleFactor * d).attr("class", "radarAxisLine");
|
|
110
|
+
const p = o > 0.01 ? "start" : o < -0.01 ? "end" : "middle", u = d > 0.01 ? "hanging" : d < -0.01 ? "auto" : "central", g = 4;
|
|
111
|
+
a.append("text").text(l).attr("x", e * r.axisLabelFactor * o + g * o).attr("y", e * r.axisLabelFactor * d + g * d).attr("text-anchor", p).attr("dominant-baseline", u).attr("class", "radarAxisLabel");
|
|
112
|
+
}
|
|
113
|
+
}, "drawAxes");
|
|
114
|
+
function L(a, t, e, r, s, i, l) {
|
|
115
|
+
const n = t.length, o = Math.min(l.width, l.height) / 2;
|
|
116
|
+
e.forEach((d, p) => {
|
|
117
|
+
if (d.entries.length !== n)
|
|
118
|
+
return;
|
|
119
|
+
const u = d.entries.map((g, h) => {
|
|
120
|
+
const v = 2 * Math.PI * h / n - Math.PI / 2, f = T(g, r, s, o), O = f * Math.cos(v), R = f * Math.sin(v);
|
|
121
|
+
return { x: O, y: R };
|
|
122
|
+
});
|
|
123
|
+
i === "circle" ? a.append("path").attr("d", S(u, l.curveTension)).attr("class", `radarCurve-${p}`) : i === "polygon" && a.append("polygon").attr("points", u.map((g) => `${g.x},${g.y}`).join(" ")).attr("class", `radarCurve-${p}`);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
c(L, "drawCurves");
|
|
127
|
+
function T(a, t, e, r) {
|
|
128
|
+
const s = Math.min(Math.max(a, t), e);
|
|
129
|
+
return r * (s - t) / (e - t);
|
|
130
|
+
}
|
|
131
|
+
c(T, "relativeRadius");
|
|
132
|
+
function S(a, t) {
|
|
133
|
+
const e = a.length;
|
|
134
|
+
let r = `M${a[0].x},${a[0].y}`;
|
|
135
|
+
for (let s = 0; s < e; s++) {
|
|
136
|
+
const i = a[(s - 1 + e) % e], l = a[s], n = a[(s + 1) % e], o = a[(s + 2) % e], d = {
|
|
137
|
+
x: l.x + (n.x - i.x) * t,
|
|
138
|
+
y: l.y + (n.y - i.y) * t
|
|
139
|
+
}, p = {
|
|
140
|
+
x: n.x - (o.x - l.x) * t,
|
|
141
|
+
y: n.y - (o.y - l.y) * t
|
|
142
|
+
};
|
|
143
|
+
r += ` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`;
|
|
144
|
+
}
|
|
145
|
+
return `${r} Z`;
|
|
146
|
+
}
|
|
147
|
+
c(S, "closedRoundCurve");
|
|
148
|
+
function k(a, t, e, r) {
|
|
149
|
+
if (!e)
|
|
150
|
+
return;
|
|
151
|
+
const s = (r.width / 2 + r.marginRight) * 3 / 4, i = -(r.height / 2 + r.marginTop) * 3 / 4, l = 20;
|
|
152
|
+
t.forEach((n, o) => {
|
|
153
|
+
const d = a.append("g").attr("transform", `translate(${s}, ${i + o * l})`);
|
|
154
|
+
d.append("rect").attr("width", 12).attr("height", 12).attr("class", `radarLegendBox-${o}`), d.append("text").attr("x", 16).attr("y", 0).attr("class", "radarLegendText").text(n.label);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
c(k, "drawLegend");
|
|
158
|
+
var ot = { draw: at }, it = /* @__PURE__ */ c((a, t) => {
|
|
159
|
+
let e = "";
|
|
160
|
+
for (let r = 0; r < a.THEME_COLOR_LIMIT; r++) {
|
|
161
|
+
const s = a[`cScale${r}`];
|
|
162
|
+
e += `
|
|
163
|
+
.radarCurve-${r} {
|
|
164
|
+
color: ${s};
|
|
165
|
+
fill: ${s};
|
|
166
|
+
fill-opacity: ${t.curveOpacity};
|
|
167
|
+
stroke: ${s};
|
|
168
|
+
stroke-width: ${t.curveStrokeWidth};
|
|
169
|
+
}
|
|
170
|
+
.radarLegendBox-${r} {
|
|
171
|
+
fill: ${s};
|
|
172
|
+
fill-opacity: ${t.curveOpacity};
|
|
173
|
+
stroke: ${s};
|
|
174
|
+
}
|
|
175
|
+
`;
|
|
176
|
+
}
|
|
177
|
+
return e;
|
|
178
|
+
}, "genIndexStyles"), lt = /* @__PURE__ */ c((a) => {
|
|
179
|
+
const t = V(), e = C(), r = w(t, e.themeVariables), s = w(r.radar, a);
|
|
180
|
+
return { themeVariables: r, radarOptions: s };
|
|
181
|
+
}, "buildRadarStyleOptions"), ct = /* @__PURE__ */ c(({ radar: a } = {}) => {
|
|
182
|
+
const { themeVariables: t, radarOptions: e } = lt(a);
|
|
183
|
+
return `
|
|
184
|
+
.radarTitle {
|
|
185
|
+
font-size: ${t.fontSize};
|
|
186
|
+
color: ${t.titleColor};
|
|
187
|
+
dominant-baseline: hanging;
|
|
188
|
+
text-anchor: middle;
|
|
189
|
+
}
|
|
190
|
+
.radarAxisLine {
|
|
191
|
+
stroke: ${e.axisColor};
|
|
192
|
+
stroke-width: ${e.axisStrokeWidth};
|
|
193
|
+
}
|
|
194
|
+
.radarAxisLabel {
|
|
195
|
+
font-size: ${e.axisLabelFontSize}px;
|
|
196
|
+
color: ${e.axisColor};
|
|
197
|
+
}
|
|
198
|
+
.radarGraticule {
|
|
199
|
+
fill: ${e.graticuleColor};
|
|
200
|
+
fill-opacity: ${e.graticuleOpacity};
|
|
201
|
+
stroke: ${e.graticuleColor};
|
|
202
|
+
stroke-width: ${e.graticuleStrokeWidth};
|
|
203
|
+
}
|
|
204
|
+
.radarLegendText {
|
|
205
|
+
text-anchor: start;
|
|
206
|
+
font-size: ${e.legendFontSize}px;
|
|
207
|
+
dominant-baseline: hanging;
|
|
208
|
+
}
|
|
209
|
+
${it(t, e)}
|
|
210
|
+
`;
|
|
211
|
+
}, "styles"), gt = {
|
|
212
|
+
parser: et,
|
|
213
|
+
db: $,
|
|
214
|
+
renderer: ot,
|
|
215
|
+
styles: ct
|
|
216
|
+
};
|
|
217
|
+
export {
|
|
218
|
+
gt as diagram
|
|
219
|
+
};
|