@wzh-/ai-chat-example 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/index.css +1 -1
- package/dist/js/_baseFor.js +309 -0
- package/dist/js/architecture-U656AL7Q.js +3 -4
- package/dist/js/architectureDiagram-VXUJARFQ.js +53 -54
- package/dist/js/blockDiagram-VD42YOAC.js +449 -449
- package/dist/js/c4Diagram-YG6GDRKO.js +87 -87
- package/dist/js/chunk-B4BG7PRW.js +160 -160
- package/dist/js/chunk-DI55MBZ5.js +98 -98
- package/dist/js/chunk-FPAJGGOC.js +1373 -197
- package/dist/js/chunk-JA3XYJ7Z.js +36 -36
- package/dist/js/chunk-JZLCHNYA.js +1461 -1461
- package/dist/js/chunk-N4CR4FBY.js +5 -5
- package/dist/js/chunk-QXUST7PY.js +226 -226
- package/dist/js/chunk-S3R3BYOJ.js +602 -454
- package/dist/js/classDiagram-2ON5EDUG.js +2 -2
- package/dist/js/classDiagram-v2-WZHVMYZB.js +2 -2
- package/dist/js/clone.js +1 -1
- package/dist/js/dagre-6UL2VRFP.js +152 -152
- package/dist/js/dagre.js +1034 -933
- package/dist/js/diagram-PSM6KHXK.js +58 -59
- package/dist/js/diagram-QEK2KX5R.js +53 -54
- package/dist/js/diagram-S2PKOQOG.js +24 -25
- package/dist/js/erDiagram-Q2GNP2WA.js +96 -96
- package/dist/js/flatten.js +34 -0
- package/dist/js/flowDiagram-NV44I4VS.js +166 -166
- package/dist/js/ganttDiagram-JELNMOA3.js +916 -916
- package/dist/js/gitGraph-F6HP7TQM.js +3 -4
- package/dist/js/gitGraphDiagram-NY62KEGX.js +373 -374
- package/dist/js/graphlib.js +264 -143
- package/dist/js/index.js +3280 -3266
- package/dist/js/info-NVLQJR56.js +3 -4
- package/dist/js/infoDiagram-WHAUD3N6.js +3 -4
- package/dist/js/isEmpty.js +18 -18
- package/dist/js/kanban-definition-3W4ZIXB7.js +2 -2
- package/dist/js/line.js +7 -7
- package/dist/js/mermaid.core.js +65 -65
- package/dist/js/mindmap-definition-VGOIOE7T.js +2 -2
- package/dist/js/packet-BFZMPI3H.js +3 -4
- package/dist/js/pie-7BOR55EZ.js +3 -4
- package/dist/js/pieDiagram-ADFJNKIX.js +39 -40
- package/dist/js/radar-NHE76QYJ.js +3 -4
- package/dist/js/reduce.js +451 -0
- package/dist/js/requirementDiagram-UZGBJVZJ.js +16 -16
- package/dist/js/sequenceDiagram-WL72ISMW.js +731 -731
- package/dist/js/stateDiagram-FKZM4ZOC.js +83 -83
- package/dist/js/stateDiagram-v2-4FDKWEC3.js +2 -2
- package/dist/js/treemap-KMMF4GRG.js +3 -4
- package/dist/js/xychartDiagram-PRI3JC2R.js +25 -25
- package/package.json +14 -7
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import "./marked.esm.js";
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
2
|
+
import "./reduce.js";
|
|
3
|
+
import "./_baseFor.js";
|
|
4
4
|
import "./isEmpty.js";
|
|
5
|
-
import { E as basis_default, a as decodeEntities, g as utils_default, l as getStylesFromArray } from "./chunk-S3R3BYOJ.js";
|
|
6
|
-
import { t as clone_default } from "./clone.js";
|
|
7
|
-
import { t as Graph } from "./graphlib.js";
|
|
8
5
|
import { g as log, h as __name, p as select_default } from "./src.js";
|
|
9
6
|
import { E as getUrl, I as sanitizeText, a as clear, b as getConfig2, c as configureSvgSize, et as rgba_default, h as evaluate, s as common_default, y as getConfig } from "./chunk-ABZYJK2D.js";
|
|
10
7
|
import { t as channel_default } from "./channel.js";
|
|
11
8
|
import "./path.js";
|
|
12
9
|
import "./math.js";
|
|
13
10
|
import "./array.js";
|
|
11
|
+
import { U as basis_default, a as decodeEntities, g as utils_default, l as getStylesFromArray } from "./chunk-S3R3BYOJ.js";
|
|
14
12
|
import { t as line_default } from "./line.js";
|
|
15
13
|
import "./dist.js";
|
|
16
14
|
import { a as replaceIconSubstring, n as createText } from "./chunk-JA3XYJ7Z.js";
|
|
17
15
|
import { t as getIconStyles } from "./chunk-FMBD7UC4.js";
|
|
18
16
|
import { t as getLineFunctionsWithOffset } from "./chunk-HN2XXSSU.js";
|
|
19
17
|
import { t as getSubGraphTitleMargins } from "./chunk-CVBHYZKI.js";
|
|
18
|
+
import { t as Graph } from "./graphlib.js";
|
|
19
|
+
import { t as clone_default } from "./clone.js";
|
|
20
20
|
var parser = (function() {
|
|
21
21
|
var e = /* @__PURE__ */ __name(function(e, S, C, w) {
|
|
22
22
|
for (C ||= {}, w = e.length; w--; C[e[w]] = S);
|
|
23
23
|
return C;
|
|
24
|
-
}, "o"),
|
|
24
|
+
}, "o"), C = [1, 15], w = [1, 7], T = [1, 13], E = [1, 14], D = [1, 19], O = [1, 16], k = [1, 17], A = [1, 18], j = [8, 30], M = [
|
|
25
25
|
8,
|
|
26
26
|
10,
|
|
27
27
|
21,
|
|
@@ -370,21 +370,21 @@ var parser = (function() {
|
|
|
370
370
|
},
|
|
371
371
|
{ 1: [3] },
|
|
372
372
|
{
|
|
373
|
-
10:
|
|
373
|
+
10: C,
|
|
374
374
|
11: 3,
|
|
375
375
|
13: 4,
|
|
376
376
|
19: 5,
|
|
377
377
|
20: 6,
|
|
378
|
-
21:
|
|
378
|
+
21: w,
|
|
379
379
|
22: 8,
|
|
380
380
|
23: 9,
|
|
381
381
|
24: 10,
|
|
382
382
|
25: 11,
|
|
383
383
|
26: 12,
|
|
384
|
-
28:
|
|
385
|
-
29:
|
|
386
|
-
31:
|
|
387
|
-
39:
|
|
384
|
+
28: T,
|
|
385
|
+
29: E,
|
|
386
|
+
31: D,
|
|
387
|
+
39: O,
|
|
388
388
|
43: k,
|
|
389
389
|
46: A
|
|
390
390
|
},
|
|
@@ -399,12 +399,12 @@ var parser = (function() {
|
|
|
399
399
|
25: 11,
|
|
400
400
|
26: 12,
|
|
401
401
|
11: 21,
|
|
402
|
-
10:
|
|
403
|
-
21:
|
|
404
|
-
28:
|
|
405
|
-
29:
|
|
406
|
-
31:
|
|
407
|
-
39:
|
|
402
|
+
10: C,
|
|
403
|
+
21: w,
|
|
404
|
+
28: T,
|
|
405
|
+
29: E,
|
|
406
|
+
31: D,
|
|
407
|
+
39: O,
|
|
408
408
|
43: k,
|
|
409
409
|
46: A
|
|
410
410
|
}),
|
|
@@ -424,24 +424,24 @@ var parser = (function() {
|
|
|
424
424
|
{
|
|
425
425
|
19: 26,
|
|
426
426
|
26: 12,
|
|
427
|
-
31:
|
|
427
|
+
31: D
|
|
428
428
|
},
|
|
429
429
|
{
|
|
430
|
-
10:
|
|
430
|
+
10: C,
|
|
431
431
|
11: 27,
|
|
432
432
|
13: 4,
|
|
433
433
|
19: 5,
|
|
434
434
|
20: 6,
|
|
435
|
-
21:
|
|
435
|
+
21: w,
|
|
436
436
|
22: 8,
|
|
437
437
|
23: 9,
|
|
438
438
|
24: 10,
|
|
439
439
|
25: 11,
|
|
440
440
|
26: 12,
|
|
441
|
-
28:
|
|
442
|
-
29:
|
|
443
|
-
31:
|
|
444
|
-
39:
|
|
441
|
+
28: T,
|
|
442
|
+
29: E,
|
|
443
|
+
31: D,
|
|
444
|
+
39: O,
|
|
445
445
|
43: k,
|
|
446
446
|
46: A
|
|
447
447
|
},
|
|
@@ -460,13 +460,13 @@ var parser = (function() {
|
|
|
460
460
|
e(j, [2, 13]),
|
|
461
461
|
{
|
|
462
462
|
26: 35,
|
|
463
|
-
31:
|
|
463
|
+
31: D
|
|
464
464
|
},
|
|
465
465
|
{ 31: [2, 14] },
|
|
466
466
|
{ 17: [1, 36] },
|
|
467
467
|
e(F, [2, 24]),
|
|
468
468
|
{
|
|
469
|
-
10:
|
|
469
|
+
10: C,
|
|
470
470
|
11: 37,
|
|
471
471
|
13: 4,
|
|
472
472
|
14: 22,
|
|
@@ -474,16 +474,16 @@ var parser = (function() {
|
|
|
474
474
|
16: P,
|
|
475
475
|
19: 5,
|
|
476
476
|
20: 6,
|
|
477
|
-
21:
|
|
477
|
+
21: w,
|
|
478
478
|
22: 8,
|
|
479
479
|
23: 9,
|
|
480
480
|
24: 10,
|
|
481
481
|
25: 11,
|
|
482
482
|
26: 12,
|
|
483
|
-
28:
|
|
484
|
-
29:
|
|
485
|
-
31:
|
|
486
|
-
39:
|
|
483
|
+
28: T,
|
|
484
|
+
29: E,
|
|
485
|
+
31: D,
|
|
486
|
+
39: O,
|
|
487
487
|
43: k,
|
|
488
488
|
46: A
|
|
489
489
|
},
|
|
@@ -535,26 +535,26 @@ var parser = (function() {
|
|
|
535
535
|
}
|
|
536
536
|
}, "parseError"),
|
|
537
537
|
parse: /* @__PURE__ */ __name(function(e) {
|
|
538
|
-
var
|
|
538
|
+
var C = this, w = [0], T = [], E = [null], D = [], O = this.table, k = "", A = 0, j = 0, M = 0, N = 2, P = 1, F = D.slice.call(arguments, 1), I = Object.create(this.lexer), L = { yy: {} };
|
|
539
539
|
for (var R in this.yy) Object.prototype.hasOwnProperty.call(this.yy, R) && (L.yy[R] = this.yy[R]);
|
|
540
540
|
I.setInput(e, L.yy), L.yy.lexer = I, L.yy.parser = this, I.yylloc === void 0 && (I.yylloc = {});
|
|
541
541
|
var z = I.yylloc;
|
|
542
|
-
|
|
542
|
+
D.push(z);
|
|
543
543
|
var B = I.options && I.options.ranges;
|
|
544
544
|
typeof L.yy.parseError == "function" ? this.parseError = L.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
545
545
|
function V(e) {
|
|
546
|
-
|
|
546
|
+
w.length -= 2 * e, E.length -= e, D.length -= e;
|
|
547
547
|
}
|
|
548
548
|
__name(V, "popStack");
|
|
549
549
|
function H() {
|
|
550
|
-
var e =
|
|
551
|
-
return typeof e != "number" && (e instanceof Array && (
|
|
550
|
+
var e = T.pop() || I.lex() || P;
|
|
551
|
+
return typeof e != "number" && (e instanceof Array && (T = e, e = T.pop()), e = C.symbols_[e] || e), e;
|
|
552
552
|
}
|
|
553
553
|
__name(H, "lex");
|
|
554
554
|
for (var U, W, G, K, q, J = {}, Y, X, Z, Q;;) {
|
|
555
|
-
if (G =
|
|
555
|
+
if (G = w[w.length - 1], this.defaultActions[G] ? K = this.defaultActions[G] : (U ??= H(), K = O[G] && O[G][U]), K === void 0 || !K.length || !K[0]) {
|
|
556
556
|
var $ = "";
|
|
557
|
-
for (Y in Q = [],
|
|
557
|
+
for (Y in Q = [], O[G]) this.terminals_[Y] && Y > N && Q.push("'" + this.terminals_[Y] + "'");
|
|
558
558
|
$ = I.showPosition ? "Parse error on line " + (A + 1) + ":\n" + I.showPosition() + "\nExpecting " + Q.join(", ") + ", got '" + (this.terminals_[U] || U) + "'" : "Parse error on line " + (A + 1) + ": Unexpected " + (U == P ? "end of input" : "'" + (this.terminals_[U] || U) + "'"), this.parseError($, {
|
|
559
559
|
text: I.match,
|
|
560
560
|
token: this.terminals_[U] || U,
|
|
@@ -566,24 +566,24 @@ var parser = (function() {
|
|
|
566
566
|
if (K[0] instanceof Array && K.length > 1) throw Error("Parse Error: multiple actions possible at state: " + G + ", token: " + U);
|
|
567
567
|
switch (K[0]) {
|
|
568
568
|
case 1:
|
|
569
|
-
|
|
569
|
+
w.push(U), E.push(I.yytext), D.push(I.yylloc), w.push(K[1]), U = null, W ? (U = W, W = null) : (j = I.yyleng, k = I.yytext, A = I.yylineno, z = I.yylloc, M > 0 && M--);
|
|
570
570
|
break;
|
|
571
571
|
case 2:
|
|
572
|
-
if (X = this.productions_[K[1]][1], J.$ =
|
|
573
|
-
first_line:
|
|
574
|
-
last_line:
|
|
575
|
-
first_column:
|
|
576
|
-
last_column:
|
|
577
|
-
}, B && (J._$.range = [
|
|
572
|
+
if (X = this.productions_[K[1]][1], J.$ = E[E.length - X], J._$ = {
|
|
573
|
+
first_line: D[D.length - (X || 1)].first_line,
|
|
574
|
+
last_line: D[D.length - 1].last_line,
|
|
575
|
+
first_column: D[D.length - (X || 1)].first_column,
|
|
576
|
+
last_column: D[D.length - 1].last_column
|
|
577
|
+
}, B && (J._$.range = [D[D.length - (X || 1)].range[0], D[D.length - 1].range[1]]), q = this.performAction.apply(J, [
|
|
578
578
|
k,
|
|
579
579
|
j,
|
|
580
580
|
A,
|
|
581
581
|
L.yy,
|
|
582
582
|
K[1],
|
|
583
|
-
|
|
584
|
-
|
|
583
|
+
E,
|
|
584
|
+
D
|
|
585
585
|
].concat(F)), q !== void 0) return q;
|
|
586
|
-
X && (
|
|
586
|
+
X && (w = w.slice(0, -1 * X * 2), E = E.slice(0, -1 * X), D = D.slice(0, -1 * X)), w.push(this.productions_[K[1]][0]), E.push(J.$), D.push(J._$), Z = O[w[w.length - 2]][w[w.length - 1]], w.push(Z);
|
|
587
587
|
break;
|
|
588
588
|
case 3: return !0;
|
|
589
589
|
}
|
|
@@ -1182,38 +1182,38 @@ var block_default = parser, blockDatabase = /* @__PURE__ */ new Map(), edgeList
|
|
|
1182
1182
|
}
|
|
1183
1183
|
C.classes ||= [], C.classes.push(S);
|
|
1184
1184
|
});
|
|
1185
|
-
}, "setCssClass"), populateBlockDatabase = /* @__PURE__ */ __name((
|
|
1186
|
-
let
|
|
1187
|
-
for (let
|
|
1188
|
-
if (typeof E == "number" && E > 0 &&
|
|
1189
|
-
addStyleClass(
|
|
1185
|
+
}, "setCssClass"), populateBlockDatabase = /* @__PURE__ */ __name((S, C) => {
|
|
1186
|
+
let w = S.flat(), T = [], E = w.find((e) => e?.type === "column-setting")?.columns ?? -1;
|
|
1187
|
+
for (let S of w) {
|
|
1188
|
+
if (typeof E == "number" && E > 0 && S.type !== "column-setting" && typeof S.widthInColumns == "number" && S.widthInColumns > E && log.warn(`Block ${S.id} width ${S.widthInColumns} exceeds configured column width ${E}`), S.label &&= sanitizeText2(S.label), S.type === "classDef") {
|
|
1189
|
+
addStyleClass(S.id, S.css);
|
|
1190
1190
|
continue;
|
|
1191
1191
|
}
|
|
1192
|
-
if (
|
|
1193
|
-
setCssClass(
|
|
1192
|
+
if (S.type === "applyClass") {
|
|
1193
|
+
setCssClass(S.id, S?.styleClass ?? "");
|
|
1194
1194
|
continue;
|
|
1195
1195
|
}
|
|
1196
|
-
if (
|
|
1197
|
-
|
|
1196
|
+
if (S.type === "applyStyles") {
|
|
1197
|
+
S?.stylesStr && addStyle2Node(S.id, S?.stylesStr);
|
|
1198
1198
|
continue;
|
|
1199
1199
|
}
|
|
1200
|
-
if (
|
|
1201
|
-
else if (
|
|
1202
|
-
let
|
|
1203
|
-
edgeCount.set(
|
|
1200
|
+
if (S.type === "column-setting") C.columns = S.columns ?? -1;
|
|
1201
|
+
else if (S.type === "edge") {
|
|
1202
|
+
let e = (edgeCount.get(S.id) ?? 0) + 1;
|
|
1203
|
+
edgeCount.set(S.id, e), S.id = e + "-" + S.id, edgeList.push(S);
|
|
1204
1204
|
} else {
|
|
1205
|
-
|
|
1206
|
-
let
|
|
1207
|
-
if (
|
|
1208
|
-
let
|
|
1209
|
-
for (let C = 0; C <
|
|
1210
|
-
let
|
|
1211
|
-
|
|
1205
|
+
S.label || (S.type === "composite" ? S.label = "" : S.label = S.id);
|
|
1206
|
+
let e = blockDatabase.get(S.id);
|
|
1207
|
+
if (e === void 0 ? blockDatabase.set(S.id, S) : (S.type !== "na" && (e.type = S.type), S.label !== S.id && (e.label = S.label)), S.children && populateBlockDatabase(S.children, S), S.type === "space") {
|
|
1208
|
+
let e = S.width ?? 1;
|
|
1209
|
+
for (let C = 0; C < e; C++) {
|
|
1210
|
+
let e = clone_default(S);
|
|
1211
|
+
e.id = e.id + "-" + C, blockDatabase.set(e.id, e), T.push(e);
|
|
1212
1212
|
}
|
|
1213
|
-
} else
|
|
1213
|
+
} else e === void 0 && T.push(S);
|
|
1214
1214
|
}
|
|
1215
1215
|
}
|
|
1216
|
-
|
|
1216
|
+
C.children = T;
|
|
1217
1217
|
}, "populateBlockDatabase"), blocks = [], rootBlock = {
|
|
1218
1218
|
id: "root",
|
|
1219
1219
|
type: "composite",
|
|
@@ -1227,8 +1227,8 @@ var block_default = parser, blockDatabase = /* @__PURE__ */ new Map(), edgeList
|
|
|
1227
1227
|
columns: -1
|
|
1228
1228
|
}, blockDatabase = /* @__PURE__ */ new Map([["root", rootBlock]]), blocks = [], classes = /* @__PURE__ */ new Map(), edgeList = [], edgeCount = /* @__PURE__ */ new Map();
|
|
1229
1229
|
}, "clear");
|
|
1230
|
-
function typeStr2Type(
|
|
1231
|
-
switch (log.debug("typeStr2Type",
|
|
1230
|
+
function typeStr2Type(S) {
|
|
1231
|
+
switch (log.debug("typeStr2Type", S), S) {
|
|
1232
1232
|
case "[]": return "square";
|
|
1233
1233
|
case "()": return log.debug("we have a round"), "round";
|
|
1234
1234
|
case "(())": return "circle";
|
|
@@ -1248,8 +1248,8 @@ function typeStr2Type(e) {
|
|
|
1248
1248
|
}
|
|
1249
1249
|
}
|
|
1250
1250
|
__name(typeStr2Type, "typeStr2Type");
|
|
1251
|
-
function edgeTypeStr2Type(
|
|
1252
|
-
switch (log.debug("typeStr2Type",
|
|
1251
|
+
function edgeTypeStr2Type(S) {
|
|
1252
|
+
switch (log.debug("typeStr2Type", S), S) {
|
|
1253
1253
|
case "==": return "thick";
|
|
1254
1254
|
default: return "normal";
|
|
1255
1255
|
}
|
|
@@ -1410,8 +1410,8 @@ var cnt = 0, blockDB_default = {
|
|
|
1410
1410
|
markers[S](e, C, w);
|
|
1411
1411
|
});
|
|
1412
1412
|
}, "insertMarkers"), markers = {
|
|
1413
|
-
extension: /* @__PURE__ */ __name((
|
|
1414
|
-
log.trace("Making markers for ",
|
|
1413
|
+
extension: /* @__PURE__ */ __name((S, C, w) => {
|
|
1414
|
+
log.trace("Making markers for ", w), S.append("defs").append("marker").attr("id", w + "_" + C + "-extensionStart").attr("class", "marker extension " + C).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), S.append("defs").append("marker").attr("id", w + "_" + C + "-extensionEnd").attr("class", "marker extension " + C).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
|
|
1415
1415
|
}, "extension"),
|
|
1416
1416
|
composition: /* @__PURE__ */ __name((e, S, C) => {
|
|
1417
1417
|
e.append("defs").append("marker").attr("id", C + "_" + S + "-compositionStart").attr("class", "marker composition " + S).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", C + "_" + S + "-compositionEnd").attr("class", "marker composition " + S).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
@@ -1453,89 +1453,89 @@ function calculateBlockPosition(e, S) {
|
|
|
1453
1453
|
};
|
|
1454
1454
|
}
|
|
1455
1455
|
__name(calculateBlockPosition, "calculateBlockPosition");
|
|
1456
|
-
var getMaxChildSize = /* @__PURE__ */ __name((
|
|
1457
|
-
let
|
|
1458
|
-
for (let
|
|
1459
|
-
let { width:
|
|
1456
|
+
var getMaxChildSize = /* @__PURE__ */ __name((S) => {
|
|
1457
|
+
let C = 0, w = 0;
|
|
1458
|
+
for (let T of S.children) {
|
|
1459
|
+
let { width: E, height: D, x: O, y: k } = T.size ?? {
|
|
1460
1460
|
width: 0,
|
|
1461
1461
|
height: 0,
|
|
1462
1462
|
x: 0,
|
|
1463
1463
|
y: 0
|
|
1464
1464
|
};
|
|
1465
|
-
log.debug("getMaxChildSize abc95 child:",
|
|
1465
|
+
log.debug("getMaxChildSize abc95 child:", T.id, "width:", E, "height:", D, "x:", O, "y:", k, T.type), T.type !== "space" && (E > C && (C = E / (S.widthInColumns ?? 1)), D > w && (w = D));
|
|
1466
1466
|
}
|
|
1467
1467
|
return {
|
|
1468
|
-
width:
|
|
1469
|
-
height:
|
|
1468
|
+
width: C,
|
|
1469
|
+
height: w
|
|
1470
1470
|
};
|
|
1471
1471
|
}, "getMaxChildSize");
|
|
1472
|
-
function setBlockSizes(
|
|
1473
|
-
log.debug("setBlockSizes abc95 (start)",
|
|
1474
|
-
width:
|
|
1475
|
-
height:
|
|
1472
|
+
function setBlockSizes(S, C, w = 0, T = 0) {
|
|
1473
|
+
log.debug("setBlockSizes abc95 (start)", S.id, S?.size?.x, "block width =", S?.size, "siblingWidth", w), S?.size?.width || (S.size = {
|
|
1474
|
+
width: w,
|
|
1475
|
+
height: T,
|
|
1476
1476
|
x: 0,
|
|
1477
1477
|
y: 0
|
|
1478
1478
|
});
|
|
1479
|
-
let
|
|
1480
|
-
if (
|
|
1481
|
-
for (let
|
|
1482
|
-
let O = getMaxChildSize(
|
|
1483
|
-
|
|
1484
|
-
for (let
|
|
1485
|
-
for (let
|
|
1486
|
-
let k =
|
|
1487
|
-
for (let
|
|
1488
|
-
let j =
|
|
1479
|
+
let E = 0, D = 0;
|
|
1480
|
+
if (S.children?.length > 0) {
|
|
1481
|
+
for (let e of S.children) setBlockSizes(e, C);
|
|
1482
|
+
let O = getMaxChildSize(S);
|
|
1483
|
+
E = O.width, D = O.height, log.debug("setBlockSizes abc95 maxWidth of", S.id, ":s children is ", E, D);
|
|
1484
|
+
for (let C of S.children) C.size && (log.debug(`abc95 Setting size of children of ${S.id} id=${C.id} ${E} ${D} ${JSON.stringify(C.size)}`), C.size.width = E * (C.widthInColumns ?? 1) + padding * ((C.widthInColumns ?? 1) - 1), C.size.height = D, C.size.x = 0, C.size.y = 0, log.debug(`abc95 updating size of ${S.id} children child:${C.id} maxWidth:${E} maxHeight:${D}`));
|
|
1485
|
+
for (let e of S.children) setBlockSizes(e, C, E, D);
|
|
1486
|
+
let k = S.columns ?? -1, A = 0;
|
|
1487
|
+
for (let e of S.children) A += e.widthInColumns ?? 1;
|
|
1488
|
+
let j = S.children.length;
|
|
1489
1489
|
k > 0 && k < A && (j = k);
|
|
1490
|
-
let M = Math.ceil(A / j), N = j * (
|
|
1491
|
-
if (N <
|
|
1492
|
-
log.debug(`Detected to small sibling: abc95 ${
|
|
1493
|
-
let
|
|
1494
|
-
log.debug("Size indata abc88",
|
|
1495
|
-
for (let
|
|
1490
|
+
let M = Math.ceil(A / j), N = j * (E + padding) + padding, P = M * (D + padding) + padding;
|
|
1491
|
+
if (N < w) {
|
|
1492
|
+
log.debug(`Detected to small sibling: abc95 ${S.id} siblingWidth ${w} siblingHeight ${T} width ${N}`), N = w, P = T;
|
|
1493
|
+
let C = (w - j * padding - padding) / j, O = (T - M * padding - padding) / M;
|
|
1494
|
+
log.debug("Size indata abc88", S.id, "childWidth", C, "maxWidth", E), log.debug("Size indata abc88", S.id, "childHeight", O, "maxHeight", D), log.debug("Size indata abc88 xSize", j, "padding", padding);
|
|
1495
|
+
for (let e of S.children) e.size && (e.size.width = C, e.size.height = O, e.size.x = 0, e.size.y = 0);
|
|
1496
1496
|
}
|
|
1497
|
-
if (log.debug(`abc95 (finale calc) ${
|
|
1498
|
-
N =
|
|
1499
|
-
let
|
|
1500
|
-
if (
|
|
1501
|
-
let
|
|
1502
|
-
log.debug("abc95 (growing to fit) width",
|
|
1503
|
-
for (let
|
|
1497
|
+
if (log.debug(`abc95 (finale calc) ${S.id} xSize ${j} ySize ${M} columns ${k}${S.children.length} width=${Math.max(N, S.size?.width || 0)}`), N < (S?.size?.width || 0)) {
|
|
1498
|
+
N = S?.size?.width || 0;
|
|
1499
|
+
let C = k > 0 ? Math.min(S.children.length, k) : S.children.length;
|
|
1500
|
+
if (C > 0) {
|
|
1501
|
+
let w = (N - C * padding - padding) / C;
|
|
1502
|
+
log.debug("abc95 (growing to fit) width", S.id, N, S.size?.width, w);
|
|
1503
|
+
for (let e of S.children) e.size && (e.size.width = w);
|
|
1504
1504
|
}
|
|
1505
1505
|
}
|
|
1506
|
-
|
|
1506
|
+
S.size = {
|
|
1507
1507
|
width: N,
|
|
1508
1508
|
height: P,
|
|
1509
1509
|
x: 0,
|
|
1510
1510
|
y: 0
|
|
1511
1511
|
};
|
|
1512
1512
|
}
|
|
1513
|
-
log.debug("setBlockSizes abc94 (done)",
|
|
1513
|
+
log.debug("setBlockSizes abc94 (done)", S.id, S?.size?.x, S?.size?.width, S?.size?.y, S?.size?.height);
|
|
1514
1514
|
}
|
|
1515
1515
|
__name(setBlockSizes, "setBlockSizes");
|
|
1516
|
-
function layoutBlocks(
|
|
1517
|
-
log.debug(`abc85 layout blocks (=>layoutBlocks) ${
|
|
1518
|
-
let
|
|
1519
|
-
if (log.debug("layoutBlocks columns abc95",
|
|
1520
|
-
let
|
|
1521
|
-
log.debug("widthOfChildren 88",
|
|
1522
|
-
let
|
|
1523
|
-
log.debug("abc91 block?.size?.x",
|
|
1524
|
-
let O =
|
|
1525
|
-
for (let
|
|
1526
|
-
let
|
|
1527
|
-
if (!
|
|
1528
|
-
let { width: A, height: j } =
|
|
1529
|
-
if (N != k && (k = N, O =
|
|
1530
|
-
let
|
|
1531
|
-
|
|
1516
|
+
function layoutBlocks(S, C) {
|
|
1517
|
+
log.debug(`abc85 layout blocks (=>layoutBlocks) ${S.id} x: ${S?.size?.x} y: ${S?.size?.y} width: ${S?.size?.width}`);
|
|
1518
|
+
let w = S.columns ?? -1;
|
|
1519
|
+
if (log.debug("layoutBlocks columns abc95", S.id, "=>", w, S), S.children && S.children.length > 0) {
|
|
1520
|
+
let T = S?.children[0]?.size?.width ?? 0, E = S.children.length * T + (S.children.length - 1) * padding;
|
|
1521
|
+
log.debug("widthOfChildren 88", E, "posX");
|
|
1522
|
+
let D = 0;
|
|
1523
|
+
log.debug("abc91 block?.size?.x", S.id, S?.size?.x);
|
|
1524
|
+
let O = S?.size?.x ? S?.size?.x + (-S?.size?.width / 2 || 0) : -padding, k = 0;
|
|
1525
|
+
for (let T of S.children) {
|
|
1526
|
+
let E = S;
|
|
1527
|
+
if (!T.size) continue;
|
|
1528
|
+
let { width: A, height: j } = T.size, { px: M, py: N } = calculateBlockPosition(w, D);
|
|
1529
|
+
if (N != k && (k = N, O = S?.size?.x ? S?.size?.x + (-S?.size?.width / 2 || 0) : -padding, log.debug("New row in layout for block", S.id, " and child ", T.id, k)), log.debug(`abc89 layout blocks (child) id: ${T.id} Pos: ${D} (px, py) ${M},${N} (${E?.size?.x},${E?.size?.y}) parent: ${E.id} width: ${A}${padding}`), E.size) {
|
|
1530
|
+
let S = A / 2;
|
|
1531
|
+
T.size.x = O + padding + S, log.debug(`abc91 layout blocks (calc) px, pyid:${T.id} startingPos=X${O} new startingPosX${T.size.x} ${S} padding=${padding} width=${A} halfWidth=${S} => x:${T.size.x} y:${T.size.y} ${T.widthInColumns} (width * (child?.w || 1)) / 2 ${A * (T?.widthInColumns ?? 1) / 2}`), O = T.size.x + S, T.size.y = E.size.y - E.size.height / 2 + N * (j + padding) + j / 2 + padding, log.debug(`abc88 layout blocks (calc) px, pyid:${T.id}startingPosX${O}${padding}${S}=>x:${T.size.x}y:${T.size.y}${T.widthInColumns}(width * (child?.w || 1)) / 2${A * (T?.widthInColumns ?? 1) / 2}`);
|
|
1532
1532
|
}
|
|
1533
|
-
|
|
1534
|
-
let P =
|
|
1535
|
-
|
|
1533
|
+
T.children && layoutBlocks(T, C);
|
|
1534
|
+
let P = T?.widthInColumns ?? 1;
|
|
1535
|
+
w > 0 && (P = Math.min(P, w - D % w)), D += P, log.debug("abc88 columnsPos", T, D);
|
|
1536
1536
|
}
|
|
1537
1537
|
}
|
|
1538
|
-
log.debug(`layout blocks (<==layoutBlocks) ${
|
|
1538
|
+
log.debug(`layout blocks (<==layoutBlocks) ${S.id} x: ${S?.size?.x} y: ${S?.size?.y} width: ${S?.size?.width}`);
|
|
1539
1539
|
}
|
|
1540
1540
|
__name(layoutBlocks, "layoutBlocks");
|
|
1541
1541
|
function findBounds(e, { minX: S, minY: C, maxX: w, maxY: T } = {
|
|
@@ -1562,15 +1562,15 @@ function findBounds(e, { minX: S, minY: C, maxX: w, maxY: T } = {
|
|
|
1562
1562
|
};
|
|
1563
1563
|
}
|
|
1564
1564
|
__name(findBounds, "findBounds");
|
|
1565
|
-
function layout(
|
|
1566
|
-
let
|
|
1567
|
-
if (!
|
|
1568
|
-
setBlockSizes(
|
|
1569
|
-
let { minX:
|
|
1565
|
+
function layout(S) {
|
|
1566
|
+
let C = S.getBlock("root");
|
|
1567
|
+
if (!C) return;
|
|
1568
|
+
setBlockSizes(C, S, 0, 0), layoutBlocks(C, S), log.debug("getBlocks", JSON.stringify(C, null, 2));
|
|
1569
|
+
let { minX: w, minY: T, maxX: E, maxY: D } = findBounds(C), O = D - T;
|
|
1570
1570
|
return {
|
|
1571
|
-
x:
|
|
1572
|
-
y:
|
|
1573
|
-
width:
|
|
1571
|
+
x: w,
|
|
1572
|
+
y: T,
|
|
1573
|
+
width: E - w,
|
|
1574
1574
|
height: O
|
|
1575
1575
|
};
|
|
1576
1576
|
}
|
|
@@ -1580,12 +1580,12 @@ function applyStyle(e, S) {
|
|
|
1580
1580
|
}
|
|
1581
1581
|
__name(applyStyle, "applyStyle");
|
|
1582
1582
|
function addHtmlLabel(e, S) {
|
|
1583
|
-
let
|
|
1584
|
-
return
|
|
1583
|
+
let w = select_default(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), E = w.append("xhtml:div"), D = e.label, O = e.isNode ? "nodeLabel" : "edgeLabel", k = E.append("span");
|
|
1584
|
+
return k.html(sanitizeText(D, S)), applyStyle(k, e.labelStyle), k.attr("class", O), applyStyle(E, e.labelStyle), E.style("display", "inline-block"), E.style("white-space", "nowrap"), E.attr("xmlns", "http://www.w3.org/1999/xhtml"), w.node();
|
|
1585
1585
|
}
|
|
1586
1586
|
__name(addHtmlLabel, "addHtmlLabel");
|
|
1587
|
-
var createLabel_default = /* @__PURE__ */ __name(async (
|
|
1588
|
-
let E =
|
|
1587
|
+
var createLabel_default = /* @__PURE__ */ __name(async (S, C, w, T) => {
|
|
1588
|
+
let E = S || "";
|
|
1589
1589
|
typeof E == "object" && (E = E[0]);
|
|
1590
1590
|
let O = getConfig2();
|
|
1591
1591
|
if (evaluate(O.flowchart.htmlLabels)) return E = E.replace(/\\n|\n/g, "<br />"), log.debug("vertexText" + E), addHtmlLabel({
|
|
@@ -1616,176 +1616,176 @@ var createLabel_default = /* @__PURE__ */ __name(async (e, C, w, T) => {
|
|
|
1616
1616
|
composition: "composition",
|
|
1617
1617
|
dependency: "dependency",
|
|
1618
1618
|
lollipop: "lollipop"
|
|
1619
|
-
}, addEdgeMarker = /* @__PURE__ */ __name((
|
|
1620
|
-
let O = arrowTypesMap[
|
|
1619
|
+
}, addEdgeMarker = /* @__PURE__ */ __name((S, C, w, T, E, D) => {
|
|
1620
|
+
let O = arrowTypesMap[w];
|
|
1621
1621
|
if (!O) {
|
|
1622
|
-
log.warn(`Unknown arrow type: ${
|
|
1622
|
+
log.warn(`Unknown arrow type: ${w}`);
|
|
1623
1623
|
return;
|
|
1624
1624
|
}
|
|
1625
|
-
let k =
|
|
1626
|
-
|
|
1625
|
+
let k = C === "start" ? "Start" : "End";
|
|
1626
|
+
S.attr(`marker-${C}`, `url(${T}#${E}_${D}-${O}${k})`);
|
|
1627
1627
|
}, "addEdgeMarker"), edgeLabels = {}, terminalLabels = {}, insertEdgeLabel = /* @__PURE__ */ __name(async (e, S) => {
|
|
1628
|
-
let
|
|
1628
|
+
let w = getConfig2(), T = evaluate(w.flowchart.htmlLabels), E = S.labelType === "markdown" ? createText(e, S.label, {
|
|
1629
1629
|
style: S.labelStyle,
|
|
1630
|
-
useHtmlLabels:
|
|
1630
|
+
useHtmlLabels: T,
|
|
1631
1631
|
addSvgBackground: !0
|
|
1632
|
-
},
|
|
1633
|
-
|
|
1634
|
-
let
|
|
1635
|
-
if (
|
|
1636
|
-
let e =
|
|
1637
|
-
|
|
1632
|
+
}, w) : await createLabel_default(S.label, S.labelStyle), O = e.insert("g").attr("class", "edgeLabel"), k = O.insert("g").attr("class", "label");
|
|
1633
|
+
k.node().appendChild(E);
|
|
1634
|
+
let j = E.getBBox();
|
|
1635
|
+
if (T) {
|
|
1636
|
+
let e = E.children[0], S = select_default(E);
|
|
1637
|
+
j = e.getBoundingClientRect(), S.attr("width", j.width), S.attr("height", j.height);
|
|
1638
1638
|
}
|
|
1639
|
-
|
|
1640
|
-
let
|
|
1639
|
+
k.attr("transform", "translate(" + -j.width / 2 + ", " + -j.height / 2 + ")"), edgeLabels[S.id] = O, S.width = j.width, S.height = j.height;
|
|
1640
|
+
let M;
|
|
1641
1641
|
if (S.startLabelLeft) {
|
|
1642
1642
|
let C = await createLabel_default(S.startLabelLeft, S.labelStyle), w = e.insert("g").attr("class", "edgeTerminals"), T = w.insert("g").attr("class", "inner");
|
|
1643
|
-
|
|
1643
|
+
M = T.node().appendChild(C);
|
|
1644
1644
|
let E = C.getBBox();
|
|
1645
|
-
T.attr("transform", "translate(" + -E.width / 2 + ", " + -E.height / 2 + ")"), terminalLabels[S.id] || (terminalLabels[S.id] = {}), terminalLabels[S.id].startLeft = w, setTerminalWidth(
|
|
1645
|
+
T.attr("transform", "translate(" + -E.width / 2 + ", " + -E.height / 2 + ")"), terminalLabels[S.id] || (terminalLabels[S.id] = {}), terminalLabels[S.id].startLeft = w, setTerminalWidth(M, S.startLabelLeft);
|
|
1646
1646
|
}
|
|
1647
1647
|
if (S.startLabelRight) {
|
|
1648
1648
|
let C = await createLabel_default(S.startLabelRight, S.labelStyle), w = e.insert("g").attr("class", "edgeTerminals"), T = w.insert("g").attr("class", "inner");
|
|
1649
|
-
|
|
1649
|
+
M = w.node().appendChild(C), T.node().appendChild(C);
|
|
1650
1650
|
let E = C.getBBox();
|
|
1651
|
-
T.attr("transform", "translate(" + -E.width / 2 + ", " + -E.height / 2 + ")"), terminalLabels[S.id] || (terminalLabels[S.id] = {}), terminalLabels[S.id].startRight = w, setTerminalWidth(
|
|
1651
|
+
T.attr("transform", "translate(" + -E.width / 2 + ", " + -E.height / 2 + ")"), terminalLabels[S.id] || (terminalLabels[S.id] = {}), terminalLabels[S.id].startRight = w, setTerminalWidth(M, S.startLabelRight);
|
|
1652
1652
|
}
|
|
1653
1653
|
if (S.endLabelLeft) {
|
|
1654
1654
|
let C = await createLabel_default(S.endLabelLeft, S.labelStyle), w = e.insert("g").attr("class", "edgeTerminals"), T = w.insert("g").attr("class", "inner");
|
|
1655
|
-
|
|
1655
|
+
M = T.node().appendChild(C);
|
|
1656
1656
|
let E = C.getBBox();
|
|
1657
|
-
T.attr("transform", "translate(" + -E.width / 2 + ", " + -E.height / 2 + ")"), w.node().appendChild(C), terminalLabels[S.id] || (terminalLabels[S.id] = {}), terminalLabels[S.id].endLeft = w, setTerminalWidth(
|
|
1657
|
+
T.attr("transform", "translate(" + -E.width / 2 + ", " + -E.height / 2 + ")"), w.node().appendChild(C), terminalLabels[S.id] || (terminalLabels[S.id] = {}), terminalLabels[S.id].endLeft = w, setTerminalWidth(M, S.endLabelLeft);
|
|
1658
1658
|
}
|
|
1659
1659
|
if (S.endLabelRight) {
|
|
1660
1660
|
let C = await createLabel_default(S.endLabelRight, S.labelStyle), w = e.insert("g").attr("class", "edgeTerminals"), T = w.insert("g").attr("class", "inner");
|
|
1661
|
-
|
|
1661
|
+
M = T.node().appendChild(C);
|
|
1662
1662
|
let E = C.getBBox();
|
|
1663
|
-
T.attr("transform", "translate(" + -E.width / 2 + ", " + -E.height / 2 + ")"), w.node().appendChild(C), terminalLabels[S.id] || (terminalLabels[S.id] = {}), terminalLabels[S.id].endRight = w, setTerminalWidth(
|
|
1663
|
+
T.attr("transform", "translate(" + -E.width / 2 + ", " + -E.height / 2 + ")"), w.node().appendChild(C), terminalLabels[S.id] || (terminalLabels[S.id] = {}), terminalLabels[S.id].endRight = w, setTerminalWidth(M, S.endLabelRight);
|
|
1664
1664
|
}
|
|
1665
|
-
return
|
|
1665
|
+
return E;
|
|
1666
1666
|
}, "insertEdgeLabel");
|
|
1667
1667
|
function setTerminalWidth(e, S) {
|
|
1668
1668
|
getConfig2().flowchart.htmlLabels && e && (e.style.width = S.length * 9 + "px", e.style.height = "12px");
|
|
1669
1669
|
}
|
|
1670
1670
|
__name(setTerminalWidth, "setTerminalWidth");
|
|
1671
|
-
var positionEdgeLabel = /* @__PURE__ */ __name((
|
|
1672
|
-
log.debug("Moving label abc88 ",
|
|
1673
|
-
let w =
|
|
1674
|
-
if (
|
|
1675
|
-
let E = edgeLabels[
|
|
1671
|
+
var positionEdgeLabel = /* @__PURE__ */ __name((S, C) => {
|
|
1672
|
+
log.debug("Moving label abc88 ", S.id, S.label, edgeLabels[S.id], C);
|
|
1673
|
+
let w = C.updatedPath ? C.updatedPath : C.originalPath, { subGraphTitleTotalMargin: T } = getSubGraphTitleMargins(getConfig2());
|
|
1674
|
+
if (S.label) {
|
|
1675
|
+
let E = edgeLabels[S.id], D = S.x, O = S.y;
|
|
1676
1676
|
if (w) {
|
|
1677
1677
|
let T = utils_default.calcLabelPosition(w);
|
|
1678
|
-
log.debug("Moving label " +
|
|
1678
|
+
log.debug("Moving label " + S.label + " from (", D, ",", O, ") to (", T.x, ",", T.y, ") abc88"), C.updatedPath && (D = T.x, O = T.y);
|
|
1679
1679
|
}
|
|
1680
|
-
E.attr("transform", `translate(${
|
|
1680
|
+
E.attr("transform", `translate(${D}, ${O + T / 2})`);
|
|
1681
1681
|
}
|
|
1682
|
-
if (
|
|
1683
|
-
let
|
|
1682
|
+
if (S.startLabelLeft) {
|
|
1683
|
+
let e = terminalLabels[S.id].startLeft, C = S.x, T = S.y;
|
|
1684
1684
|
if (w) {
|
|
1685
|
-
let
|
|
1686
|
-
|
|
1685
|
+
let e = utils_default.calcTerminalLabelPosition(S.arrowTypeStart ? 10 : 0, "start_left", w);
|
|
1686
|
+
C = e.x, T = e.y;
|
|
1687
1687
|
}
|
|
1688
|
-
|
|
1688
|
+
e.attr("transform", `translate(${C}, ${T})`);
|
|
1689
1689
|
}
|
|
1690
|
-
if (
|
|
1691
|
-
let
|
|
1690
|
+
if (S.startLabelRight) {
|
|
1691
|
+
let e = terminalLabels[S.id].startRight, C = S.x, T = S.y;
|
|
1692
1692
|
if (w) {
|
|
1693
|
-
let
|
|
1694
|
-
|
|
1693
|
+
let e = utils_default.calcTerminalLabelPosition(S.arrowTypeStart ? 10 : 0, "start_right", w);
|
|
1694
|
+
C = e.x, T = e.y;
|
|
1695
1695
|
}
|
|
1696
|
-
|
|
1696
|
+
e.attr("transform", `translate(${C}, ${T})`);
|
|
1697
1697
|
}
|
|
1698
|
-
if (
|
|
1699
|
-
let
|
|
1698
|
+
if (S.endLabelLeft) {
|
|
1699
|
+
let e = terminalLabels[S.id].endLeft, C = S.x, T = S.y;
|
|
1700
1700
|
if (w) {
|
|
1701
|
-
let
|
|
1702
|
-
|
|
1701
|
+
let e = utils_default.calcTerminalLabelPosition(S.arrowTypeEnd ? 10 : 0, "end_left", w);
|
|
1702
|
+
C = e.x, T = e.y;
|
|
1703
1703
|
}
|
|
1704
|
-
|
|
1704
|
+
e.attr("transform", `translate(${C}, ${T})`);
|
|
1705
1705
|
}
|
|
1706
|
-
if (
|
|
1707
|
-
let
|
|
1706
|
+
if (S.endLabelRight) {
|
|
1707
|
+
let e = terminalLabels[S.id].endRight, C = S.x, T = S.y;
|
|
1708
1708
|
if (w) {
|
|
1709
|
-
let
|
|
1710
|
-
|
|
1709
|
+
let e = utils_default.calcTerminalLabelPosition(S.arrowTypeEnd ? 10 : 0, "end_right", w);
|
|
1710
|
+
C = e.x, T = e.y;
|
|
1711
1711
|
}
|
|
1712
|
-
|
|
1712
|
+
e.attr("transform", `translate(${C}, ${T})`);
|
|
1713
1713
|
}
|
|
1714
1714
|
}, "positionEdgeLabel"), outsideNode = /* @__PURE__ */ __name((e, S) => {
|
|
1715
1715
|
let C = e.x, w = e.y, T = Math.abs(S.x - C), E = Math.abs(S.y - w), D = e.width / 2, O = e.height / 2;
|
|
1716
1716
|
return T >= D || E >= O;
|
|
1717
|
-
}, "outsideNode"), intersection = /* @__PURE__ */ __name((
|
|
1717
|
+
}, "outsideNode"), intersection = /* @__PURE__ */ __name((S, C, w) => {
|
|
1718
1718
|
log.debug(`intersection calc abc89:
|
|
1719
|
-
outsidePoint: ${JSON.stringify(
|
|
1720
|
-
insidePoint : ${JSON.stringify(
|
|
1721
|
-
node : x:${
|
|
1722
|
-
let
|
|
1723
|
-
if (Math.abs(
|
|
1724
|
-
let
|
|
1725
|
-
k = M *
|
|
1726
|
-
let
|
|
1727
|
-
x:
|
|
1728
|
-
y:
|
|
1719
|
+
outsidePoint: ${JSON.stringify(C)}
|
|
1720
|
+
insidePoint : ${JSON.stringify(w)}
|
|
1721
|
+
node : x:${S.x} y:${S.y} w:${S.width} h:${S.height}`);
|
|
1722
|
+
let T = S.x, E = S.y, D = Math.abs(T - w.x), O = S.width / 2, k = w.x < C.x ? O - D : O + D, A = S.height / 2, j = Math.abs(C.y - w.y), M = Math.abs(C.x - w.x);
|
|
1723
|
+
if (Math.abs(E - C.y) * O > Math.abs(T - C.x) * A) {
|
|
1724
|
+
let S = w.y < C.y ? C.y - A - E : E - A - C.y;
|
|
1725
|
+
k = M * S / j;
|
|
1726
|
+
let T = {
|
|
1727
|
+
x: w.x < C.x ? w.x + k : w.x - M + k,
|
|
1728
|
+
y: w.y < C.y ? w.y + j - S : w.y - j + S
|
|
1729
1729
|
};
|
|
1730
|
-
return k === 0 && (
|
|
1730
|
+
return k === 0 && (T.x = C.x, T.y = C.y), M === 0 && (T.x = C.x), j === 0 && (T.y = C.y), log.debug(`abc89 topp/bott calc, Q ${j}, q ${S}, R ${M}, r ${k}`, T), T;
|
|
1731
1731
|
} else {
|
|
1732
|
-
k =
|
|
1733
|
-
let
|
|
1734
|
-
return log.debug(`sides calc abc89, Q ${j}, q ${
|
|
1735
|
-
_x:
|
|
1736
|
-
_y:
|
|
1737
|
-
}), k === 0 && (
|
|
1738
|
-
x:
|
|
1739
|
-
y:
|
|
1732
|
+
k = w.x < C.x ? C.x - O - T : T - O - C.x;
|
|
1733
|
+
let S = j * k / M, E = w.x < C.x ? w.x + M - k : w.x - M + k, D = w.y < C.y ? w.y + S : w.y - S;
|
|
1734
|
+
return log.debug(`sides calc abc89, Q ${j}, q ${S}, R ${M}, r ${k}`, {
|
|
1735
|
+
_x: E,
|
|
1736
|
+
_y: D
|
|
1737
|
+
}), k === 0 && (E = C.x, D = C.y), M === 0 && (E = C.x), j === 0 && (D = C.y), {
|
|
1738
|
+
x: E,
|
|
1739
|
+
y: D
|
|
1740
1740
|
};
|
|
1741
1741
|
}
|
|
1742
|
-
}, "intersection"), cutPathAtIntersect = /* @__PURE__ */ __name((
|
|
1743
|
-
log.debug("abc88 cutPathAtIntersect",
|
|
1744
|
-
let
|
|
1745
|
-
return
|
|
1746
|
-
if (!outsideNode(
|
|
1747
|
-
let
|
|
1748
|
-
|
|
1749
|
-
D ||= e.x ===
|
|
1750
|
-
}),
|
|
1751
|
-
} else
|
|
1752
|
-
}),
|
|
1753
|
-
}, "cutPathAtIntersect"), insertEdge = /* @__PURE__ */ __name(function(S, C,
|
|
1754
|
-
let j =
|
|
1755
|
-
log.debug("abc88 InsertEdge: edge=",
|
|
1756
|
-
let M = !1,
|
|
1757
|
-
var F =
|
|
1758
|
-
F?.intersect &&
|
|
1742
|
+
}, "intersection"), cutPathAtIntersect = /* @__PURE__ */ __name((S, C) => {
|
|
1743
|
+
log.debug("abc88 cutPathAtIntersect", S, C);
|
|
1744
|
+
let w = [], T = S[0], E = !1;
|
|
1745
|
+
return S.forEach((e) => {
|
|
1746
|
+
if (!outsideNode(C, e) && !E) {
|
|
1747
|
+
let S = intersection(C, T, e), D = !1;
|
|
1748
|
+
w.forEach((e) => {
|
|
1749
|
+
D ||= e.x === S.x && e.y === S.y;
|
|
1750
|
+
}), w.some((e) => e.x === S.x && e.y === S.y) || w.push(S), E = !0;
|
|
1751
|
+
} else T = e, E || w.push(e);
|
|
1752
|
+
}), w;
|
|
1753
|
+
}, "cutPathAtIntersect"), insertEdge = /* @__PURE__ */ __name(function(S, C, T, E, O, k, A) {
|
|
1754
|
+
let j = T.points;
|
|
1755
|
+
log.debug("abc88 InsertEdge: edge=", T, "e=", C);
|
|
1756
|
+
let M = !1, N = k.node(C.v);
|
|
1757
|
+
var F = k.node(C.w);
|
|
1758
|
+
F?.intersect && N?.intersect && (j = j.slice(1, T.points.length - 1), j.unshift(N.intersect(j[0])), j.push(F.intersect(j[j.length - 1]))), T.toCluster && (log.debug("to cluster abc88", E[T.toCluster]), j = cutPathAtIntersect(T.points, E[T.toCluster].node), M = !0), T.fromCluster && (log.debug("from cluster abc88", E[T.fromCluster]), j = cutPathAtIntersect(j.reverse(), E[T.fromCluster].node).reverse(), M = !0);
|
|
1759
1759
|
let I = j.filter((e) => !Number.isNaN(e.y)), L = basis_default;
|
|
1760
|
-
|
|
1761
|
-
let { x:
|
|
1762
|
-
switch (
|
|
1760
|
+
T.curve && (O === "graph" || O === "flowchart") && (L = T.curve);
|
|
1761
|
+
let { x: z, y: B } = getLineFunctionsWithOffset(T), V = line_default().x(z).y(B).curve(L), U;
|
|
1762
|
+
switch (T.thickness) {
|
|
1763
1763
|
case "normal":
|
|
1764
|
-
|
|
1764
|
+
U = "edge-thickness-normal";
|
|
1765
1765
|
break;
|
|
1766
1766
|
case "thick":
|
|
1767
|
-
|
|
1767
|
+
U = "edge-thickness-thick";
|
|
1768
1768
|
break;
|
|
1769
1769
|
case "invisible":
|
|
1770
|
-
|
|
1770
|
+
U = "edge-thickness-thick";
|
|
1771
1771
|
break;
|
|
1772
|
-
default:
|
|
1772
|
+
default: U = "";
|
|
1773
1773
|
}
|
|
1774
|
-
switch (
|
|
1774
|
+
switch (T.pattern) {
|
|
1775
1775
|
case "solid":
|
|
1776
|
-
|
|
1776
|
+
U += " edge-pattern-solid";
|
|
1777
1777
|
break;
|
|
1778
1778
|
case "dotted":
|
|
1779
|
-
|
|
1779
|
+
U += " edge-pattern-dotted";
|
|
1780
1780
|
break;
|
|
1781
1781
|
case "dashed":
|
|
1782
|
-
|
|
1782
|
+
U += " edge-pattern-dashed";
|
|
1783
1783
|
break;
|
|
1784
1784
|
}
|
|
1785
|
-
let
|
|
1786
|
-
(getConfig2().flowchart.arrowMarkerAbsolute || getConfig2().state.arrowMarkerAbsolute) && (G = getUrl(!0)), addEdgeMarkers(
|
|
1785
|
+
let W = S.append("path").attr("d", V(I)).attr("id", T.id).attr("class", " " + U + (T.classes ? " " + T.classes : "")).attr("style", T.style), G = "";
|
|
1786
|
+
(getConfig2().flowchart.arrowMarkerAbsolute || getConfig2().state.arrowMarkerAbsolute) && (G = getUrl(!0)), addEdgeMarkers(W, T, G, A, O);
|
|
1787
1787
|
let K = {};
|
|
1788
|
-
return M && (K.updatedPath = j), K.originalPath =
|
|
1788
|
+
return M && (K.updatedPath = j), K.originalPath = T.points, K;
|
|
1789
1789
|
}, "insertEdge"), expandAndDeduplicateDirections = /* @__PURE__ */ __name((e) => {
|
|
1790
1790
|
let S = /* @__PURE__ */ new Set();
|
|
1791
1791
|
for (let C of e) switch (C) {
|
|
@@ -2273,41 +2273,41 @@ var intersect_default = {
|
|
|
2273
2273
|
y: w + A
|
|
2274
2274
|
};
|
|
2275
2275
|
}, "intersectRect")
|
|
2276
|
-
}, labelHelper = /* @__PURE__ */ __name(async (e,
|
|
2277
|
-
let
|
|
2278
|
-
|
|
2279
|
-
let
|
|
2280
|
-
|
|
2276
|
+
}, labelHelper = /* @__PURE__ */ __name(async (e, w, E, O) => {
|
|
2277
|
+
let k = getConfig2(), j, M = w.useHtmlLabels || evaluate(k.flowchart.htmlLabels);
|
|
2278
|
+
j = E || "node default";
|
|
2279
|
+
let N = e.insert("g").attr("class", j).attr("id", w.domId || w.id), P = N.insert("g").attr("class", "label").attr("style", w.labelStyle), I;
|
|
2280
|
+
I = w.labelText === void 0 ? "" : typeof w.labelText == "string" ? w.labelText : w.labelText[0];
|
|
2281
2281
|
let L = P.node(), R;
|
|
2282
|
-
R =
|
|
2283
|
-
useHtmlLabels:
|
|
2284
|
-
width:
|
|
2282
|
+
R = w.labelType === "markdown" ? createText(P, sanitizeText(decodeEntities(I), k), {
|
|
2283
|
+
useHtmlLabels: M,
|
|
2284
|
+
width: w.width || k.flowchart.wrappingWidth,
|
|
2285
2285
|
classes: "markdown-node-label"
|
|
2286
|
-
},
|
|
2287
|
-
let z = R.getBBox(),
|
|
2288
|
-
if (evaluate(
|
|
2289
|
-
let e = R.children[0],
|
|
2290
|
-
if (
|
|
2291
|
-
let e =
|
|
2292
|
-
await Promise.all([...
|
|
2293
|
-
function
|
|
2294
|
-
if (
|
|
2295
|
-
let e =
|
|
2296
|
-
|
|
2297
|
-
} else
|
|
2298
|
-
C
|
|
2286
|
+
}, k) : L.appendChild(await createLabel_default(sanitizeText(decodeEntities(I), k), w.labelStyle, !1, O));
|
|
2287
|
+
let z = R.getBBox(), V = w.padding / 2;
|
|
2288
|
+
if (evaluate(k.flowchart.htmlLabels)) {
|
|
2289
|
+
let e = R.children[0], w = select_default(R), T = e.getElementsByTagName("img");
|
|
2290
|
+
if (T) {
|
|
2291
|
+
let e = I.replace(/<img[^>]*>/g, "").trim() === "";
|
|
2292
|
+
await Promise.all([...T].map((C) => new Promise((w) => {
|
|
2293
|
+
function T() {
|
|
2294
|
+
if (C.style.display = "flex", C.style.flexDirection = "column", e) {
|
|
2295
|
+
let e = k.fontSize ? k.fontSize : window.getComputedStyle(document.body).fontSize, S = parseInt(e, 10) * 5 + "px";
|
|
2296
|
+
C.style.minWidth = S, C.style.maxWidth = S;
|
|
2297
|
+
} else C.style.width = "100%";
|
|
2298
|
+
w(C);
|
|
2299
2299
|
}
|
|
2300
|
-
__name(
|
|
2301
|
-
|
|
2302
|
-
}),
|
|
2300
|
+
__name(T, "setupImage"), setTimeout(() => {
|
|
2301
|
+
C.complete && T();
|
|
2302
|
+
}), C.addEventListener("error", T), C.addEventListener("load", T);
|
|
2303
2303
|
})));
|
|
2304
2304
|
}
|
|
2305
|
-
z = e.getBoundingClientRect(),
|
|
2305
|
+
z = e.getBoundingClientRect(), w.attr("width", z.width), w.attr("height", z.height);
|
|
2306
2306
|
}
|
|
2307
|
-
return
|
|
2308
|
-
shapeSvg:
|
|
2307
|
+
return M ? P.attr("transform", "translate(" + -z.width / 2 + ", " + -z.height / 2 + ")") : P.attr("transform", "translate(0, " + -z.height / 2 + ")"), w.centerLabel && P.attr("transform", "translate(" + -z.width / 2 + ", " + -z.height / 2 + ")"), P.insert("rect", ":first-child"), {
|
|
2308
|
+
shapeSvg: N,
|
|
2309
2309
|
bbox: z,
|
|
2310
|
-
halfPadding:
|
|
2310
|
+
halfPadding: V,
|
|
2311
2311
|
label: P
|
|
2312
2312
|
};
|
|
2313
2313
|
}, "labelHelper"), updateNodeBounds = /* @__PURE__ */ __name((e, S) => {
|
|
@@ -2320,38 +2320,38 @@ function insertPolygonShape(e, S, C, w) {
|
|
|
2320
2320
|
}).join(" ")).attr("class", "label-container").attr("transform", "translate(" + -S / 2 + "," + C / 2 + ")");
|
|
2321
2321
|
}
|
|
2322
2322
|
__name(insertPolygonShape, "insertPolygonShape");
|
|
2323
|
-
var note_default = /* @__PURE__ */ __name(async (
|
|
2324
|
-
|
|
2325
|
-
let { shapeSvg:
|
|
2326
|
-
log.info("Classes = ",
|
|
2327
|
-
let
|
|
2328
|
-
return
|
|
2329
|
-
return intersect_default.rect(
|
|
2330
|
-
},
|
|
2331
|
-
}, "note"), formatClass = /* @__PURE__ */ __name((e) => e ? " " + e : "", "formatClass"), getClassesFromNode = /* @__PURE__ */ __name((e, S) => `${S || "node default"}${formatClass(e.classes)} ${formatClass(e.class)}`, "getClassesFromNode"), question = /* @__PURE__ */ __name(async (
|
|
2332
|
-
let { shapeSvg:
|
|
2323
|
+
var note_default = /* @__PURE__ */ __name(async (S, C) => {
|
|
2324
|
+
C.useHtmlLabels || getConfig2().flowchart.htmlLabels || (C.centerLabel = !0);
|
|
2325
|
+
let { shapeSvg: w, bbox: T, halfPadding: E } = await labelHelper(S, C, "node " + C.classes, !0);
|
|
2326
|
+
log.info("Classes = ", C.classes);
|
|
2327
|
+
let O = w.insert("rect", ":first-child");
|
|
2328
|
+
return O.attr("rx", C.rx).attr("ry", C.ry).attr("x", -T.width / 2 - E).attr("y", -T.height / 2 - E).attr("width", T.width + C.padding).attr("height", T.height + C.padding), updateNodeBounds(C, O), C.intersect = function(e) {
|
|
2329
|
+
return intersect_default.rect(C, e);
|
|
2330
|
+
}, w;
|
|
2331
|
+
}, "note"), formatClass = /* @__PURE__ */ __name((e) => e ? " " + e : "", "formatClass"), getClassesFromNode = /* @__PURE__ */ __name((e, S) => `${S || "node default"}${formatClass(e.classes)} ${formatClass(e.class)}`, "getClassesFromNode"), question = /* @__PURE__ */ __name(async (S, C) => {
|
|
2332
|
+
let { shapeSvg: w, bbox: T } = await labelHelper(S, C, getClassesFromNode(C, void 0), !0), E = T.width + C.padding + (T.height + C.padding), D = [
|
|
2333
2333
|
{
|
|
2334
|
-
x:
|
|
2334
|
+
x: E / 2,
|
|
2335
2335
|
y: 0
|
|
2336
2336
|
},
|
|
2337
2337
|
{
|
|
2338
|
-
x:
|
|
2339
|
-
y: -
|
|
2338
|
+
x: E,
|
|
2339
|
+
y: -E / 2
|
|
2340
2340
|
},
|
|
2341
2341
|
{
|
|
2342
|
-
x:
|
|
2343
|
-
y: -
|
|
2342
|
+
x: E / 2,
|
|
2343
|
+
y: -E
|
|
2344
2344
|
},
|
|
2345
2345
|
{
|
|
2346
2346
|
x: 0,
|
|
2347
|
-
y: -
|
|
2347
|
+
y: -E / 2
|
|
2348
2348
|
}
|
|
2349
2349
|
];
|
|
2350
2350
|
log.info("Question main (Circle)");
|
|
2351
|
-
let O = insertPolygonShape(
|
|
2352
|
-
return O.attr("style",
|
|
2353
|
-
return log.warn("Intersect called"), intersect_default.polygon(
|
|
2354
|
-
},
|
|
2351
|
+
let O = insertPolygonShape(w, E, E, D);
|
|
2352
|
+
return O.attr("style", C.style), updateNodeBounds(C, O), C.intersect = function(S) {
|
|
2353
|
+
return log.warn("Intersect called"), intersect_default.polygon(C, D, S);
|
|
2354
|
+
}, w;
|
|
2355
2355
|
}, "question"), choice = /* @__PURE__ */ __name((e, S) => {
|
|
2356
2356
|
let C = e.insert("g").attr("class", "node default").attr("id", S.domId || S.id);
|
|
2357
2357
|
return C.insert("polygon", ":first-child").attr("points", [
|
|
@@ -2561,89 +2561,89 @@ var note_default = /* @__PURE__ */ __name(async (e, S) => {
|
|
|
2561
2561
|
}
|
|
2562
2562
|
return C;
|
|
2563
2563
|
}, C;
|
|
2564
|
-
}, "cylinder"), rect = /* @__PURE__ */ __name(async (
|
|
2565
|
-
let { shapeSvg:
|
|
2566
|
-
if (
|
|
2567
|
-
let
|
|
2568
|
-
|
|
2569
|
-
log.warn(`Unknown node property ${
|
|
2564
|
+
}, "cylinder"), rect = /* @__PURE__ */ __name(async (S, C) => {
|
|
2565
|
+
let { shapeSvg: w, bbox: T, halfPadding: E } = await labelHelper(S, C, "node " + C.classes + " " + C.class, !0), D = w.insert("rect", ":first-child"), O = C.positioned ? C.width : T.width + C.padding, k = C.positioned ? C.height : T.height + C.padding, A = C.positioned ? -O / 2 : -T.width / 2 - E, j = C.positioned ? -k / 2 : -T.height / 2 - E;
|
|
2566
|
+
if (D.attr("class", "basic label-container").attr("style", C.style).attr("rx", C.rx).attr("ry", C.ry).attr("x", A).attr("y", j).attr("width", O).attr("height", k), C.props) {
|
|
2567
|
+
let S = new Set(Object.keys(C.props));
|
|
2568
|
+
C.props.borders && (applyNodePropertyBorders(D, C.props.borders, O, k), S.delete("borders")), S.forEach((S) => {
|
|
2569
|
+
log.warn(`Unknown node property ${S}`);
|
|
2570
2570
|
});
|
|
2571
2571
|
}
|
|
2572
|
-
return updateNodeBounds(
|
|
2573
|
-
return intersect_default.rect(
|
|
2574
|
-
},
|
|
2575
|
-
}, "rect"), composite = /* @__PURE__ */ __name(async (
|
|
2576
|
-
let { shapeSvg:
|
|
2577
|
-
if (
|
|
2578
|
-
let
|
|
2579
|
-
|
|
2580
|
-
log.warn(`Unknown node property ${
|
|
2572
|
+
return updateNodeBounds(C, D), C.intersect = function(e) {
|
|
2573
|
+
return intersect_default.rect(C, e);
|
|
2574
|
+
}, w;
|
|
2575
|
+
}, "rect"), composite = /* @__PURE__ */ __name(async (S, C) => {
|
|
2576
|
+
let { shapeSvg: w, bbox: T, halfPadding: E } = await labelHelper(S, C, "node " + C.classes, !0), D = w.insert("rect", ":first-child"), O = C.positioned ? C.width : T.width + C.padding, k = C.positioned ? C.height : T.height + C.padding, A = C.positioned ? -O / 2 : -T.width / 2 - E, j = C.positioned ? -k / 2 : -T.height / 2 - E;
|
|
2577
|
+
if (D.attr("class", "basic cluster composite label-container").attr("style", C.style).attr("rx", C.rx).attr("ry", C.ry).attr("x", A).attr("y", j).attr("width", O).attr("height", k), C.props) {
|
|
2578
|
+
let S = new Set(Object.keys(C.props));
|
|
2579
|
+
C.props.borders && (applyNodePropertyBorders(D, C.props.borders, O, k), S.delete("borders")), S.forEach((S) => {
|
|
2580
|
+
log.warn(`Unknown node property ${S}`);
|
|
2581
2581
|
});
|
|
2582
2582
|
}
|
|
2583
|
-
return updateNodeBounds(
|
|
2584
|
-
return intersect_default.rect(
|
|
2585
|
-
},
|
|
2586
|
-
}, "composite"), labelRect = /* @__PURE__ */ __name(async (
|
|
2587
|
-
let { shapeSvg:
|
|
2588
|
-
log.trace("Classes = ",
|
|
2589
|
-
let
|
|
2590
|
-
if (
|
|
2591
|
-
let
|
|
2592
|
-
|
|
2593
|
-
log.warn(`Unknown node property ${
|
|
2583
|
+
return updateNodeBounds(C, D), C.intersect = function(e) {
|
|
2584
|
+
return intersect_default.rect(C, e);
|
|
2585
|
+
}, w;
|
|
2586
|
+
}, "composite"), labelRect = /* @__PURE__ */ __name(async (S, C) => {
|
|
2587
|
+
let { shapeSvg: w } = await labelHelper(S, C, "label", !0);
|
|
2588
|
+
log.trace("Classes = ", C.class);
|
|
2589
|
+
let T = w.insert("rect", ":first-child");
|
|
2590
|
+
if (T.attr("width", 0).attr("height", 0), w.attr("class", "label edgeLabel"), C.props) {
|
|
2591
|
+
let S = new Set(Object.keys(C.props));
|
|
2592
|
+
C.props.borders && (applyNodePropertyBorders(T, C.props.borders, 0, 0), S.delete("borders")), S.forEach((S) => {
|
|
2593
|
+
log.warn(`Unknown node property ${S}`);
|
|
2594
2594
|
});
|
|
2595
2595
|
}
|
|
2596
|
-
return updateNodeBounds(
|
|
2597
|
-
return intersect_default.rect(
|
|
2598
|
-
},
|
|
2596
|
+
return updateNodeBounds(C, T), C.intersect = function(e) {
|
|
2597
|
+
return intersect_default.rect(C, e);
|
|
2598
|
+
}, w;
|
|
2599
2599
|
}, "labelRect");
|
|
2600
|
-
function applyNodePropertyBorders(
|
|
2601
|
-
let
|
|
2602
|
-
|
|
2600
|
+
function applyNodePropertyBorders(C, w, T, E) {
|
|
2601
|
+
let D = [], O = /* @__PURE__ */ __name((e) => {
|
|
2602
|
+
D.push(e, 0);
|
|
2603
2603
|
}, "addBorder"), k = /* @__PURE__ */ __name((e) => {
|
|
2604
|
-
|
|
2604
|
+
D.push(0, e);
|
|
2605
2605
|
}, "skipBorder");
|
|
2606
|
-
|
|
2606
|
+
w.includes("t") ? (log.debug("add top border"), O(T)) : k(T), w.includes("r") ? (log.debug("add right border"), O(E)) : k(E), w.includes("b") ? (log.debug("add bottom border"), O(T)) : k(T), w.includes("l") ? (log.debug("add left border"), O(E)) : k(E), C.attr("stroke-dasharray", D.join(" "));
|
|
2607
2607
|
}
|
|
2608
2608
|
__name(applyNodePropertyBorders, "applyNodePropertyBorders");
|
|
2609
|
-
var rectWithTitle = /* @__PURE__ */ __name(async (
|
|
2610
|
-
let
|
|
2611
|
-
|
|
2612
|
-
let
|
|
2613
|
-
|
|
2614
|
-
let
|
|
2609
|
+
var rectWithTitle = /* @__PURE__ */ __name(async (S, w) => {
|
|
2610
|
+
let T;
|
|
2611
|
+
T = w.classes ? "node " + w.classes : "node default";
|
|
2612
|
+
let E = S.insert("g").attr("class", T).attr("id", w.domId || w.id), O = E.insert("rect", ":first-child"), k = E.insert("line"), j = E.insert("g").attr("class", "label"), M = w.labelText.flat ? w.labelText.flat() : w.labelText, N = "";
|
|
2613
|
+
N = typeof M == "object" ? M[0] : M, log.info("Label text abc79", N, M, typeof M == "object");
|
|
2614
|
+
let P = j.node().appendChild(await createLabel_default(N, w.labelStyle, !0, !0)), F = {
|
|
2615
2615
|
width: 0,
|
|
2616
2616
|
height: 0
|
|
2617
2617
|
};
|
|
2618
2618
|
if (evaluate(getConfig2().flowchart.htmlLabels)) {
|
|
2619
|
-
let e =
|
|
2620
|
-
|
|
2619
|
+
let e = P.children[0], S = select_default(P);
|
|
2620
|
+
F = e.getBoundingClientRect(), S.attr("width", F.width), S.attr("height", F.height);
|
|
2621
2621
|
}
|
|
2622
|
-
log.info("Text 2",
|
|
2623
|
-
let
|
|
2622
|
+
log.info("Text 2", M);
|
|
2623
|
+
let I = M.slice(1, M.length), L = P.getBBox(), R = j.node().appendChild(await createLabel_default(I.join ? I.join("<br/>") : I, w.labelStyle, !0, !0));
|
|
2624
2624
|
if (evaluate(getConfig2().flowchart.htmlLabels)) {
|
|
2625
2625
|
let e = R.children[0], S = select_default(R);
|
|
2626
|
-
|
|
2626
|
+
F = e.getBoundingClientRect(), S.attr("width", F.width), S.attr("height", F.height);
|
|
2627
2627
|
}
|
|
2628
|
-
let z =
|
|
2629
|
-
return select_default(R).attr("transform", "translate( " + (
|
|
2630
|
-
return intersect_default.rect(
|
|
2631
|
-
},
|
|
2628
|
+
let z = w.padding / 2;
|
|
2629
|
+
return select_default(R).attr("transform", "translate( " + (F.width > L.width ? 0 : (L.width - F.width) / 2) + ", " + (L.height + z + 5) + ")"), select_default(P).attr("transform", "translate( " + (F.width < L.width ? 0 : -(L.width - F.width) / 2) + ", 0)"), F = j.node().getBBox(), j.attr("transform", "translate(" + -F.width / 2 + ", " + (-F.height / 2 - z + 3) + ")"), O.attr("class", "outer title-state").attr("x", -F.width / 2 - z).attr("y", -F.height / 2 - z).attr("width", F.width + w.padding).attr("height", F.height + w.padding), k.attr("class", "divider").attr("x1", -F.width / 2 - z).attr("x2", F.width / 2 + z).attr("y1", -F.height / 2 - z + L.height + z).attr("y2", -F.height / 2 - z + L.height + z), updateNodeBounds(w, O), w.intersect = function(e) {
|
|
2630
|
+
return intersect_default.rect(w, e);
|
|
2631
|
+
}, E;
|
|
2632
2632
|
}, "rectWithTitle"), stadium = /* @__PURE__ */ __name(async (e, S) => {
|
|
2633
2633
|
let { shapeSvg: C, bbox: w } = await labelHelper(e, S, getClassesFromNode(S, void 0), !0), T = w.height + S.padding, E = w.width + T / 4 + S.padding;
|
|
2634
2634
|
return updateNodeBounds(S, C.insert("rect", ":first-child").attr("style", S.style).attr("rx", T / 2).attr("ry", T / 2).attr("x", -E / 2).attr("y", -T / 2).attr("width", E).attr("height", T)), S.intersect = function(e) {
|
|
2635
2635
|
return intersect_default.rect(S, e);
|
|
2636
2636
|
}, C;
|
|
2637
|
-
}, "stadium"), circle2 = /* @__PURE__ */ __name(async (
|
|
2638
|
-
let { shapeSvg:
|
|
2639
|
-
return
|
|
2640
|
-
return log.info("Circle intersect",
|
|
2641
|
-
},
|
|
2642
|
-
}, "circle"), doublecircle = /* @__PURE__ */ __name(async (
|
|
2643
|
-
let { shapeSvg:
|
|
2644
|
-
return
|
|
2645
|
-
return log.info("DoubleCircle intersect",
|
|
2646
|
-
},
|
|
2637
|
+
}, "stadium"), circle2 = /* @__PURE__ */ __name(async (S, C) => {
|
|
2638
|
+
let { shapeSvg: w, bbox: T, halfPadding: E } = await labelHelper(S, C, getClassesFromNode(C, void 0), !0), D = w.insert("circle", ":first-child");
|
|
2639
|
+
return D.attr("style", C.style).attr("rx", C.rx).attr("ry", C.ry).attr("r", T.width / 2 + E).attr("width", T.width + C.padding).attr("height", T.height + C.padding), log.info("Circle main"), updateNodeBounds(C, D), C.intersect = function(S) {
|
|
2640
|
+
return log.info("Circle intersect", C, T.width / 2 + E, S), intersect_default.circle(C, T.width / 2 + E, S);
|
|
2641
|
+
}, w;
|
|
2642
|
+
}, "circle"), doublecircle = /* @__PURE__ */ __name(async (S, C) => {
|
|
2643
|
+
let { shapeSvg: w, bbox: T, halfPadding: E } = await labelHelper(S, C, getClassesFromNode(C, void 0), !0), D = w.insert("g", ":first-child"), O = D.insert("circle"), k = D.insert("circle");
|
|
2644
|
+
return D.attr("class", C.class), O.attr("style", C.style).attr("rx", C.rx).attr("ry", C.ry).attr("r", T.width / 2 + E + 5).attr("width", T.width + C.padding + 10).attr("height", T.height + C.padding + 10), k.attr("style", C.style).attr("rx", C.rx).attr("ry", C.ry).attr("r", T.width / 2 + E).attr("width", T.width + C.padding).attr("height", T.height + C.padding), log.info("DoubleCircle main"), updateNodeBounds(C, O), C.intersect = function(S) {
|
|
2645
|
+
return log.info("DoubleCircle intersect", C, T.width / 2 + E + 5, S), intersect_default.circle(C, T.width / 2 + E + 5, S);
|
|
2646
|
+
}, w;
|
|
2647
2647
|
}, "doublecircle"), subroutine = /* @__PURE__ */ __name(async (e, S) => {
|
|
2648
2648
|
let { shapeSvg: C, bbox: w } = await labelHelper(e, S, getClassesFromNode(S, void 0), !0), T = w.width + S.padding, E = w.height + S.padding, D = [
|
|
2649
2649
|
{
|
|
@@ -2732,61 +2732,61 @@ var rectWithTitle = /* @__PURE__ */ __name(async (e, S) => {
|
|
|
2732
2732
|
fork: forkJoin,
|
|
2733
2733
|
join: forkJoin,
|
|
2734
2734
|
class_box: /* @__PURE__ */ __name(async (e, S) => {
|
|
2735
|
-
let
|
|
2736
|
-
|
|
2737
|
-
let
|
|
2735
|
+
let w = S.padding / 2, T;
|
|
2736
|
+
T = S.classes ? "node " + S.classes : "node default";
|
|
2737
|
+
let E = e.insert("g").attr("class", T).attr("id", S.domId || S.id), O = E.insert("rect", ":first-child"), k = E.insert("line"), j = E.insert("line"), M = 0, N = 4, P = E.insert("g").attr("class", "label"), F = 0, I = S.classData.annotations?.[0], L = S.classData.annotations[0] ? "«" + S.classData.annotations[0] + "»" : "", R = P.node().appendChild(await createLabel_default(L, S.labelStyle, !0, !0)), z = R.getBBox();
|
|
2738
2738
|
if (evaluate(getConfig2().flowchart.htmlLabels)) {
|
|
2739
2739
|
let e = R.children[0], S = select_default(R);
|
|
2740
2740
|
z = e.getBoundingClientRect(), S.attr("width", z.width), S.attr("height", z.height);
|
|
2741
2741
|
}
|
|
2742
|
-
S.classData.annotations[0] && (
|
|
2742
|
+
S.classData.annotations[0] && (N += z.height + 4, M += z.width);
|
|
2743
2743
|
let B = S.classData.label;
|
|
2744
2744
|
S.classData.type !== void 0 && S.classData.type !== "" && (getConfig2().flowchart.htmlLabels ? B += "<" + S.classData.type + ">" : B += "<" + S.classData.type + ">");
|
|
2745
|
-
let V =
|
|
2745
|
+
let V = P.node().appendChild(await createLabel_default(B, S.labelStyle, !0, !0));
|
|
2746
2746
|
select_default(V).attr("class", "classTitle");
|
|
2747
2747
|
let H = V.getBBox();
|
|
2748
2748
|
if (evaluate(getConfig2().flowchart.htmlLabels)) {
|
|
2749
2749
|
let e = V.children[0], S = select_default(V);
|
|
2750
2750
|
H = e.getBoundingClientRect(), S.attr("width", H.width), S.attr("height", H.height);
|
|
2751
2751
|
}
|
|
2752
|
-
|
|
2752
|
+
N += H.height + 4, H.width > M && (M = H.width);
|
|
2753
2753
|
let U = [];
|
|
2754
2754
|
S.classData.members.forEach(async (e) => {
|
|
2755
|
-
let
|
|
2756
|
-
getConfig2().flowchart.htmlLabels && (
|
|
2757
|
-
let
|
|
2755
|
+
let w = e.getDisplayDetails(), T = w.displayText;
|
|
2756
|
+
getConfig2().flowchart.htmlLabels && (T = T.replace(/</g, "<").replace(/>/g, ">"));
|
|
2757
|
+
let E = P.node().appendChild(await createLabel_default(T, w.cssStyle ? w.cssStyle : S.labelStyle, !0, !0)), O = E.getBBox();
|
|
2758
2758
|
if (evaluate(getConfig2().flowchart.htmlLabels)) {
|
|
2759
|
-
let e =
|
|
2760
|
-
|
|
2759
|
+
let e = E.children[0], S = select_default(E);
|
|
2760
|
+
O = e.getBoundingClientRect(), S.attr("width", O.width), S.attr("height", O.height);
|
|
2761
2761
|
}
|
|
2762
|
-
|
|
2763
|
-
}),
|
|
2762
|
+
O.width > M && (M = O.width), N += O.height + 4, U.push(E);
|
|
2763
|
+
}), N += 8;
|
|
2764
2764
|
let W = [];
|
|
2765
2765
|
if (S.classData.methods.forEach(async (e) => {
|
|
2766
|
-
let
|
|
2767
|
-
getConfig2().flowchart.htmlLabels && (
|
|
2768
|
-
let
|
|
2766
|
+
let w = e.getDisplayDetails(), T = w.displayText;
|
|
2767
|
+
getConfig2().flowchart.htmlLabels && (T = T.replace(/</g, "<").replace(/>/g, ">"));
|
|
2768
|
+
let E = P.node().appendChild(await createLabel_default(T, w.cssStyle ? w.cssStyle : S.labelStyle, !0, !0)), O = E.getBBox();
|
|
2769
2769
|
if (evaluate(getConfig2().flowchart.htmlLabels)) {
|
|
2770
|
-
let e =
|
|
2771
|
-
|
|
2770
|
+
let e = E.children[0], S = select_default(E);
|
|
2771
|
+
O = e.getBoundingClientRect(), S.attr("width", O.width), S.attr("height", O.height);
|
|
2772
2772
|
}
|
|
2773
|
-
|
|
2774
|
-
}),
|
|
2775
|
-
let e = (
|
|
2776
|
-
select_default(R).attr("transform", "translate( " + (-1 *
|
|
2773
|
+
O.width > M && (M = O.width), N += O.height + 4, W.push(E);
|
|
2774
|
+
}), N += 8, I) {
|
|
2775
|
+
let e = (M - z.width) / 2;
|
|
2776
|
+
select_default(R).attr("transform", "translate( " + (-1 * M / 2 + e) + ", " + -1 * N / 2 + ")"), F = z.height + 4;
|
|
2777
2777
|
}
|
|
2778
|
-
let G = (
|
|
2779
|
-
return select_default(V).attr("transform", "translate( " + (-1 *
|
|
2780
|
-
select_default(e).attr("transform", "translate( " + -
|
|
2778
|
+
let G = (M - H.width) / 2;
|
|
2779
|
+
return select_default(V).attr("transform", "translate( " + (-1 * M / 2 + G) + ", " + (-1 * N / 2 + F) + ")"), F += H.height + 4, k.attr("class", "divider").attr("x1", -M / 2 - w).attr("x2", M / 2 + w).attr("y1", -N / 2 - w + 8 + F).attr("y2", -N / 2 - w + 8 + F), F += 8, U.forEach((e) => {
|
|
2780
|
+
select_default(e).attr("transform", "translate( " + -M / 2 + ", " + (-1 * N / 2 + F + 8 / 2) + ")");
|
|
2781
2781
|
let S = e?.getBBox();
|
|
2782
|
-
|
|
2783
|
-
}),
|
|
2784
|
-
select_default(e).attr("transform", "translate( " + -
|
|
2782
|
+
F += (S?.height ?? 0) + 4;
|
|
2783
|
+
}), F += 8, j.attr("class", "divider").attr("x1", -M / 2 - w).attr("x2", M / 2 + w).attr("y1", -N / 2 - w + 8 + F).attr("y2", -N / 2 - w + 8 + F), F += 8, W.forEach((e) => {
|
|
2784
|
+
select_default(e).attr("transform", "translate( " + -M / 2 + ", " + (-1 * N / 2 + F) + ")");
|
|
2785
2785
|
let S = e?.getBBox();
|
|
2786
|
-
|
|
2787
|
-
}),
|
|
2786
|
+
F += (S?.height ?? 0) + 4;
|
|
2787
|
+
}), O.attr("style", S.style).attr("class", "outer title-state").attr("x", -M / 2 - w).attr("y", -(N / 2) - w).attr("width", M + S.padding).attr("height", N + S.padding), updateNodeBounds(S, O), S.intersect = function(e) {
|
|
2788
2788
|
return intersect_default.rect(S, e);
|
|
2789
|
-
},
|
|
2789
|
+
}, E;
|
|
2790
2790
|
}, "class_box")
|
|
2791
2791
|
}, nodeElems = {}, insertNode = /* @__PURE__ */ __name(async (e, S, C) => {
|
|
2792
2792
|
let w, T;
|
|
@@ -2795,100 +2795,100 @@ var rectWithTitle = /* @__PURE__ */ __name(async (e, S) => {
|
|
|
2795
2795
|
getConfig2().securityLevel === "sandbox" ? E = "_top" : S.linkTarget && (E = S.linkTarget || "_blank"), w = e.insert("svg:a").attr("xlink:href", S.link).attr("target", E), T = await shapes[S.shape](w, S, C);
|
|
2796
2796
|
} else T = await shapes[S.shape](e, S, C), w = T;
|
|
2797
2797
|
return S.tooltip && T.attr("title", S.tooltip), S.class && T.attr("class", "node default " + S.class), nodeElems[S.id] = w, S.haveCallback && nodeElems[S.id].attr("class", nodeElems[S.id].attr("class") + " clickable"), w;
|
|
2798
|
-
}, "insertNode"), positionNode = /* @__PURE__ */ __name((
|
|
2799
|
-
let
|
|
2800
|
-
log.trace("Transforming node",
|
|
2801
|
-
let
|
|
2802
|
-
return
|
|
2798
|
+
}, "insertNode"), positionNode = /* @__PURE__ */ __name((S) => {
|
|
2799
|
+
let C = nodeElems[S.id];
|
|
2800
|
+
log.trace("Transforming node", S.diff, S, "translate(" + (S.x - S.width / 2 - 5) + ", " + S.width / 2 + ")");
|
|
2801
|
+
let w = S.diff || 0;
|
|
2802
|
+
return S.clusterNode ? C.attr("transform", "translate(" + (S.x + w - S.width / 2) + ", " + (S.y - S.height / 2 - 8) + ")") : C.attr("transform", "translate(" + S.x + ", " + S.y + ")"), w;
|
|
2803
2803
|
}, "positionNode");
|
|
2804
2804
|
function getNodeFromBlock(e, S, C = !1) {
|
|
2805
|
-
let
|
|
2806
|
-
(
|
|
2807
|
-
let
|
|
2808
|
-
switch (
|
|
2805
|
+
let w = e, T = "default";
|
|
2806
|
+
(w?.classes?.length || 0) > 0 && (T = (w?.classes ?? []).join(" ")), T += " flowchart-label";
|
|
2807
|
+
let E = 0, D = "", O;
|
|
2808
|
+
switch (w.type) {
|
|
2809
2809
|
case "round":
|
|
2810
|
-
|
|
2810
|
+
E = 5, D = "rect";
|
|
2811
2811
|
break;
|
|
2812
2812
|
case "composite":
|
|
2813
|
-
|
|
2813
|
+
E = 0, D = "composite", O = 0;
|
|
2814
2814
|
break;
|
|
2815
2815
|
case "square":
|
|
2816
|
-
|
|
2816
|
+
D = "rect";
|
|
2817
2817
|
break;
|
|
2818
2818
|
case "diamond":
|
|
2819
|
-
|
|
2819
|
+
D = "question";
|
|
2820
2820
|
break;
|
|
2821
2821
|
case "hexagon":
|
|
2822
|
-
|
|
2822
|
+
D = "hexagon";
|
|
2823
2823
|
break;
|
|
2824
2824
|
case "block_arrow":
|
|
2825
|
-
|
|
2825
|
+
D = "block_arrow";
|
|
2826
2826
|
break;
|
|
2827
2827
|
case "odd":
|
|
2828
|
-
|
|
2828
|
+
D = "rect_left_inv_arrow";
|
|
2829
2829
|
break;
|
|
2830
2830
|
case "lean_right":
|
|
2831
|
-
|
|
2831
|
+
D = "lean_right";
|
|
2832
2832
|
break;
|
|
2833
2833
|
case "lean_left":
|
|
2834
|
-
|
|
2834
|
+
D = "lean_left";
|
|
2835
2835
|
break;
|
|
2836
2836
|
case "trapezoid":
|
|
2837
|
-
|
|
2837
|
+
D = "trapezoid";
|
|
2838
2838
|
break;
|
|
2839
2839
|
case "inv_trapezoid":
|
|
2840
|
-
|
|
2840
|
+
D = "inv_trapezoid";
|
|
2841
2841
|
break;
|
|
2842
2842
|
case "rect_left_inv_arrow":
|
|
2843
|
-
|
|
2843
|
+
D = "rect_left_inv_arrow";
|
|
2844
2844
|
break;
|
|
2845
2845
|
case "circle":
|
|
2846
|
-
|
|
2846
|
+
D = "circle";
|
|
2847
2847
|
break;
|
|
2848
2848
|
case "ellipse":
|
|
2849
|
-
|
|
2849
|
+
D = "ellipse";
|
|
2850
2850
|
break;
|
|
2851
2851
|
case "stadium":
|
|
2852
|
-
|
|
2852
|
+
D = "stadium";
|
|
2853
2853
|
break;
|
|
2854
2854
|
case "subroutine":
|
|
2855
|
-
|
|
2855
|
+
D = "subroutine";
|
|
2856
2856
|
break;
|
|
2857
2857
|
case "cylinder":
|
|
2858
|
-
|
|
2858
|
+
D = "cylinder";
|
|
2859
2859
|
break;
|
|
2860
2860
|
case "group":
|
|
2861
|
-
|
|
2861
|
+
D = "rect";
|
|
2862
2862
|
break;
|
|
2863
2863
|
case "doublecircle":
|
|
2864
|
-
|
|
2864
|
+
D = "doublecircle";
|
|
2865
2865
|
break;
|
|
2866
|
-
default:
|
|
2866
|
+
default: D = "rect";
|
|
2867
2867
|
}
|
|
2868
|
-
let
|
|
2868
|
+
let k = getStylesFromArray(w?.styles ?? []), A = w.label, j = w.size ?? {
|
|
2869
2869
|
width: 0,
|
|
2870
2870
|
height: 0,
|
|
2871
2871
|
x: 0,
|
|
2872
2872
|
y: 0
|
|
2873
2873
|
};
|
|
2874
2874
|
return {
|
|
2875
|
-
labelStyle:
|
|
2876
|
-
shape:
|
|
2877
|
-
labelText:
|
|
2878
|
-
rx:
|
|
2879
|
-
ry:
|
|
2880
|
-
class:
|
|
2881
|
-
style:
|
|
2882
|
-
id:
|
|
2883
|
-
directions:
|
|
2884
|
-
width:
|
|
2885
|
-
height:
|
|
2886
|
-
x:
|
|
2887
|
-
y:
|
|
2875
|
+
labelStyle: k.labelStyle,
|
|
2876
|
+
shape: D,
|
|
2877
|
+
labelText: A,
|
|
2878
|
+
rx: E,
|
|
2879
|
+
ry: E,
|
|
2880
|
+
class: T,
|
|
2881
|
+
style: k.style,
|
|
2882
|
+
id: w.id,
|
|
2883
|
+
directions: w.directions,
|
|
2884
|
+
width: j.width,
|
|
2885
|
+
height: j.height,
|
|
2886
|
+
x: j.x,
|
|
2887
|
+
y: j.y,
|
|
2888
2888
|
positioned: C,
|
|
2889
2889
|
intersect: void 0,
|
|
2890
|
-
type:
|
|
2891
|
-
padding:
|
|
2890
|
+
type: w.type,
|
|
2891
|
+
padding: O ?? getConfig()?.block?.padding ?? 0
|
|
2892
2892
|
};
|
|
2893
2893
|
}
|
|
2894
2894
|
__name(getNodeFromBlock, "getNodeFromBlock");
|
|
@@ -2923,26 +2923,26 @@ async function insertBlocks(e, S, C) {
|
|
|
2923
2923
|
}
|
|
2924
2924
|
__name(insertBlocks, "insertBlocks");
|
|
2925
2925
|
async function insertEdges(e, S, C, w, T) {
|
|
2926
|
-
let
|
|
2926
|
+
let E = new Graph({
|
|
2927
2927
|
multigraph: !0,
|
|
2928
2928
|
compound: !0
|
|
2929
2929
|
});
|
|
2930
|
-
|
|
2930
|
+
E.setGraph({
|
|
2931
2931
|
rankdir: "TB",
|
|
2932
2932
|
nodesep: 10,
|
|
2933
2933
|
ranksep: 10,
|
|
2934
2934
|
marginx: 8,
|
|
2935
2935
|
marginy: 8
|
|
2936
2936
|
});
|
|
2937
|
-
for (let e of C) e.size &&
|
|
2937
|
+
for (let e of C) e.size && E.setNode(e.id, {
|
|
2938
2938
|
width: e.size.width,
|
|
2939
2939
|
height: e.size.height,
|
|
2940
2940
|
intersect: e.intersect
|
|
2941
2941
|
});
|
|
2942
2942
|
for (let C of S) if (C.start && C.end) {
|
|
2943
|
-
let S = w.getBlock(C.start),
|
|
2944
|
-
if (S?.size &&
|
|
2945
|
-
let w = S.size, O =
|
|
2943
|
+
let S = w.getBlock(C.start), D = w.getBlock(C.end);
|
|
2944
|
+
if (S?.size && D?.size) {
|
|
2945
|
+
let w = S.size, O = D.size, k = [
|
|
2946
2946
|
{
|
|
2947
2947
|
x: w.x,
|
|
2948
2948
|
y: w.y
|
|
@@ -2966,7 +2966,7 @@ async function insertEdges(e, S, C, w, T) {
|
|
|
2966
2966
|
arrowTypeStart: C.arrowTypeStart,
|
|
2967
2967
|
points: k,
|
|
2968
2968
|
classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
|
|
2969
|
-
}, void 0, "block",
|
|
2969
|
+
}, void 0, "block", E, T), C.label && (await insertEdgeLabel(e, {
|
|
2970
2970
|
...C,
|
|
2971
2971
|
label: C.label,
|
|
2972
2972
|
labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
|
|
@@ -2987,21 +2987,21 @@ var diagram = {
|
|
|
2987
2987
|
parser: block_default,
|
|
2988
2988
|
db: blockDB_default,
|
|
2989
2989
|
renderer: {
|
|
2990
|
-
draw: /* @__PURE__ */ __name(async function(
|
|
2991
|
-
let { securityLevel:
|
|
2992
|
-
|
|
2993
|
-
let
|
|
2994
|
-
markers_default(
|
|
2990
|
+
draw: /* @__PURE__ */ __name(async function(S, w, T, E) {
|
|
2991
|
+
let { securityLevel: D, block: k } = getConfig(), A = E.db, j;
|
|
2992
|
+
D === "sandbox" && (j = select_default("#i" + w));
|
|
2993
|
+
let N = select_default(D === "sandbox" ? j.nodes()[0].contentDocument.body : "body"), P = D === "sandbox" ? N.select(`[id="${w}"]`) : select_default(`[id="${w}"]`);
|
|
2994
|
+
markers_default(P, [
|
|
2995
2995
|
"point",
|
|
2996
2996
|
"circle",
|
|
2997
2997
|
"cross"
|
|
2998
|
-
],
|
|
2999
|
-
let
|
|
3000
|
-
await calculateBlockSizes(
|
|
3001
|
-
let z = layout(
|
|
3002
|
-
if (await insertBlocks(
|
|
3003
|
-
let
|
|
3004
|
-
configureSvgSize(
|
|
2998
|
+
], E.type, w);
|
|
2999
|
+
let F = A.getBlocks(), I = A.getBlocksFlat(), L = A.getEdges(), R = P.insert("g").attr("class", "block");
|
|
3000
|
+
await calculateBlockSizes(R, F, A);
|
|
3001
|
+
let z = layout(A);
|
|
3002
|
+
if (await insertBlocks(R, F, A), await insertEdges(R, L, I, A, w), z) {
|
|
3003
|
+
let S = z, C = Math.max(1, Math.round(.125 * (S.width / S.height))), w = S.height + C + 10, T = S.width + 10, { useMaxWidth: E } = k;
|
|
3004
|
+
configureSvgSize(P, w, T, !!E), log.debug("Here Bounds", z, S), P.attr("viewBox", `${S.x - 5} ${S.y - 5} ${S.width + 10} ${S.height + 10}`);
|
|
3005
3005
|
}
|
|
3006
3006
|
}, "draw"),
|
|
3007
3007
|
getClasses: /* @__PURE__ */ __name(function(e, S) {
|