@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,684 @@
|
|
|
1
|
+
import { a$ as zt, $ as Lt, a3 as Tt, b2 as At, a0 as Xt, b0 as Et, b as y, ac as Yt, a1 as It, s as Q, aB as et, a_ as Bt, E as Ft, t as Rt, a2 as V } from "./mermaid.core-CdBIz6FY.js";
|
|
2
|
+
import { p as Ot } from "./chunk-4BX2VUAB-Bq3GzsD8.js";
|
|
3
|
+
import { p as Wt } from "./wardley-L42UT6IY-DUnkyH_z.js";
|
|
4
|
+
var G = /* @__PURE__ */ y((a, o) => {
|
|
5
|
+
const e = a <= 1 ? a * 100 : a;
|
|
6
|
+
if (e < 0 || e > 100)
|
|
7
|
+
throw new Error(
|
|
8
|
+
`${o} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`
|
|
9
|
+
);
|
|
10
|
+
return e;
|
|
11
|
+
}, "toPercent"), E = /* @__PURE__ */ y((a, o, e) => ({
|
|
12
|
+
x: G(o, `${e} evolution`),
|
|
13
|
+
y: G(a, `${e} visibility`)
|
|
14
|
+
}), "toCoordinates"), tt = /* @__PURE__ */ y((a) => {
|
|
15
|
+
if (a) {
|
|
16
|
+
if (a === "+<>")
|
|
17
|
+
return "bidirectional";
|
|
18
|
+
if (a === "+<")
|
|
19
|
+
return "backward";
|
|
20
|
+
if (a === "+>")
|
|
21
|
+
return "forward";
|
|
22
|
+
}
|
|
23
|
+
}, "getFlowFromPort"), Dt = /* @__PURE__ */ y((a) => {
|
|
24
|
+
if (!(a != null && a.startsWith("+")))
|
|
25
|
+
return {};
|
|
26
|
+
const o = /^\+'([^']*)'/.exec(a), e = o == null ? void 0 : o[1];
|
|
27
|
+
return a.includes("<>") ? { flow: "bidirectional", label: e } : a.includes("<") ? { flow: "backward", label: e } : a.includes(">") ? { flow: "forward", label: e } : { label: e };
|
|
28
|
+
}, "extractFlowFromArrow"), Gt = /* @__PURE__ */ y((a, o) => {
|
|
29
|
+
if (Ot(a, o), a.size && o.setSize(a.size.width, a.size.height), a.evolution) {
|
|
30
|
+
const e = a.evolution.stages.map((r) => r.secondName ? `${r.name.trim()} / ${r.secondName.trim()}` : r.name.trim()), p = a.evolution.stages.filter((r) => r.boundary !== void 0).map((r) => r.boundary);
|
|
31
|
+
o.updateAxes({ stages: e, stageBoundaries: p });
|
|
32
|
+
}
|
|
33
|
+
if (a.anchors.forEach((e) => {
|
|
34
|
+
const p = E(e.visibility, e.evolution, `Anchor "${e.name}"`);
|
|
35
|
+
o.addNode(e.name, e.name, p.x, p.y, "anchor");
|
|
36
|
+
}), a.components.forEach((e) => {
|
|
37
|
+
var v;
|
|
38
|
+
const p = E(
|
|
39
|
+
e.visibility,
|
|
40
|
+
e.evolution,
|
|
41
|
+
`Component "${e.name}"`
|
|
42
|
+
), r = e.label ? (e.label.negX ? -1 : 1) * e.label.offsetX : void 0, d = e.label ? (e.label.negY ? -1 : 1) * e.label.offsetY : void 0, m = (v = e.decorator) == null ? void 0 : v.strategy;
|
|
43
|
+
o.addNode(
|
|
44
|
+
e.name,
|
|
45
|
+
e.name,
|
|
46
|
+
p.x,
|
|
47
|
+
p.y,
|
|
48
|
+
"component",
|
|
49
|
+
r,
|
|
50
|
+
d,
|
|
51
|
+
e.inertia,
|
|
52
|
+
m
|
|
53
|
+
);
|
|
54
|
+
}), a.notes.forEach((e) => {
|
|
55
|
+
const p = E(e.visibility, e.evolution, `Note "${e.text}"`);
|
|
56
|
+
o.addNote(e.text, p.x, p.y);
|
|
57
|
+
}), a.pipelines.forEach((e) => {
|
|
58
|
+
const p = o.getNode(e.parent);
|
|
59
|
+
if (!p || typeof p.y != "number")
|
|
60
|
+
throw new Error(
|
|
61
|
+
`Pipeline "${e.parent}" must reference an existing component with coordinates.`
|
|
62
|
+
);
|
|
63
|
+
const r = p.y;
|
|
64
|
+
o.startPipeline(e.parent), e.components.forEach((d) => {
|
|
65
|
+
const m = `${e.parent}_${d.name}`, v = d.label ? (d.label.negX ? -1 : 1) * d.label.offsetX : void 0, g = d.label ? (d.label.negY ? -1 : 1) * d.label.offsetY : void 0, L = G(d.evolution, `Pipeline component "${d.name}" evolution`);
|
|
66
|
+
o.addNode(
|
|
67
|
+
m,
|
|
68
|
+
d.name,
|
|
69
|
+
L,
|
|
70
|
+
r,
|
|
71
|
+
"pipeline-component",
|
|
72
|
+
v,
|
|
73
|
+
g
|
|
74
|
+
), o.addPipelineComponent(e.parent, m);
|
|
75
|
+
});
|
|
76
|
+
}), a.links.forEach((e) => {
|
|
77
|
+
const p = !!e.arrow && (e.arrow.includes("-.->") || e.arrow.includes(".-."));
|
|
78
|
+
let r = tt(e.fromPort) ?? tt(e.toPort);
|
|
79
|
+
const { flow: d, label: m } = Dt(e.arrow);
|
|
80
|
+
!r && d && (r = d);
|
|
81
|
+
const v = e.linkLabel, g = m ?? v;
|
|
82
|
+
o.addLink(o.resolveNodeId(e.from), o.resolveNodeId(e.to), p, g, r);
|
|
83
|
+
}), a.evolves.forEach((e) => {
|
|
84
|
+
const p = o.getNode(e.component);
|
|
85
|
+
if ((p == null ? void 0 : p.y) !== void 0) {
|
|
86
|
+
const r = G(e.target, `Evolve target for "${e.component}"`);
|
|
87
|
+
o.addTrend(e.component, r, p.y);
|
|
88
|
+
}
|
|
89
|
+
}), a.annotations.length > 0) {
|
|
90
|
+
const e = a.annotations[0], p = E(e.x, e.y, "Annotations box");
|
|
91
|
+
o.setAnnotationsBox(p.x, p.y);
|
|
92
|
+
}
|
|
93
|
+
a.annotation.forEach((e) => {
|
|
94
|
+
const p = E(e.x, e.y, `Annotation ${e.number}`);
|
|
95
|
+
o.addAnnotation(e.number, [{ x: p.x, y: p.y }], e.text);
|
|
96
|
+
}), a.accelerators.forEach((e) => {
|
|
97
|
+
const p = E(e.x, e.y, `Accelerator "${e.name}"`);
|
|
98
|
+
o.addAccelerator(e.name, p.x, p.y);
|
|
99
|
+
}), a.deaccelerators.forEach((e) => {
|
|
100
|
+
const p = E(
|
|
101
|
+
e.x,
|
|
102
|
+
e.y,
|
|
103
|
+
`Deaccelerator "${e.name}"`
|
|
104
|
+
);
|
|
105
|
+
o.addDeaccelerator(e.name, p.x, p.y);
|
|
106
|
+
});
|
|
107
|
+
}, "populateDb"), at = {
|
|
108
|
+
parser: {
|
|
109
|
+
// @ts-expect-error - WardleyDB is not assignable to DiagramDB
|
|
110
|
+
yy: void 0
|
|
111
|
+
},
|
|
112
|
+
parse: /* @__PURE__ */ y(async (a) => {
|
|
113
|
+
var p;
|
|
114
|
+
const o = await Wt("wardley", a);
|
|
115
|
+
et.debug(o);
|
|
116
|
+
const e = (p = at.parser) == null ? void 0 : p.yy;
|
|
117
|
+
if (!e || typeof e.addNode != "function")
|
|
118
|
+
throw new Error(
|
|
119
|
+
"parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
|
|
120
|
+
);
|
|
121
|
+
Gt(o, e);
|
|
122
|
+
}, "parse")
|
|
123
|
+
}, I, qt = (I = class {
|
|
124
|
+
constructor() {
|
|
125
|
+
this.nodes = /* @__PURE__ */ new Map(), this.links = [], this.trends = /* @__PURE__ */ new Map(), this.pipelines = /* @__PURE__ */ new Map(), this.annotations = [], this.notes = [], this.accelerators = [], this.deaccelerators = [], this.axes = {};
|
|
126
|
+
}
|
|
127
|
+
addNode(o) {
|
|
128
|
+
const e = this.nodes.get(o.id) ?? { id: o.id, label: o.label }, p = {
|
|
129
|
+
...e,
|
|
130
|
+
...o,
|
|
131
|
+
className: o.className ?? e.className,
|
|
132
|
+
labelOffsetX: o.labelOffsetX ?? e.labelOffsetX,
|
|
133
|
+
labelOffsetY: o.labelOffsetY ?? e.labelOffsetY
|
|
134
|
+
};
|
|
135
|
+
this.nodes.set(o.id, p);
|
|
136
|
+
}
|
|
137
|
+
addLink(o) {
|
|
138
|
+
this.links.push(o);
|
|
139
|
+
}
|
|
140
|
+
addTrend(o) {
|
|
141
|
+
this.trends.set(o.nodeId, o);
|
|
142
|
+
}
|
|
143
|
+
startPipeline(o) {
|
|
144
|
+
this.pipelines.set(o, { nodeId: o, componentIds: [] });
|
|
145
|
+
const e = this.nodes.get(o);
|
|
146
|
+
e && (e.isPipelineParent = !0);
|
|
147
|
+
}
|
|
148
|
+
addPipelineComponent(o, e) {
|
|
149
|
+
const p = this.pipelines.get(o);
|
|
150
|
+
p && p.componentIds.push(e);
|
|
151
|
+
const r = this.nodes.get(e);
|
|
152
|
+
r && (r.inPipeline = !0);
|
|
153
|
+
}
|
|
154
|
+
addAnnotation(o) {
|
|
155
|
+
this.annotations.push(o);
|
|
156
|
+
}
|
|
157
|
+
addNote(o) {
|
|
158
|
+
this.notes.push(o);
|
|
159
|
+
}
|
|
160
|
+
addAccelerator(o) {
|
|
161
|
+
this.accelerators.push(o);
|
|
162
|
+
}
|
|
163
|
+
addDeaccelerator(o) {
|
|
164
|
+
this.deaccelerators.push(o);
|
|
165
|
+
}
|
|
166
|
+
setAnnotationsBox(o, e) {
|
|
167
|
+
this.annotationsBox = { x: o, y: e };
|
|
168
|
+
}
|
|
169
|
+
setAxes(o) {
|
|
170
|
+
this.axes = {
|
|
171
|
+
...this.axes,
|
|
172
|
+
...o
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
setSize(o, e) {
|
|
176
|
+
this.size = { width: o, height: e };
|
|
177
|
+
}
|
|
178
|
+
getNode(o) {
|
|
179
|
+
return this.nodes.get(o);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Resolve a name to a node ID. Tries exact ID match first,
|
|
183
|
+
* then falls back to finding a node whose label matches the name
|
|
184
|
+
* (handles pipeline components which have synthetic IDs like "Parent_Child").
|
|
185
|
+
*/
|
|
186
|
+
resolveNodeId(o) {
|
|
187
|
+
if (this.nodes.has(o))
|
|
188
|
+
return o;
|
|
189
|
+
for (const [e, p] of this.nodes)
|
|
190
|
+
if (p.label === o)
|
|
191
|
+
return e;
|
|
192
|
+
return o;
|
|
193
|
+
}
|
|
194
|
+
build() {
|
|
195
|
+
const o = [];
|
|
196
|
+
for (const e of this.nodes.values()) {
|
|
197
|
+
if (typeof e.x != "number" || typeof e.y != "number")
|
|
198
|
+
throw new Error(`Node "${e.label}" is missing coordinates`);
|
|
199
|
+
o.push(e);
|
|
200
|
+
}
|
|
201
|
+
return {
|
|
202
|
+
nodes: o,
|
|
203
|
+
links: [...this.links],
|
|
204
|
+
trends: [...this.trends.values()],
|
|
205
|
+
pipelines: [...this.pipelines.values()],
|
|
206
|
+
annotations: [...this.annotations],
|
|
207
|
+
notes: [...this.notes],
|
|
208
|
+
accelerators: [...this.accelerators],
|
|
209
|
+
deaccelerators: [...this.deaccelerators],
|
|
210
|
+
annotationsBox: this.annotationsBox,
|
|
211
|
+
axes: { ...this.axes },
|
|
212
|
+
size: this.size
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
clear() {
|
|
216
|
+
this.nodes.clear(), this.links = [], this.trends.clear(), this.pipelines.clear(), this.annotations = [], this.notes = [], this.accelerators = [], this.deaccelerators = [], this.annotationsBox = void 0, this.axes = {}, this.size = void 0;
|
|
217
|
+
}
|
|
218
|
+
}, y(I, "WardleyBuilder"), I), b = new qt();
|
|
219
|
+
function rt() {
|
|
220
|
+
return V()["wardley-beta"];
|
|
221
|
+
}
|
|
222
|
+
y(rt, "getConfig");
|
|
223
|
+
function ot(a, o, e, p, r, d, m, v, g) {
|
|
224
|
+
b.addNode({
|
|
225
|
+
id: a,
|
|
226
|
+
label: o,
|
|
227
|
+
x: e,
|
|
228
|
+
y: p,
|
|
229
|
+
className: r,
|
|
230
|
+
labelOffsetX: d,
|
|
231
|
+
labelOffsetY: m,
|
|
232
|
+
inertia: v,
|
|
233
|
+
sourceStrategy: g
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
y(ot, "addNode");
|
|
237
|
+
function st(a, o, e = !1, p, r) {
|
|
238
|
+
b.addLink({
|
|
239
|
+
source: a,
|
|
240
|
+
target: o,
|
|
241
|
+
dashed: e,
|
|
242
|
+
label: p,
|
|
243
|
+
flow: r
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
y(st, "addLink");
|
|
247
|
+
function nt(a, o, e) {
|
|
248
|
+
b.addTrend({ nodeId: a, targetX: o, targetY: e });
|
|
249
|
+
}
|
|
250
|
+
y(nt, "addTrend");
|
|
251
|
+
function it(a, o, e) {
|
|
252
|
+
b.addAnnotation({
|
|
253
|
+
number: a,
|
|
254
|
+
coordinates: o,
|
|
255
|
+
text: e
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
y(it, "addAnnotation");
|
|
259
|
+
function dt(a, o, e) {
|
|
260
|
+
b.addNote({
|
|
261
|
+
text: a,
|
|
262
|
+
x: o,
|
|
263
|
+
y: e
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
y(dt, "addNote");
|
|
267
|
+
function lt(a, o, e) {
|
|
268
|
+
b.addAccelerator({
|
|
269
|
+
name: a,
|
|
270
|
+
x: o,
|
|
271
|
+
y: e
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
y(lt, "addAccelerator");
|
|
275
|
+
function ct(a, o, e) {
|
|
276
|
+
b.addDeaccelerator({
|
|
277
|
+
name: a,
|
|
278
|
+
x: o,
|
|
279
|
+
y: e
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
y(ct, "addDeaccelerator");
|
|
283
|
+
function pt(a, o) {
|
|
284
|
+
b.setAnnotationsBox(a, o);
|
|
285
|
+
}
|
|
286
|
+
y(pt, "setAnnotationsBox");
|
|
287
|
+
function ht(a, o) {
|
|
288
|
+
b.setSize(a, o);
|
|
289
|
+
}
|
|
290
|
+
y(ht, "setSize");
|
|
291
|
+
function xt(a) {
|
|
292
|
+
b.startPipeline(a);
|
|
293
|
+
}
|
|
294
|
+
y(xt, "startPipeline");
|
|
295
|
+
function ft(a, o) {
|
|
296
|
+
b.addPipelineComponent(a, o);
|
|
297
|
+
}
|
|
298
|
+
y(ft, "addPipelineComponent");
|
|
299
|
+
function gt(a) {
|
|
300
|
+
b.setAxes(a);
|
|
301
|
+
}
|
|
302
|
+
y(gt, "updateAxes");
|
|
303
|
+
function ut(a) {
|
|
304
|
+
return b.getNode(a);
|
|
305
|
+
}
|
|
306
|
+
y(ut, "getNode");
|
|
307
|
+
function yt(a) {
|
|
308
|
+
return b.resolveNodeId(a);
|
|
309
|
+
}
|
|
310
|
+
y(yt, "resolveNodeId");
|
|
311
|
+
function mt() {
|
|
312
|
+
return b.build();
|
|
313
|
+
}
|
|
314
|
+
y(mt, "getWardleyData");
|
|
315
|
+
function wt() {
|
|
316
|
+
b.clear(), Rt();
|
|
317
|
+
}
|
|
318
|
+
y(wt, "clear");
|
|
319
|
+
var Ht = {
|
|
320
|
+
getConfig: rt,
|
|
321
|
+
addNode: ot,
|
|
322
|
+
addLink: st,
|
|
323
|
+
addTrend: nt,
|
|
324
|
+
addAnnotation: it,
|
|
325
|
+
addNote: dt,
|
|
326
|
+
addAccelerator: lt,
|
|
327
|
+
addDeaccelerator: ct,
|
|
328
|
+
setAnnotationsBox: pt,
|
|
329
|
+
setSize: ht,
|
|
330
|
+
startPipeline: xt,
|
|
331
|
+
addPipelineComponent: ft,
|
|
332
|
+
updateAxes: gt,
|
|
333
|
+
getNode: ut,
|
|
334
|
+
resolveNodeId: yt,
|
|
335
|
+
getWardleyData: mt,
|
|
336
|
+
clear: wt,
|
|
337
|
+
setAccTitle: Et,
|
|
338
|
+
getAccTitle: Xt,
|
|
339
|
+
setDiagramTitle: At,
|
|
340
|
+
getDiagramTitle: Tt,
|
|
341
|
+
getAccDescription: Lt,
|
|
342
|
+
setAccDescription: zt
|
|
343
|
+
}, jt = ["Genesis", "Custom Built", "Product", "Commodity"], Vt = /* @__PURE__ */ y(() => {
|
|
344
|
+
var o, e, p, r, d, m, v, g, L, M, k, N;
|
|
345
|
+
const { themeVariables: a } = V();
|
|
346
|
+
return {
|
|
347
|
+
backgroundColor: ((o = a.wardley) == null ? void 0 : o.backgroundColor) ?? a.background ?? "#fff",
|
|
348
|
+
axisColor: ((e = a.wardley) == null ? void 0 : e.axisColor) ?? "#000",
|
|
349
|
+
axisTextColor: ((p = a.wardley) == null ? void 0 : p.axisTextColor) ?? a.primaryTextColor ?? "#222",
|
|
350
|
+
gridColor: ((r = a.wardley) == null ? void 0 : r.gridColor) ?? "rgba(100, 100, 100, 0.2)",
|
|
351
|
+
componentFill: ((d = a.wardley) == null ? void 0 : d.componentFill) ?? "#fff",
|
|
352
|
+
componentStroke: ((m = a.wardley) == null ? void 0 : m.componentStroke) ?? "#000",
|
|
353
|
+
componentLabelColor: ((v = a.wardley) == null ? void 0 : v.componentLabelColor) ?? a.primaryTextColor ?? "#222",
|
|
354
|
+
linkStroke: ((g = a.wardley) == null ? void 0 : g.linkStroke) ?? "#000",
|
|
355
|
+
evolutionStroke: ((L = a.wardley) == null ? void 0 : L.evolutionStroke) ?? "#dc3545",
|
|
356
|
+
annotationStroke: ((M = a.wardley) == null ? void 0 : M.annotationStroke) ?? "#000",
|
|
357
|
+
annotationTextColor: ((k = a.wardley) == null ? void 0 : k.annotationTextColor) ?? a.primaryTextColor ?? "#222",
|
|
358
|
+
annotationFill: ((N = a.wardley) == null ? void 0 : N.annotationFill) ?? a.background ?? "#fff"
|
|
359
|
+
};
|
|
360
|
+
}, "getTheme"), _t = /* @__PURE__ */ y(() => {
|
|
361
|
+
const a = V()["wardley-beta"];
|
|
362
|
+
return {
|
|
363
|
+
width: (a == null ? void 0 : a.width) ?? 900,
|
|
364
|
+
height: (a == null ? void 0 : a.height) ?? 600,
|
|
365
|
+
padding: (a == null ? void 0 : a.padding) ?? 48,
|
|
366
|
+
nodeRadius: (a == null ? void 0 : a.nodeRadius) ?? 6,
|
|
367
|
+
nodeLabelOffset: (a == null ? void 0 : a.nodeLabelOffset) ?? 8,
|
|
368
|
+
axisFontSize: (a == null ? void 0 : a.axisFontSize) ?? 12,
|
|
369
|
+
labelFontSize: (a == null ? void 0 : a.labelFontSize) ?? 10,
|
|
370
|
+
showGrid: (a == null ? void 0 : a.showGrid) ?? !1,
|
|
371
|
+
useMaxWidth: (a == null ? void 0 : a.useMaxWidth) ?? !0
|
|
372
|
+
};
|
|
373
|
+
}, "getConfigValues"), Zt = /* @__PURE__ */ y((a, o, e, p) => {
|
|
374
|
+
var J, K;
|
|
375
|
+
et.debug(`Rendering Wardley map
|
|
376
|
+
` + a);
|
|
377
|
+
const r = _t(), d = Vt(), m = r.nodeRadius * 1.6, v = p.db, g = v.getWardleyData(), L = v.getDiagramTitle(), M = ((J = g.size) == null ? void 0 : J.width) ?? r.width, k = ((K = g.size) == null ? void 0 : K.height) ?? r.height, N = Bt(o);
|
|
378
|
+
N.selectAll("*").remove(), Ft(N, k, M, r.useMaxWidth), N.attr("viewBox", `0 0 ${M} ${k}`);
|
|
379
|
+
const P = N.append("g").attr("class", "wardley-map"), q = N.append("defs");
|
|
380
|
+
q.append("marker").attr("id", `arrow-${o}`).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerWidth", 6).attr("markerHeight", 6).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("fill", d.evolutionStroke).attr("stroke", "none"), q.append("marker").attr("id", `link-arrow-end-${o}`).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerWidth", 5).attr("markerHeight", 5).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("fill", d.linkStroke).attr("stroke", "none"), q.append("marker").attr("id", `link-arrow-start-${o}`).attr("viewBox", "0 0 10 10").attr("refX", 1).attr("refY", 5).attr("markerWidth", 5).attr("markerHeight", 5).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 z").attr("fill", d.linkStroke).attr("stroke", "none"), P.append("rect").attr("class", "wardley-background").attr("width", M).attr("height", k).attr("fill", d.backgroundColor);
|
|
381
|
+
const B = M - r.padding * 2, F = k - r.padding * 2;
|
|
382
|
+
L && P.append("text").attr("class", "wardley-title").attr("x", M / 2).attr("y", r.padding / 2).attr("fill", d.axisTextColor).attr("font-size", r.axisFontSize * 1.05).attr("font-weight", "bold").attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(L);
|
|
383
|
+
const T = /* @__PURE__ */ y((t) => r.padding + t / 100 * B, "projectX"), A = /* @__PURE__ */ y((t) => k - r.padding - t / 100 * F, "projectY"), O = P.append("g").attr("class", "wardley-axes");
|
|
384
|
+
O.append("line").attr("x1", r.padding).attr("x2", M - r.padding).attr("y1", k - r.padding).attr("y2", k - r.padding).attr("stroke", d.axisColor).attr("stroke-width", 1), O.append("line").attr("x1", r.padding).attr("x2", r.padding).attr("y1", r.padding).attr("y2", k - r.padding).attr("stroke", d.axisColor).attr("stroke-width", 1);
|
|
385
|
+
const kt = g.axes.xLabel ?? "Evolution", bt = g.axes.yLabel ?? "Visibility";
|
|
386
|
+
O.append("text").attr("class", "wardley-axis-label wardley-axis-label-x").attr("x", r.padding + B / 2).attr("y", k - r.padding / 4).attr("fill", d.axisTextColor).attr("font-size", r.axisFontSize).attr("font-weight", "bold").attr("text-anchor", "middle").text(kt), O.append("text").attr("class", "wardley-axis-label wardley-axis-label-y").attr("x", r.padding / 3).attr("y", r.padding + F / 2).attr("fill", d.axisTextColor).attr("font-size", r.axisFontSize).attr("font-weight", "bold").attr("text-anchor", "middle").attr(
|
|
387
|
+
"transform",
|
|
388
|
+
`rotate(-90 ${r.padding / 3} ${r.padding + F / 2})`
|
|
389
|
+
).text(bt);
|
|
390
|
+
const R = g.axes.stages && g.axes.stages.length > 0 ? g.axes.stages : jt;
|
|
391
|
+
if (R.length > 0) {
|
|
392
|
+
const t = P.append("g").attr("class", "wardley-stages"), n = g.axes.stageBoundaries, s = [];
|
|
393
|
+
if (n && n.length === R.length) {
|
|
394
|
+
let i = 0;
|
|
395
|
+
n.forEach((h) => {
|
|
396
|
+
s.push({ start: i, end: h }), i = h;
|
|
397
|
+
});
|
|
398
|
+
} else {
|
|
399
|
+
const i = 1 / R.length;
|
|
400
|
+
R.forEach((h, l) => {
|
|
401
|
+
s.push({
|
|
402
|
+
start: l * i,
|
|
403
|
+
end: (l + 1) * i
|
|
404
|
+
});
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
R.forEach((i, h) => {
|
|
408
|
+
const l = s[h], x = r.padding + l.start * B, f = r.padding + l.end * B, u = (x + f) / 2;
|
|
409
|
+
h > 0 && t.append("line").attr("x1", x).attr("x2", x).attr("y1", r.padding).attr("y2", k - r.padding).attr("stroke", "#000").attr("stroke-width", 1).attr("stroke-dasharray", "5 5").attr("opacity", 0.8), t.append("text").attr("class", "wardley-stage-label").attr("x", u).attr("y", k - r.padding / 1.5).attr("fill", d.axisTextColor).attr("font-size", r.axisFontSize - 2).attr("text-anchor", "middle").text(i);
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
if (r.showGrid) {
|
|
413
|
+
const t = P.append("g").attr("class", "wardley-grid");
|
|
414
|
+
for (let n = 1; n < 4; n++) {
|
|
415
|
+
const s = n / 4, i = r.padding + B * s;
|
|
416
|
+
t.append("line").attr("x1", i).attr("x2", i).attr("y1", r.padding).attr("y2", k - r.padding).attr("stroke", d.gridColor).attr("stroke-dasharray", "2 6"), t.append("line").attr("x1", r.padding).attr("x2", M - r.padding).attr("y1", k - r.padding - F * s).attr("y2", k - r.padding - F * s).attr("stroke", d.gridColor).attr("stroke-dasharray", "2 6");
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
const c = /* @__PURE__ */ new Map();
|
|
420
|
+
if (g.nodes.forEach((t) => {
|
|
421
|
+
c.set(t.id, {
|
|
422
|
+
x: T(t.x),
|
|
423
|
+
y: A(t.y),
|
|
424
|
+
node: t
|
|
425
|
+
});
|
|
426
|
+
}), g.pipelines.length > 0) {
|
|
427
|
+
const t = P.append("g").attr("class", "wardley-pipelines"), n = P.append("g").attr("class", "wardley-pipeline-links");
|
|
428
|
+
g.pipelines.forEach((s) => {
|
|
429
|
+
if (s.componentIds.length === 0)
|
|
430
|
+
return;
|
|
431
|
+
const i = s.componentIds.map((f) => ({ id: f, pos: c.get(f), node: g.nodes.find((u) => u.id === f) })).filter((f) => f.pos && f.node).sort((f, u) => f.node.x - u.node.x);
|
|
432
|
+
for (let f = 0; f < i.length - 1; f++) {
|
|
433
|
+
const u = i[f], w = i[f + 1];
|
|
434
|
+
n.append("line").attr("class", "wardley-pipeline-evolution-link").attr("x1", u.pos.x).attr("y1", u.pos.y).attr("x2", w.pos.x).attr("y2", w.pos.y).attr("stroke", d.linkStroke).attr("stroke-width", 1).attr("stroke-dasharray", "4 4");
|
|
435
|
+
}
|
|
436
|
+
let h = 1 / 0, l = -1 / 0, x = 0;
|
|
437
|
+
if (s.componentIds.forEach((f) => {
|
|
438
|
+
const u = c.get(f);
|
|
439
|
+
u && (h = Math.min(h, u.x), l = Math.max(l, u.x), x = u.y);
|
|
440
|
+
}), h !== 1 / 0 && l !== -1 / 0) {
|
|
441
|
+
const u = r.nodeRadius * 4, w = x - u / 2, S = c.get(s.nodeId);
|
|
442
|
+
if (S) {
|
|
443
|
+
const z = (h + l) / 2;
|
|
444
|
+
S.x = z, S.y = w - m / 6;
|
|
445
|
+
}
|
|
446
|
+
t.append("rect").attr("class", "wardley-pipeline-box").attr("x", h - 15).attr("y", w).attr("width", l - h + 15 * 2).attr("height", u).attr("fill", "none").attr("stroke", d.axisColor).attr("stroke-width", 1.5).attr("rx", 4).attr("ry", 4);
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
const _ = P.append("g").attr("class", "wardley-links"), Z = /* @__PURE__ */ new Map();
|
|
451
|
+
g.pipelines.forEach((t) => {
|
|
452
|
+
Z.set(t.nodeId, new Set(t.componentIds));
|
|
453
|
+
});
|
|
454
|
+
const U = g.links.filter((t) => {
|
|
455
|
+
if (!c.has(t.source) || !c.has(t.target))
|
|
456
|
+
return !1;
|
|
457
|
+
const n = Z.get(t.target);
|
|
458
|
+
return !(n != null && n.has(t.source));
|
|
459
|
+
});
|
|
460
|
+
_.selectAll("line").data(U).enter().append("line").attr("class", (t) => `wardley-link${t.dashed ? " wardley-link--dashed" : ""}`).attr("x1", (t) => {
|
|
461
|
+
const n = c.get(t.source), s = c.get(t.target), h = g.nodes.find((u) => u.id === t.source).isPipelineParent ? m / Math.sqrt(2) : r.nodeRadius, l = s.x - n.x, x = s.y - n.y, f = Math.sqrt(l * l + x * x);
|
|
462
|
+
return n.x + l / f * h;
|
|
463
|
+
}).attr("y1", (t) => {
|
|
464
|
+
const n = c.get(t.source), s = c.get(t.target), h = g.nodes.find((u) => u.id === t.source).isPipelineParent ? m / Math.sqrt(2) : r.nodeRadius, l = s.x - n.x, x = s.y - n.y, f = Math.sqrt(l * l + x * x);
|
|
465
|
+
return n.y + x / f * h;
|
|
466
|
+
}).attr("x2", (t) => {
|
|
467
|
+
const n = c.get(t.source), s = c.get(t.target), h = g.nodes.find((u) => u.id === t.target).isPipelineParent ? m / Math.sqrt(2) : r.nodeRadius, l = n.x - s.x, x = n.y - s.y, f = Math.sqrt(l * l + x * x);
|
|
468
|
+
return s.x + l / f * h;
|
|
469
|
+
}).attr("y2", (t) => {
|
|
470
|
+
const n = c.get(t.source), s = c.get(t.target), h = g.nodes.find((u) => u.id === t.target).isPipelineParent ? m / Math.sqrt(2) : r.nodeRadius, l = n.x - s.x, x = n.y - s.y, f = Math.sqrt(l * l + x * x);
|
|
471
|
+
return s.y + x / f * h;
|
|
472
|
+
}).attr("stroke", d.linkStroke).attr("stroke-width", 1).attr("stroke-dasharray", (t) => t.dashed ? "6 6" : null).attr("marker-end", (t) => t.flow === "forward" || t.flow === "bidirectional" ? `url(#link-arrow-end-${o})` : null).attr("marker-start", (t) => t.flow === "backward" || t.flow === "bidirectional" ? `url(#link-arrow-start-${o})` : null), _.selectAll("text").data(U.filter((t) => t.label)).enter().append("text").attr("class", "wardley-link-label").attr("x", (t) => {
|
|
473
|
+
const n = c.get(t.source), s = c.get(t.target), i = (n.x + s.x) / 2, h = s.y - n.y, l = s.x - n.x, x = Math.sqrt(l * l + h * h), f = 8, u = h / x;
|
|
474
|
+
return i + u * f;
|
|
475
|
+
}).attr("y", (t) => {
|
|
476
|
+
const n = c.get(t.source), s = c.get(t.target), i = (n.y + s.y) / 2, h = s.x - n.x, l = s.y - n.y, x = Math.sqrt(h * h + l * l), f = 8, u = -h / x;
|
|
477
|
+
return i + u * f;
|
|
478
|
+
}).attr("fill", d.axisTextColor).attr("font-size", r.labelFontSize).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("transform", (t) => {
|
|
479
|
+
const n = c.get(t.source), s = c.get(t.target), i = (n.x + s.x) / 2, h = (n.y + s.y) / 2, l = s.x - n.x, x = s.y - n.y, f = Math.sqrt(l * l + x * x), u = 8, w = x / f, S = -l / f, z = i + w * u, W = h + S * u;
|
|
480
|
+
let Y = Math.atan2(x, l) * 180 / Math.PI;
|
|
481
|
+
return (Y > 90 || Y < -90) && (Y += 180), `rotate(${Y} ${z} ${W})`;
|
|
482
|
+
}).text((t) => t.label);
|
|
483
|
+
const $t = P.append("g").attr("class", "wardley-trends"), vt = g.trends.map((t) => {
|
|
484
|
+
const n = c.get(t.nodeId);
|
|
485
|
+
if (!n)
|
|
486
|
+
return null;
|
|
487
|
+
const s = T(t.targetX), i = A(t.targetY), h = s - n.x, l = i - n.y, x = Math.sqrt(h * h + l * l), f = r.nodeRadius + 2, u = x > f ? s - h / x * f : s, w = x > f ? i - l / x * f : i;
|
|
488
|
+
return {
|
|
489
|
+
origin: n,
|
|
490
|
+
targetX: s,
|
|
491
|
+
targetY: i,
|
|
492
|
+
adjustedX2: u,
|
|
493
|
+
adjustedY2: w
|
|
494
|
+
};
|
|
495
|
+
}).filter((t) => t !== null);
|
|
496
|
+
$t.selectAll("line").data(vt).enter().append("line").attr("class", "wardley-trend").attr("x1", (t) => t.origin.x).attr("y1", (t) => t.origin.y).attr("x2", (t) => t.adjustedX2).attr("y2", (t) => t.adjustedY2).attr("stroke", d.evolutionStroke).attr("stroke-width", 1).attr("stroke-dasharray", "4 4").attr("marker-end", `url(#arrow-${o})`);
|
|
497
|
+
const C = P.append("g").attr("class", "wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr(
|
|
498
|
+
"class",
|
|
499
|
+
(t) => ["wardley-node", t.className ? `wardley-node--${t.className}` : ""].filter(Boolean).join(" ")
|
|
500
|
+
);
|
|
501
|
+
C.filter((t) => t.sourceStrategy === "outsource").append("circle").attr("class", "wardley-outsource-overlay").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", r.nodeRadius * 2).attr("fill", "#666").attr("stroke", d.componentStroke).attr("stroke-width", 1), C.filter((t) => t.sourceStrategy === "buy").append("circle").attr("class", "wardley-buy-overlay").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", r.nodeRadius * 2).attr("fill", "#ccc").attr("stroke", d.componentStroke).attr("stroke-width", 1), C.filter((t) => t.sourceStrategy === "build").append("circle").attr("class", "wardley-build-overlay").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", r.nodeRadius * 2).attr("fill", "#eee").attr("stroke", "#000").attr("stroke-width", 1);
|
|
502
|
+
const X = C.filter((t) => t.sourceStrategy === "market");
|
|
503
|
+
X.append("circle").attr("class", "wardley-market-overlay").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", r.nodeRadius * 2).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 1), C.filter(
|
|
504
|
+
(t) => !t.isPipelineParent && t.sourceStrategy !== "market" && t.className !== "anchor"
|
|
505
|
+
).append("circle").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y).attr("r", r.nodeRadius).attr("fill", d.componentFill).attr("stroke", d.componentStroke).attr("stroke-width", 1);
|
|
506
|
+
const H = r.nodeRadius * 0.7, $ = r.nodeRadius * 1.2;
|
|
507
|
+
if (X.append("line").attr("class", "wardley-market-line").attr("x1", (t) => c.get(t.id).x).attr("y1", (t) => c.get(t.id).y - $).attr("x2", (t) => c.get(t.id).x - $ * Math.cos(Math.PI / 6)).attr("y2", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("stroke", d.componentStroke).attr("stroke-width", 1), X.append("line").attr("class", "wardley-market-line").attr("x1", (t) => c.get(t.id).x - $ * Math.cos(Math.PI / 6)).attr("y1", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("x2", (t) => c.get(t.id).x + $ * Math.cos(Math.PI / 6)).attr("y2", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("stroke", d.componentStroke).attr("stroke-width", 1), X.append("line").attr("class", "wardley-market-line").attr("x1", (t) => c.get(t.id).x + $ * Math.cos(Math.PI / 6)).attr("y1", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("x2", (t) => c.get(t.id).x).attr("y2", (t) => c.get(t.id).y - $).attr("stroke", d.componentStroke).attr("stroke-width", 1), X.append("circle").attr("class", "wardley-market-dot").attr("cx", (t) => c.get(t.id).x).attr("cy", (t) => c.get(t.id).y - $).attr("r", H).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 2), X.append("circle").attr("class", "wardley-market-dot").attr("cx", (t) => c.get(t.id).x - $ * Math.cos(Math.PI / 6)).attr("cy", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("r", H).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 2), X.append("circle").attr("class", "wardley-market-dot").attr("cx", (t) => c.get(t.id).x + $ * Math.cos(Math.PI / 6)).attr("cy", (t) => c.get(t.id).y + $ * Math.sin(Math.PI / 6)).attr("r", H).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 2), C.filter((t) => t.isPipelineParent === !0).append("rect").attr("x", (t) => c.get(t.id).x - m / 2).attr("y", (t) => c.get(t.id).y - m / 2).attr("width", m).attr("height", m).attr("fill", d.componentFill).attr("stroke", d.componentStroke).attr("stroke-width", 1), C.filter((t) => t.inertia === !0).append("line").attr("class", "wardley-inertia").attr("x1", (t) => {
|
|
508
|
+
const n = c.get(t.id);
|
|
509
|
+
let s = t.isPipelineParent ? m / 2 + 15 : r.nodeRadius + 15;
|
|
510
|
+
return t.sourceStrategy && (s += r.nodeRadius + 10), n.x + s;
|
|
511
|
+
}).attr("y1", (t) => {
|
|
512
|
+
const n = c.get(t.id), s = t.isPipelineParent ? m : r.nodeRadius * 2;
|
|
513
|
+
return n.y - s / 2;
|
|
514
|
+
}).attr("x2", (t) => {
|
|
515
|
+
const n = c.get(t.id);
|
|
516
|
+
let s = t.isPipelineParent ? m / 2 + 15 : r.nodeRadius + 15;
|
|
517
|
+
return t.sourceStrategy && (s += r.nodeRadius + 10), n.x + s;
|
|
518
|
+
}).attr("y2", (t) => {
|
|
519
|
+
const n = c.get(t.id), s = t.isPipelineParent ? m : r.nodeRadius * 2;
|
|
520
|
+
return n.y + s / 2;
|
|
521
|
+
}).attr("stroke", d.componentStroke).attr("stroke-width", 6), C.append("text").attr("x", (t) => {
|
|
522
|
+
const n = c.get(t.id);
|
|
523
|
+
if (t.className === "anchor")
|
|
524
|
+
return t.labelOffsetX !== void 0 ? n.x + t.labelOffsetX : n.x;
|
|
525
|
+
let s = r.nodeLabelOffset;
|
|
526
|
+
t.sourceStrategy && t.labelOffsetX === void 0 && (s += 10);
|
|
527
|
+
const i = t.labelOffsetX ?? s;
|
|
528
|
+
return n.x + i;
|
|
529
|
+
}).attr("y", (t) => {
|
|
530
|
+
const n = c.get(t.id);
|
|
531
|
+
if (t.className === "anchor")
|
|
532
|
+
return t.labelOffsetY !== void 0 ? n.y + t.labelOffsetY : n.y - 3;
|
|
533
|
+
let s = -r.nodeLabelOffset;
|
|
534
|
+
t.sourceStrategy && t.labelOffsetY === void 0 && (s -= 10);
|
|
535
|
+
const i = t.labelOffsetY ?? s;
|
|
536
|
+
return n.y + i;
|
|
537
|
+
}).attr("class", "wardley-node-label").attr("fill", (t) => t.className === "evolved" ? d.evolutionStroke : t.className === "anchor" ? "#000" : d.componentLabelColor).attr("font-size", r.labelFontSize).attr("font-weight", (t) => t.className === "anchor" ? "bold" : "normal").attr("text-anchor", (t) => t.className === "anchor" ? "middle" : "start").attr("dominant-baseline", (t) => t.className === "anchor" ? "middle" : "auto").text((t) => t.label), g.annotations.length > 0) {
|
|
538
|
+
const t = P.append("g").attr("class", "wardley-annotations");
|
|
539
|
+
if (g.annotations.forEach((n) => {
|
|
540
|
+
const s = n.coordinates.map((i) => ({
|
|
541
|
+
x: T(i.x),
|
|
542
|
+
y: A(i.y)
|
|
543
|
+
}));
|
|
544
|
+
if (s.length > 1)
|
|
545
|
+
for (let i = 0; i < s.length - 1; i++)
|
|
546
|
+
t.append("line").attr("class", "wardley-annotation-line").attr("x1", s[i].x).attr("y1", s[i].y).attr("x2", s[i + 1].x).attr("y2", s[i + 1].y).attr("stroke", d.axisColor).attr("stroke-width", 1.5).attr("stroke-dasharray", "4 4");
|
|
547
|
+
s.forEach((i) => {
|
|
548
|
+
const h = t.append("g").attr("class", "wardley-annotation");
|
|
549
|
+
h.append("circle").attr("cx", i.x).attr("cy", i.y).attr("r", 10).attr("fill", "white").attr("stroke", d.axisColor).attr("stroke-width", 1.5), h.append("text").attr("x", i.x).attr("y", i.y).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", 10).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(n.number);
|
|
550
|
+
});
|
|
551
|
+
}), g.annotationsBox) {
|
|
552
|
+
let n = T(g.annotationsBox.x), s = A(g.annotationsBox.y);
|
|
553
|
+
const i = 10, h = 16, l = 11, x = t.append("g").attr("class", "wardley-annotations-box"), f = [...g.annotations].filter((w) => w.text).sort((w, S) => w.number - S.number), u = [];
|
|
554
|
+
if (f.forEach((w, S) => {
|
|
555
|
+
const z = x.append("text").attr("x", n + i).attr("y", s + i + (S + 1) * h).attr("font-size", l).attr("fill", d.axisTextColor).attr("text-anchor", "start").attr("dominant-baseline", "middle").text(`${w.number}. ${w.text}`);
|
|
556
|
+
u.push(z);
|
|
557
|
+
}), u.length > 0) {
|
|
558
|
+
let w = 0, S = 0;
|
|
559
|
+
u.forEach((j) => {
|
|
560
|
+
const D = j.node(), Nt = D.getComputedTextLength();
|
|
561
|
+
w = Math.max(w, Nt);
|
|
562
|
+
const Ct = D.getBBox();
|
|
563
|
+
S = Math.max(S, Ct.height);
|
|
564
|
+
});
|
|
565
|
+
const z = w + i * 2 + 105, W = f.length * h + i * 2 + S / 2, Y = r.padding, Pt = M - r.padding - z, St = r.padding, Mt = k - r.padding - W;
|
|
566
|
+
n = Math.max(Y, Math.min(n, Pt)), s = Math.max(St, Math.min(s, Mt)), u.forEach((j, D) => {
|
|
567
|
+
j.attr("x", n + i).attr("y", s + i + (D + 1) * h);
|
|
568
|
+
}), x.insert("rect", "text").attr("x", n).attr("y", s).attr("width", z).attr("height", W).attr("fill", "white").attr("stroke", d.axisColor).attr("stroke-width", 1.5).attr("rx", 4).attr("ry", 4);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
if (g.notes.length > 0) {
|
|
573
|
+
const t = P.append("g").attr("class", "wardley-notes");
|
|
574
|
+
g.notes.forEach((n) => {
|
|
575
|
+
const s = T(n.x), i = A(n.y);
|
|
576
|
+
t.append("text").attr("x", s).attr("y", i).attr("text-anchor", "start").attr("font-size", 11).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(n.text);
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
if (g.accelerators.length > 0) {
|
|
580
|
+
const t = P.append("g").attr("class", "wardley-accelerators");
|
|
581
|
+
g.accelerators.forEach((n) => {
|
|
582
|
+
const s = T(n.x), i = A(n.y), h = 60, l = 30, x = 20, f = `
|
|
583
|
+
M ${s} ${i - l / 2}
|
|
584
|
+
L ${s + h - x} ${i - l / 2}
|
|
585
|
+
L ${s + h - x} ${i - l / 2 - 8}
|
|
586
|
+
L ${s + h} ${i}
|
|
587
|
+
L ${s + h - x} ${i + l / 2 + 8}
|
|
588
|
+
L ${s + h - x} ${i + l / 2}
|
|
589
|
+
L ${s} ${i + l / 2}
|
|
590
|
+
Z
|
|
591
|
+
`;
|
|
592
|
+
t.append("path").attr("d", f).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 1), t.append("text").attr("x", s + h / 2).attr("y", i + l / 2 + 15).attr("text-anchor", "middle").attr("font-size", 10).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(n.name);
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
if (g.deaccelerators.length > 0) {
|
|
596
|
+
const t = P.append("g").attr("class", "wardley-deaccelerators");
|
|
597
|
+
g.deaccelerators.forEach((n) => {
|
|
598
|
+
const s = T(n.x), i = A(n.y), h = 60, l = 30, x = 20, f = `
|
|
599
|
+
M ${s + h} ${i - l / 2}
|
|
600
|
+
L ${s + x} ${i - l / 2}
|
|
601
|
+
L ${s + x} ${i - l / 2 - 8}
|
|
602
|
+
L ${s} ${i}
|
|
603
|
+
L ${s + x} ${i + l / 2 + 8}
|
|
604
|
+
L ${s + x} ${i + l / 2}
|
|
605
|
+
L ${s + h} ${i + l / 2}
|
|
606
|
+
Z
|
|
607
|
+
`;
|
|
608
|
+
t.append("path").attr("d", f).attr("fill", "white").attr("stroke", d.componentStroke).attr("stroke-width", 1), t.append("text").attr("x", s + h / 2).attr("y", i + l / 2 + 15).attr("text-anchor", "middle").attr("font-size", 10).attr("fill", d.axisTextColor).attr("font-weight", "bold").text(n.name);
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
}, "draw"), Ut = {
|
|
612
|
+
draw: Zt
|
|
613
|
+
}, Jt = /* @__PURE__ */ y(({
|
|
614
|
+
wardley: a
|
|
615
|
+
} = {}) => {
|
|
616
|
+
const o = Yt(), e = It(), p = Q(o, e.themeVariables), r = Q(p.wardley, a);
|
|
617
|
+
return `
|
|
618
|
+
.wardley-background {
|
|
619
|
+
fill: ${r.backgroundColor};
|
|
620
|
+
}
|
|
621
|
+
.wardley-axes line, .wardley-axes path {
|
|
622
|
+
stroke: ${r.axisColor};
|
|
623
|
+
}
|
|
624
|
+
.wardley-axis-label {
|
|
625
|
+
fill: ${r.axisTextColor};
|
|
626
|
+
}
|
|
627
|
+
.wardley-stage-label {
|
|
628
|
+
fill: ${r.axisTextColor};
|
|
629
|
+
}
|
|
630
|
+
.wardley-grid line {
|
|
631
|
+
stroke: ${r.gridColor};
|
|
632
|
+
}
|
|
633
|
+
.wardley-node circle {
|
|
634
|
+
fill: ${r.componentFill};
|
|
635
|
+
stroke: ${r.componentStroke};
|
|
636
|
+
}
|
|
637
|
+
.wardley-node-label {
|
|
638
|
+
fill: ${r.componentLabelColor};
|
|
639
|
+
}
|
|
640
|
+
.wardley-link {
|
|
641
|
+
stroke: ${r.linkStroke};
|
|
642
|
+
}
|
|
643
|
+
.wardley-link--dashed {
|
|
644
|
+
stroke-dasharray: 4 4;
|
|
645
|
+
}
|
|
646
|
+
.wardley-link-label {
|
|
647
|
+
fill: ${r.axisTextColor};
|
|
648
|
+
}
|
|
649
|
+
.wardley-trend line {
|
|
650
|
+
stroke: ${r.evolutionStroke};
|
|
651
|
+
}
|
|
652
|
+
.wardley-annotation-line {
|
|
653
|
+
stroke: ${r.annotationStroke};
|
|
654
|
+
}
|
|
655
|
+
.wardley-annotation circle {
|
|
656
|
+
fill: ${r.annotationFill};
|
|
657
|
+
stroke: ${r.annotationStroke};
|
|
658
|
+
}
|
|
659
|
+
.wardley-annotation text {
|
|
660
|
+
fill: ${r.annotationTextColor};
|
|
661
|
+
}
|
|
662
|
+
.wardley-annotations-box rect {
|
|
663
|
+
fill: ${r.annotationFill};
|
|
664
|
+
stroke: ${r.annotationStroke};
|
|
665
|
+
}
|
|
666
|
+
.wardley-annotations-box text {
|
|
667
|
+
fill: ${r.annotationTextColor};
|
|
668
|
+
}
|
|
669
|
+
.wardley-pipeline-box {
|
|
670
|
+
stroke: ${r.componentStroke};
|
|
671
|
+
}
|
|
672
|
+
.wardley-notes text {
|
|
673
|
+
fill: ${r.axisTextColor};
|
|
674
|
+
}
|
|
675
|
+
`;
|
|
676
|
+
}, "styles"), ae = {
|
|
677
|
+
parser: at,
|
|
678
|
+
db: Ht,
|
|
679
|
+
renderer: Ut,
|
|
680
|
+
styles: Jt
|
|
681
|
+
};
|
|
682
|
+
export {
|
|
683
|
+
ae as diagram
|
|
684
|
+
};
|