@readme/markdown 9.2.2 → 9.3.1
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/components/TutorialTile.tsx +46 -0
- package/components/index.ts +1 -0
- package/dist/10.node.js +20064 -19229
- package/dist/10.node.js.map +1 -1
- package/dist/122.node.js +23 -0
- package/dist/122.node.js.map +1 -0
- package/dist/{17.node.js → 135.node.js} +109 -110
- package/dist/135.node.js.map +1 -0
- package/dist/136.node.js +23 -0
- package/dist/136.node.js.map +1 -0
- package/dist/{52.node.js → 188.node.js} +211 -196
- package/dist/188.node.js.map +1 -0
- package/dist/214.node.js +1280 -0
- package/dist/214.node.js.map +1 -0
- package/dist/23.node.js +2563 -0
- package/dist/23.node.js.map +1 -0
- package/dist/{867.node.js → 311.node.js} +95 -95
- package/dist/{867.node.js.map → 311.node.js.map} +1 -1
- package/dist/{940.node.js → 339.node.js} +3 -75
- package/dist/339.node.js.map +1 -0
- package/dist/354.node.js +23 -0
- package/dist/354.node.js.map +1 -0
- package/dist/359.node.js +2001 -0
- package/dist/359.node.js.map +1 -0
- package/dist/364.node.js +4435 -0
- package/dist/364.node.js.map +1 -0
- package/dist/{429.node.js → 371.node.js} +196 -139
- package/dist/371.node.js.map +1 -0
- package/dist/{687.node.js → 38.node.js} +761 -761
- package/dist/38.node.js.map +1 -0
- package/dist/391.node.js +522 -0
- package/dist/391.node.js.map +1 -0
- package/dist/462.node.js +23 -0
- package/dist/462.node.js.map +1 -0
- package/dist/48.node.js +57 -0
- package/dist/48.node.js.map +1 -0
- package/dist/486.node.js +16267 -14851
- package/dist/486.node.js.map +1 -1
- package/dist/537.node.js +59 -0
- package/dist/537.node.js.map +1 -0
- package/dist/550.node.js +201 -1408
- package/dist/550.node.js.map +1 -1
- package/dist/{403.node.js → 572.node.js} +118 -118
- package/dist/572.node.js.map +1 -0
- package/dist/580.node.js +1324 -0
- package/dist/580.node.js.map +1 -0
- package/dist/{952.node.js → 649.node.js} +39 -39
- package/dist/{952.node.js.map → 649.node.js.map} +1 -1
- package/dist/740.node.js +23 -0
- package/dist/740.node.js.map +1 -0
- package/dist/741.node.js +23 -0
- package/dist/741.node.js.map +1 -0
- package/dist/779.node.js +57 -0
- package/dist/779.node.js.map +1 -0
- package/dist/805.node.js +1355 -0
- package/dist/805.node.js.map +1 -0
- package/dist/{246.node.js → 855.node.js} +671 -495
- package/dist/855.node.js.map +1 -0
- package/dist/{11.node.js → 870.node.js} +70 -63
- package/dist/870.node.js.map +1 -0
- package/dist/874.node.js +57 -0
- package/dist/874.node.js.map +1 -0
- package/dist/881.node.js +1344 -720
- package/dist/881.node.js.map +1 -1
- package/dist/{906.node.js → 890.node.js} +147 -147
- package/dist/{906.node.js.map → 890.node.js.map} +1 -1
- package/dist/898.node.js +361 -0
- package/dist/898.node.js.map +1 -0
- package/dist/{551.node.js → 912.node.js} +133 -133
- package/dist/{551.node.js.map → 912.node.js.map} +1 -1
- package/dist/{745.node.js → 915.node.js} +86 -85
- package/dist/915.node.js.map +1 -0
- package/dist/982.node.js +1132 -0
- package/dist/982.node.js.map +1 -0
- package/dist/995.node.js +189 -159
- package/dist/995.node.js.map +1 -1
- package/dist/components/TutorialTile.d.ts +3 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/example/RenderError.d.ts +1 -1
- package/dist/lib/plain.d.ts +1 -1
- package/dist/main.js +1921 -332
- package/dist/main.node.js +1912 -333
- package/dist/main.node.js.map +1 -1
- package/package.json +1 -2
- package/dist/11.node.js.map +0 -1
- package/dist/120.node.js +0 -23
- package/dist/120.node.js.map +0 -1
- package/dist/134.node.js +0 -23
- package/dist/134.node.js.map +0 -1
- package/dist/150.node.js +0 -1892
- package/dist/150.node.js.map +0 -1
- package/dist/17.node.js.map +0 -1
- package/dist/246.node.js.map +0 -1
- package/dist/351.node.js +0 -2404
- package/dist/351.node.js.map +0 -1
- package/dist/366.node.js +0 -1185
- package/dist/366.node.js.map +0 -1
- package/dist/403.node.js.map +0 -1
- package/dist/429.node.js.map +0 -1
- package/dist/485.node.js +0 -518
- package/dist/485.node.js.map +0 -1
- package/dist/488.node.js +0 -59
- package/dist/488.node.js.map +0 -1
- package/dist/510.node.js +0 -250
- package/dist/510.node.js.map +0 -1
- package/dist/52.node.js.map +0 -1
- package/dist/617.node.js +0 -23
- package/dist/617.node.js.map +0 -1
- package/dist/687.node.js.map +0 -1
- package/dist/745.node.js.map +0 -1
- package/dist/775.node.js +0 -1904
- package/dist/775.node.js.map +0 -1
- package/dist/788.node.js +0 -1025
- package/dist/788.node.js.map +0 -1
- package/dist/81.node.js +0 -386
- package/dist/81.node.js.map +0 -1
- package/dist/849.node.js +0 -2590
- package/dist/849.node.js.map +0 -1
- package/dist/863.node.js +0 -23
- package/dist/863.node.js.map +0 -1
- package/dist/885.node.js +0 -52
- package/dist/885.node.js.map +0 -1
- package/dist/896.node.js +0 -1617
- package/dist/896.node.js.map +0 -1
- package/dist/91.node.js +0 -23
- package/dist/91.node.js.map +0 -1
- package/dist/940.node.js.map +0 -1
package/dist/150.node.js
DELETED
|
@@ -1,1892 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.id = 150;
|
|
3
|
-
exports.ids = [150];
|
|
4
|
-
exports.modules = {
|
|
5
|
-
|
|
6
|
-
/***/ 7134:
|
|
7
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
8
|
-
|
|
9
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10
|
-
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
11
|
-
/* harmony export */ });
|
|
12
|
-
/* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4090);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/** Used to compose bitmasks for cloning. */
|
|
16
|
-
var CLONE_SYMBOLS_FLAG = 4;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Creates a shallow clone of `value`.
|
|
20
|
-
*
|
|
21
|
-
* **Note:** This method is loosely based on the
|
|
22
|
-
* [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
|
|
23
|
-
* and supports cloning arrays, array buffers, booleans, date objects, maps,
|
|
24
|
-
* numbers, `Object` objects, regexes, sets, strings, symbols, and typed
|
|
25
|
-
* arrays. The own enumerable properties of `arguments` objects are cloned
|
|
26
|
-
* as plain objects. An empty object is returned for uncloneable values such
|
|
27
|
-
* as error objects, functions, DOM nodes, and WeakMaps.
|
|
28
|
-
*
|
|
29
|
-
* @static
|
|
30
|
-
* @memberOf _
|
|
31
|
-
* @since 0.1.0
|
|
32
|
-
* @category Lang
|
|
33
|
-
* @param {*} value The value to clone.
|
|
34
|
-
* @returns {*} Returns the cloned value.
|
|
35
|
-
* @see _.cloneDeep
|
|
36
|
-
* @example
|
|
37
|
-
*
|
|
38
|
-
* var objects = [{ 'a': 1 }, { 'b': 2 }];
|
|
39
|
-
*
|
|
40
|
-
* var shallow = _.clone(objects);
|
|
41
|
-
* console.log(shallow[0] === objects[0]);
|
|
42
|
-
* // => true
|
|
43
|
-
*/
|
|
44
|
-
function clone(value) {
|
|
45
|
-
return (0,_baseClone_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(value, CLONE_SYMBOLS_FLAG);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (clone);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/***/ }),
|
|
52
|
-
|
|
53
|
-
/***/ 2927:
|
|
54
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
55
|
-
|
|
56
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
57
|
-
/* harmony export */ DA: () => (/* binding */ createLabel_default),
|
|
58
|
-
/* harmony export */ IU: () => (/* binding */ clear),
|
|
59
|
-
/* harmony export */ Jo: () => (/* binding */ insertEdge),
|
|
60
|
-
/* harmony export */ T_: () => (/* binding */ positionEdgeLabel),
|
|
61
|
-
/* harmony export */ U7: () => (/* binding */ setNodeElem),
|
|
62
|
-
/* harmony export */ U_: () => (/* binding */ positionNode),
|
|
63
|
-
/* harmony export */ g0: () => (/* binding */ markers_default),
|
|
64
|
-
/* harmony export */ gh: () => (/* binding */ clear2),
|
|
65
|
-
/* harmony export */ jP: () => (/* binding */ insertEdgeLabel),
|
|
66
|
-
/* harmony export */ lC: () => (/* binding */ updateNodeBounds),
|
|
67
|
-
/* harmony export */ nM: () => (/* binding */ intersect_rect_default),
|
|
68
|
-
/* harmony export */ on: () => (/* binding */ insertNode)
|
|
69
|
-
/* harmony export */ });
|
|
70
|
-
/* harmony import */ var _chunk_I3FGKTZ5_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6971);
|
|
71
|
-
/* harmony import */ var _chunk_U7L4IQIU_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5449);
|
|
72
|
-
/* harmony import */ var _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2843);
|
|
73
|
-
/* harmony import */ var _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6322);
|
|
74
|
-
/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8066);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
// src/dagre-wrapper/markers.js
|
|
81
|
-
var insertMarkers = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, markerArray, type, id) => {
|
|
82
|
-
markerArray.forEach((markerName) => {
|
|
83
|
-
markers[markerName](elem, type, id);
|
|
84
|
-
});
|
|
85
|
-
}, "insertMarkers");
|
|
86
|
-
var extension = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
|
|
87
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.trace("Making markers for ", id);
|
|
88
|
-
elem.append("defs").append("marker").attr("id", id + "_" + type + "-extensionStart").attr("class", "marker extension " + type).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");
|
|
89
|
-
elem.append("defs").append("marker").attr("id", id + "_" + type + "-extensionEnd").attr("class", "marker extension " + type).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");
|
|
90
|
-
}, "extension");
|
|
91
|
-
var composition = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
|
|
92
|
-
elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionStart").attr("class", "marker composition " + type).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");
|
|
93
|
-
elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionEnd").attr("class", "marker composition " + type).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");
|
|
94
|
-
}, "composition");
|
|
95
|
-
var aggregation = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
|
|
96
|
-
elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationStart").attr("class", "marker aggregation " + type).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");
|
|
97
|
-
elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationEnd").attr("class", "marker aggregation " + type).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");
|
|
98
|
-
}, "aggregation");
|
|
99
|
-
var dependency = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
|
|
100
|
-
elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyStart").attr("class", "marker dependency " + type).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z");
|
|
101
|
-
elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyEnd").attr("class", "marker dependency " + type).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
102
|
-
}, "dependency");
|
|
103
|
-
var lollipop = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
|
|
104
|
-
elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopStart").attr("class", "marker lollipop " + type).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
|
|
105
|
-
elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopEnd").attr("class", "marker lollipop " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
|
|
106
|
-
}, "lollipop");
|
|
107
|
-
var point = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
|
|
108
|
-
elem.append("marker").attr("id", id + "_" + type + "-pointEnd").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 6).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
109
|
-
elem.append("marker").attr("id", id + "_" + type + "-pointStart").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
110
|
-
}, "point");
|
|
111
|
-
var circle = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
|
|
112
|
-
elem.append("marker").attr("id", id + "_" + type + "-circleEnd").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
113
|
-
elem.append("marker").attr("id", id + "_" + type + "-circleStart").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
114
|
-
}, "circle");
|
|
115
|
-
var cross = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
|
|
116
|
-
elem.append("marker").attr("id", id + "_" + type + "-crossEnd").attr("class", "marker cross " + type).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
|
|
117
|
-
elem.append("marker").attr("id", id + "_" + type + "-crossStart").attr("class", "marker cross " + type).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
|
|
118
|
-
}, "cross");
|
|
119
|
-
var barb = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, type, id) => {
|
|
120
|
-
elem.append("defs").append("marker").attr("id", id + "_" + type + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
|
|
121
|
-
}, "barb");
|
|
122
|
-
var markers = {
|
|
123
|
-
extension,
|
|
124
|
-
composition,
|
|
125
|
-
aggregation,
|
|
126
|
-
dependency,
|
|
127
|
-
lollipop,
|
|
128
|
-
point,
|
|
129
|
-
circle,
|
|
130
|
-
cross,
|
|
131
|
-
barb
|
|
132
|
-
};
|
|
133
|
-
var markers_default = insertMarkers;
|
|
134
|
-
|
|
135
|
-
// src/dagre-wrapper/createLabel.js
|
|
136
|
-
|
|
137
|
-
function applyStyle(dom, styleFn) {
|
|
138
|
-
if (styleFn) {
|
|
139
|
-
dom.attr("style", styleFn);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
(0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(applyStyle, "applyStyle");
|
|
143
|
-
function addHtmlLabel(node) {
|
|
144
|
-
const fo = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject"));
|
|
145
|
-
const div = fo.append("xhtml:div");
|
|
146
|
-
const label = node.label;
|
|
147
|
-
const labelClass = node.isNode ? "nodeLabel" : "edgeLabel";
|
|
148
|
-
const span = div.append("span");
|
|
149
|
-
span.html(label);
|
|
150
|
-
applyStyle(span, node.labelStyle);
|
|
151
|
-
span.attr("class", labelClass);
|
|
152
|
-
applyStyle(div, node.labelStyle);
|
|
153
|
-
div.style("display", "inline-block");
|
|
154
|
-
div.style("white-space", "nowrap");
|
|
155
|
-
div.attr("xmlns", "http://www.w3.org/1999/xhtml");
|
|
156
|
-
return fo.node();
|
|
157
|
-
}
|
|
158
|
-
(0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(addHtmlLabel, "addHtmlLabel");
|
|
159
|
-
var createLabel = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((_vertexText, style, isTitle, isNode) => {
|
|
160
|
-
let vertexText = _vertexText || "";
|
|
161
|
-
if (typeof vertexText === "object") {
|
|
162
|
-
vertexText = vertexText[0];
|
|
163
|
-
}
|
|
164
|
-
if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
|
|
165
|
-
vertexText = vertexText.replace(/\\n|\n/g, "<br />");
|
|
166
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("vertexText" + vertexText);
|
|
167
|
-
const node = {
|
|
168
|
-
isNode,
|
|
169
|
-
label: (0,_chunk_U7L4IQIU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .replaceIconSubstring */ .hE)((0,_chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .decodeEntities */ .Sm)(vertexText)),
|
|
170
|
-
labelStyle: style.replace("fill:", "color:")
|
|
171
|
-
};
|
|
172
|
-
let vertexNode = addHtmlLabel(node);
|
|
173
|
-
return vertexNode;
|
|
174
|
-
} else {
|
|
175
|
-
const svgLabel = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
176
|
-
svgLabel.setAttribute("style", style.replace("color:", "fill:"));
|
|
177
|
-
let rows = [];
|
|
178
|
-
if (typeof vertexText === "string") {
|
|
179
|
-
rows = vertexText.split(/\\n|\n|<br\s*\/?>/gi);
|
|
180
|
-
} else if (Array.isArray(vertexText)) {
|
|
181
|
-
rows = vertexText;
|
|
182
|
-
} else {
|
|
183
|
-
rows = [];
|
|
184
|
-
}
|
|
185
|
-
for (const row of rows) {
|
|
186
|
-
const tspan = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
187
|
-
tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve");
|
|
188
|
-
tspan.setAttribute("dy", "1em");
|
|
189
|
-
tspan.setAttribute("x", "0");
|
|
190
|
-
if (isTitle) {
|
|
191
|
-
tspan.setAttribute("class", "title-row");
|
|
192
|
-
} else {
|
|
193
|
-
tspan.setAttribute("class", "row");
|
|
194
|
-
}
|
|
195
|
-
tspan.textContent = row.trim();
|
|
196
|
-
svgLabel.appendChild(tspan);
|
|
197
|
-
}
|
|
198
|
-
return svgLabel;
|
|
199
|
-
}
|
|
200
|
-
}, "createLabel");
|
|
201
|
-
var createLabel_default = createLabel;
|
|
202
|
-
|
|
203
|
-
// src/dagre-wrapper/shapes/util.js
|
|
204
|
-
|
|
205
|
-
var labelHelper = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node, _classes, isNode) => {
|
|
206
|
-
const config = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)();
|
|
207
|
-
let classes;
|
|
208
|
-
const useHtmlLabels = node.useHtmlLabels || (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)(config.flowchart.htmlLabels);
|
|
209
|
-
if (!_classes) {
|
|
210
|
-
classes = "node default";
|
|
211
|
-
} else {
|
|
212
|
-
classes = _classes;
|
|
213
|
-
}
|
|
214
|
-
const shapeSvg = parent.insert("g").attr("class", classes).attr("id", node.domId || node.id);
|
|
215
|
-
const label = shapeSvg.insert("g").attr("class", "label").attr("style", node.labelStyle);
|
|
216
|
-
let labelText;
|
|
217
|
-
if (node.labelText === void 0) {
|
|
218
|
-
labelText = "";
|
|
219
|
-
} else {
|
|
220
|
-
labelText = typeof node.labelText === "string" ? node.labelText : node.labelText[0];
|
|
221
|
-
}
|
|
222
|
-
const textNode = label.node();
|
|
223
|
-
let text;
|
|
224
|
-
if (node.labelType === "markdown") {
|
|
225
|
-
text = (0,_chunk_U7L4IQIU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .createText */ .GZ)(
|
|
226
|
-
label,
|
|
227
|
-
(0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .sanitizeText */ .jZ)((0,_chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .decodeEntities */ .Sm)(labelText), config),
|
|
228
|
-
{
|
|
229
|
-
useHtmlLabels,
|
|
230
|
-
width: node.width || config.flowchart.wrappingWidth,
|
|
231
|
-
classes: "markdown-node-label"
|
|
232
|
-
},
|
|
233
|
-
config
|
|
234
|
-
);
|
|
235
|
-
} else {
|
|
236
|
-
text = textNode.appendChild(
|
|
237
|
-
createLabel_default((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .sanitizeText */ .jZ)((0,_chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .decodeEntities */ .Sm)(labelText), config), node.labelStyle, false, isNode)
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
let bbox = text.getBBox();
|
|
241
|
-
const halfPadding = node.padding / 2;
|
|
242
|
-
if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)(config.flowchart.htmlLabels)) {
|
|
243
|
-
const div = text.children[0];
|
|
244
|
-
const dv = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(text);
|
|
245
|
-
const images = div.getElementsByTagName("img");
|
|
246
|
-
if (images) {
|
|
247
|
-
const noImgText = labelText.replace(/<img[^>]*>/g, "").trim() === "";
|
|
248
|
-
await Promise.all(
|
|
249
|
-
[...images].map(
|
|
250
|
-
(img) => new Promise((res) => {
|
|
251
|
-
function setupImage() {
|
|
252
|
-
img.style.display = "flex";
|
|
253
|
-
img.style.flexDirection = "column";
|
|
254
|
-
if (noImgText) {
|
|
255
|
-
const bodyFontSize = config.fontSize ? config.fontSize : window.getComputedStyle(document.body).fontSize;
|
|
256
|
-
const enlargingFactor = 5;
|
|
257
|
-
const width = parseInt(bodyFontSize, 10) * enlargingFactor + "px";
|
|
258
|
-
img.style.minWidth = width;
|
|
259
|
-
img.style.maxWidth = width;
|
|
260
|
-
} else {
|
|
261
|
-
img.style.width = "100%";
|
|
262
|
-
}
|
|
263
|
-
res(img);
|
|
264
|
-
}
|
|
265
|
-
(0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(setupImage, "setupImage");
|
|
266
|
-
setTimeout(() => {
|
|
267
|
-
if (img.complete) {
|
|
268
|
-
setupImage();
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
img.addEventListener("error", setupImage);
|
|
272
|
-
img.addEventListener("load", setupImage);
|
|
273
|
-
})
|
|
274
|
-
)
|
|
275
|
-
);
|
|
276
|
-
}
|
|
277
|
-
bbox = div.getBoundingClientRect();
|
|
278
|
-
dv.attr("width", bbox.width);
|
|
279
|
-
dv.attr("height", bbox.height);
|
|
280
|
-
}
|
|
281
|
-
if (useHtmlLabels) {
|
|
282
|
-
label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
|
|
283
|
-
} else {
|
|
284
|
-
label.attr("transform", "translate(0, " + -bbox.height / 2 + ")");
|
|
285
|
-
}
|
|
286
|
-
if (node.centerLabel) {
|
|
287
|
-
label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
|
|
288
|
-
}
|
|
289
|
-
label.insert("rect", ":first-child");
|
|
290
|
-
return { shapeSvg, bbox, halfPadding, label };
|
|
291
|
-
}, "labelHelper");
|
|
292
|
-
var updateNodeBounds = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((node, element) => {
|
|
293
|
-
const bbox = element.node().getBBox();
|
|
294
|
-
node.width = bbox.width;
|
|
295
|
-
node.height = bbox.height;
|
|
296
|
-
}, "updateNodeBounds");
|
|
297
|
-
function insertPolygonShape(parent, w, h, points) {
|
|
298
|
-
return parent.insert("polygon", ":first-child").attr(
|
|
299
|
-
"points",
|
|
300
|
-
points.map(function(d) {
|
|
301
|
-
return d.x + "," + d.y;
|
|
302
|
-
}).join(" ")
|
|
303
|
-
).attr("class", "label-container").attr("transform", "translate(" + -w / 2 + "," + h / 2 + ")");
|
|
304
|
-
}
|
|
305
|
-
(0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(insertPolygonShape, "insertPolygonShape");
|
|
306
|
-
|
|
307
|
-
// src/dagre-wrapper/nodes.js
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
// src/dagre-wrapper/blockArrowHelper.ts
|
|
311
|
-
var expandAndDeduplicateDirections = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((directions) => {
|
|
312
|
-
const uniqueDirections = /* @__PURE__ */ new Set();
|
|
313
|
-
for (const direction of directions) {
|
|
314
|
-
switch (direction) {
|
|
315
|
-
case "x":
|
|
316
|
-
uniqueDirections.add("right");
|
|
317
|
-
uniqueDirections.add("left");
|
|
318
|
-
break;
|
|
319
|
-
case "y":
|
|
320
|
-
uniqueDirections.add("up");
|
|
321
|
-
uniqueDirections.add("down");
|
|
322
|
-
break;
|
|
323
|
-
default:
|
|
324
|
-
uniqueDirections.add(direction);
|
|
325
|
-
break;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
return uniqueDirections;
|
|
329
|
-
}, "expandAndDeduplicateDirections");
|
|
330
|
-
var getArrowPoints = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((duplicatedDirections, bbox, node) => {
|
|
331
|
-
const directions = expandAndDeduplicateDirections(duplicatedDirections);
|
|
332
|
-
const f = 2;
|
|
333
|
-
const height = bbox.height + 2 * node.padding;
|
|
334
|
-
const midpoint = height / f;
|
|
335
|
-
const width = bbox.width + 2 * midpoint + node.padding;
|
|
336
|
-
const padding = node.padding / 2;
|
|
337
|
-
if (directions.has("right") && directions.has("left") && directions.has("up") && directions.has("down")) {
|
|
338
|
-
return [
|
|
339
|
-
// Bottom
|
|
340
|
-
{ x: 0, y: 0 },
|
|
341
|
-
{ x: midpoint, y: 0 },
|
|
342
|
-
{ x: width / 2, y: 2 * padding },
|
|
343
|
-
{ x: width - midpoint, y: 0 },
|
|
344
|
-
{ x: width, y: 0 },
|
|
345
|
-
// Right
|
|
346
|
-
{ x: width, y: -height / 3 },
|
|
347
|
-
{ x: width + 2 * padding, y: -height / 2 },
|
|
348
|
-
{ x: width, y: -2 * height / 3 },
|
|
349
|
-
{ x: width, y: -height },
|
|
350
|
-
// Top
|
|
351
|
-
{ x: width - midpoint, y: -height },
|
|
352
|
-
{ x: width / 2, y: -height - 2 * padding },
|
|
353
|
-
{ x: midpoint, y: -height },
|
|
354
|
-
// Left
|
|
355
|
-
{ x: 0, y: -height },
|
|
356
|
-
{ x: 0, y: -2 * height / 3 },
|
|
357
|
-
{ x: -2 * padding, y: -height / 2 },
|
|
358
|
-
{ x: 0, y: -height / 3 }
|
|
359
|
-
];
|
|
360
|
-
}
|
|
361
|
-
if (directions.has("right") && directions.has("left") && directions.has("up")) {
|
|
362
|
-
return [
|
|
363
|
-
{ x: midpoint, y: 0 },
|
|
364
|
-
{ x: width - midpoint, y: 0 },
|
|
365
|
-
{ x: width, y: -height / 2 },
|
|
366
|
-
{ x: width - midpoint, y: -height },
|
|
367
|
-
{ x: midpoint, y: -height },
|
|
368
|
-
{ x: 0, y: -height / 2 }
|
|
369
|
-
];
|
|
370
|
-
}
|
|
371
|
-
if (directions.has("right") && directions.has("left") && directions.has("down")) {
|
|
372
|
-
return [
|
|
373
|
-
{ x: 0, y: 0 },
|
|
374
|
-
{ x: midpoint, y: -height },
|
|
375
|
-
{ x: width - midpoint, y: -height },
|
|
376
|
-
{ x: width, y: 0 }
|
|
377
|
-
];
|
|
378
|
-
}
|
|
379
|
-
if (directions.has("right") && directions.has("up") && directions.has("down")) {
|
|
380
|
-
return [
|
|
381
|
-
{ x: 0, y: 0 },
|
|
382
|
-
{ x: width, y: -midpoint },
|
|
383
|
-
{ x: width, y: -height + midpoint },
|
|
384
|
-
{ x: 0, y: -height }
|
|
385
|
-
];
|
|
386
|
-
}
|
|
387
|
-
if (directions.has("left") && directions.has("up") && directions.has("down")) {
|
|
388
|
-
return [
|
|
389
|
-
{ x: width, y: 0 },
|
|
390
|
-
{ x: 0, y: -midpoint },
|
|
391
|
-
{ x: 0, y: -height + midpoint },
|
|
392
|
-
{ x: width, y: -height }
|
|
393
|
-
];
|
|
394
|
-
}
|
|
395
|
-
if (directions.has("right") && directions.has("left")) {
|
|
396
|
-
return [
|
|
397
|
-
{ x: midpoint, y: 0 },
|
|
398
|
-
{ x: midpoint, y: -padding },
|
|
399
|
-
{ x: width - midpoint, y: -padding },
|
|
400
|
-
{ x: width - midpoint, y: 0 },
|
|
401
|
-
{ x: width, y: -height / 2 },
|
|
402
|
-
{ x: width - midpoint, y: -height },
|
|
403
|
-
{ x: width - midpoint, y: -height + padding },
|
|
404
|
-
{ x: midpoint, y: -height + padding },
|
|
405
|
-
{ x: midpoint, y: -height },
|
|
406
|
-
{ x: 0, y: -height / 2 }
|
|
407
|
-
];
|
|
408
|
-
}
|
|
409
|
-
if (directions.has("up") && directions.has("down")) {
|
|
410
|
-
return [
|
|
411
|
-
// Bottom center
|
|
412
|
-
{ x: width / 2, y: 0 },
|
|
413
|
-
// Left pont of bottom arrow
|
|
414
|
-
{ x: 0, y: -padding },
|
|
415
|
-
{ x: midpoint, y: -padding },
|
|
416
|
-
// Left top over vertical section
|
|
417
|
-
{ x: midpoint, y: -height + padding },
|
|
418
|
-
{ x: 0, y: -height + padding },
|
|
419
|
-
// Top of arrow
|
|
420
|
-
{ x: width / 2, y: -height },
|
|
421
|
-
{ x: width, y: -height + padding },
|
|
422
|
-
// Top of right vertical bar
|
|
423
|
-
{ x: width - midpoint, y: -height + padding },
|
|
424
|
-
{ x: width - midpoint, y: -padding },
|
|
425
|
-
{ x: width, y: -padding }
|
|
426
|
-
];
|
|
427
|
-
}
|
|
428
|
-
if (directions.has("right") && directions.has("up")) {
|
|
429
|
-
return [
|
|
430
|
-
{ x: 0, y: 0 },
|
|
431
|
-
{ x: width, y: -midpoint },
|
|
432
|
-
{ x: 0, y: -height }
|
|
433
|
-
];
|
|
434
|
-
}
|
|
435
|
-
if (directions.has("right") && directions.has("down")) {
|
|
436
|
-
return [
|
|
437
|
-
{ x: 0, y: 0 },
|
|
438
|
-
{ x: width, y: 0 },
|
|
439
|
-
{ x: 0, y: -height }
|
|
440
|
-
];
|
|
441
|
-
}
|
|
442
|
-
if (directions.has("left") && directions.has("up")) {
|
|
443
|
-
return [
|
|
444
|
-
{ x: width, y: 0 },
|
|
445
|
-
{ x: 0, y: -midpoint },
|
|
446
|
-
{ x: width, y: -height }
|
|
447
|
-
];
|
|
448
|
-
}
|
|
449
|
-
if (directions.has("left") && directions.has("down")) {
|
|
450
|
-
return [
|
|
451
|
-
{ x: width, y: 0 },
|
|
452
|
-
{ x: 0, y: 0 },
|
|
453
|
-
{ x: width, y: -height }
|
|
454
|
-
];
|
|
455
|
-
}
|
|
456
|
-
if (directions.has("right")) {
|
|
457
|
-
return [
|
|
458
|
-
{ x: midpoint, y: -padding },
|
|
459
|
-
{ x: midpoint, y: -padding },
|
|
460
|
-
{ x: width - midpoint, y: -padding },
|
|
461
|
-
{ x: width - midpoint, y: 0 },
|
|
462
|
-
{ x: width, y: -height / 2 },
|
|
463
|
-
{ x: width - midpoint, y: -height },
|
|
464
|
-
{ x: width - midpoint, y: -height + padding },
|
|
465
|
-
// top left corner of arrow
|
|
466
|
-
{ x: midpoint, y: -height + padding },
|
|
467
|
-
{ x: midpoint, y: -height + padding }
|
|
468
|
-
];
|
|
469
|
-
}
|
|
470
|
-
if (directions.has("left")) {
|
|
471
|
-
return [
|
|
472
|
-
{ x: midpoint, y: 0 },
|
|
473
|
-
{ x: midpoint, y: -padding },
|
|
474
|
-
// Two points, the right corners
|
|
475
|
-
{ x: width - midpoint, y: -padding },
|
|
476
|
-
{ x: width - midpoint, y: -height + padding },
|
|
477
|
-
{ x: midpoint, y: -height + padding },
|
|
478
|
-
{ x: midpoint, y: -height },
|
|
479
|
-
{ x: 0, y: -height / 2 }
|
|
480
|
-
];
|
|
481
|
-
}
|
|
482
|
-
if (directions.has("up")) {
|
|
483
|
-
return [
|
|
484
|
-
// Bottom center
|
|
485
|
-
{ x: midpoint, y: -padding },
|
|
486
|
-
// Left top over vertical section
|
|
487
|
-
{ x: midpoint, y: -height + padding },
|
|
488
|
-
{ x: 0, y: -height + padding },
|
|
489
|
-
// Top of arrow
|
|
490
|
-
{ x: width / 2, y: -height },
|
|
491
|
-
{ x: width, y: -height + padding },
|
|
492
|
-
// Top of right vertical bar
|
|
493
|
-
{ x: width - midpoint, y: -height + padding },
|
|
494
|
-
{ x: width - midpoint, y: -padding }
|
|
495
|
-
];
|
|
496
|
-
}
|
|
497
|
-
if (directions.has("down")) {
|
|
498
|
-
return [
|
|
499
|
-
// Bottom center
|
|
500
|
-
{ x: width / 2, y: 0 },
|
|
501
|
-
// Left pont of bottom arrow
|
|
502
|
-
{ x: 0, y: -padding },
|
|
503
|
-
{ x: midpoint, y: -padding },
|
|
504
|
-
// Left top over vertical section
|
|
505
|
-
{ x: midpoint, y: -height + padding },
|
|
506
|
-
{ x: width - midpoint, y: -height + padding },
|
|
507
|
-
{ x: width - midpoint, y: -padding },
|
|
508
|
-
{ x: width, y: -padding }
|
|
509
|
-
];
|
|
510
|
-
}
|
|
511
|
-
return [{ x: 0, y: 0 }];
|
|
512
|
-
}, "getArrowPoints");
|
|
513
|
-
|
|
514
|
-
// src/dagre-wrapper/intersect/intersect-node.js
|
|
515
|
-
function intersectNode(node, point2) {
|
|
516
|
-
return node.intersect(point2);
|
|
517
|
-
}
|
|
518
|
-
(0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(intersectNode, "intersectNode");
|
|
519
|
-
var intersect_node_default = intersectNode;
|
|
520
|
-
|
|
521
|
-
// src/dagre-wrapper/intersect/intersect-ellipse.js
|
|
522
|
-
function intersectEllipse(node, rx, ry, point2) {
|
|
523
|
-
var cx = node.x;
|
|
524
|
-
var cy = node.y;
|
|
525
|
-
var px = cx - point2.x;
|
|
526
|
-
var py = cy - point2.y;
|
|
527
|
-
var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px);
|
|
528
|
-
var dx = Math.abs(rx * ry * px / det);
|
|
529
|
-
if (point2.x < cx) {
|
|
530
|
-
dx = -dx;
|
|
531
|
-
}
|
|
532
|
-
var dy = Math.abs(rx * ry * py / det);
|
|
533
|
-
if (point2.y < cy) {
|
|
534
|
-
dy = -dy;
|
|
535
|
-
}
|
|
536
|
-
return { x: cx + dx, y: cy + dy };
|
|
537
|
-
}
|
|
538
|
-
(0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(intersectEllipse, "intersectEllipse");
|
|
539
|
-
var intersect_ellipse_default = intersectEllipse;
|
|
540
|
-
|
|
541
|
-
// src/dagre-wrapper/intersect/intersect-circle.js
|
|
542
|
-
function intersectCircle(node, rx, point2) {
|
|
543
|
-
return intersect_ellipse_default(node, rx, rx, point2);
|
|
544
|
-
}
|
|
545
|
-
(0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(intersectCircle, "intersectCircle");
|
|
546
|
-
var intersect_circle_default = intersectCircle;
|
|
547
|
-
|
|
548
|
-
// src/dagre-wrapper/intersect/intersect-line.js
|
|
549
|
-
function intersectLine(p1, p2, q1, q2) {
|
|
550
|
-
var a1, a2, b1, b2, c1, c2;
|
|
551
|
-
var r1, r2, r3, r4;
|
|
552
|
-
var denom, offset, num;
|
|
553
|
-
var x, y;
|
|
554
|
-
a1 = p2.y - p1.y;
|
|
555
|
-
b1 = p1.x - p2.x;
|
|
556
|
-
c1 = p2.x * p1.y - p1.x * p2.y;
|
|
557
|
-
r3 = a1 * q1.x + b1 * q1.y + c1;
|
|
558
|
-
r4 = a1 * q2.x + b1 * q2.y + c1;
|
|
559
|
-
if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) {
|
|
560
|
-
return;
|
|
561
|
-
}
|
|
562
|
-
a2 = q2.y - q1.y;
|
|
563
|
-
b2 = q1.x - q2.x;
|
|
564
|
-
c2 = q2.x * q1.y - q1.x * q2.y;
|
|
565
|
-
r1 = a2 * p1.x + b2 * p1.y + c2;
|
|
566
|
-
r2 = a2 * p2.x + b2 * p2.y + c2;
|
|
567
|
-
if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) {
|
|
568
|
-
return;
|
|
569
|
-
}
|
|
570
|
-
denom = a1 * b2 - a2 * b1;
|
|
571
|
-
if (denom === 0) {
|
|
572
|
-
return;
|
|
573
|
-
}
|
|
574
|
-
offset = Math.abs(denom / 2);
|
|
575
|
-
num = b1 * c2 - b2 * c1;
|
|
576
|
-
x = num < 0 ? (num - offset) / denom : (num + offset) / denom;
|
|
577
|
-
num = a2 * c1 - a1 * c2;
|
|
578
|
-
y = num < 0 ? (num - offset) / denom : (num + offset) / denom;
|
|
579
|
-
return { x, y };
|
|
580
|
-
}
|
|
581
|
-
(0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(intersectLine, "intersectLine");
|
|
582
|
-
function sameSign(r1, r2) {
|
|
583
|
-
return r1 * r2 > 0;
|
|
584
|
-
}
|
|
585
|
-
(0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(sameSign, "sameSign");
|
|
586
|
-
var intersect_line_default = intersectLine;
|
|
587
|
-
|
|
588
|
-
// src/dagre-wrapper/intersect/intersect-polygon.js
|
|
589
|
-
var intersect_polygon_default = intersectPolygon;
|
|
590
|
-
function intersectPolygon(node, polyPoints, point2) {
|
|
591
|
-
var x1 = node.x;
|
|
592
|
-
var y1 = node.y;
|
|
593
|
-
var intersections = [];
|
|
594
|
-
var minX = Number.POSITIVE_INFINITY;
|
|
595
|
-
var minY = Number.POSITIVE_INFINITY;
|
|
596
|
-
if (typeof polyPoints.forEach === "function") {
|
|
597
|
-
polyPoints.forEach(function(entry) {
|
|
598
|
-
minX = Math.min(minX, entry.x);
|
|
599
|
-
minY = Math.min(minY, entry.y);
|
|
600
|
-
});
|
|
601
|
-
} else {
|
|
602
|
-
minX = Math.min(minX, polyPoints.x);
|
|
603
|
-
minY = Math.min(minY, polyPoints.y);
|
|
604
|
-
}
|
|
605
|
-
var left = x1 - node.width / 2 - minX;
|
|
606
|
-
var top = y1 - node.height / 2 - minY;
|
|
607
|
-
for (var i = 0; i < polyPoints.length; i++) {
|
|
608
|
-
var p1 = polyPoints[i];
|
|
609
|
-
var p2 = polyPoints[i < polyPoints.length - 1 ? i + 1 : 0];
|
|
610
|
-
var intersect = intersect_line_default(
|
|
611
|
-
node,
|
|
612
|
-
point2,
|
|
613
|
-
{ x: left + p1.x, y: top + p1.y },
|
|
614
|
-
{ x: left + p2.x, y: top + p2.y }
|
|
615
|
-
);
|
|
616
|
-
if (intersect) {
|
|
617
|
-
intersections.push(intersect);
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
if (!intersections.length) {
|
|
621
|
-
return node;
|
|
622
|
-
}
|
|
623
|
-
if (intersections.length > 1) {
|
|
624
|
-
intersections.sort(function(p, q) {
|
|
625
|
-
var pdx = p.x - point2.x;
|
|
626
|
-
var pdy = p.y - point2.y;
|
|
627
|
-
var distp = Math.sqrt(pdx * pdx + pdy * pdy);
|
|
628
|
-
var qdx = q.x - point2.x;
|
|
629
|
-
var qdy = q.y - point2.y;
|
|
630
|
-
var distq = Math.sqrt(qdx * qdx + qdy * qdy);
|
|
631
|
-
return distp < distq ? -1 : distp === distq ? 0 : 1;
|
|
632
|
-
});
|
|
633
|
-
}
|
|
634
|
-
return intersections[0];
|
|
635
|
-
}
|
|
636
|
-
(0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(intersectPolygon, "intersectPolygon");
|
|
637
|
-
|
|
638
|
-
// src/dagre-wrapper/intersect/intersect-rect.js
|
|
639
|
-
var intersectRect = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((node, point2) => {
|
|
640
|
-
var x = node.x;
|
|
641
|
-
var y = node.y;
|
|
642
|
-
var dx = point2.x - x;
|
|
643
|
-
var dy = point2.y - y;
|
|
644
|
-
var w = node.width / 2;
|
|
645
|
-
var h = node.height / 2;
|
|
646
|
-
var sx, sy;
|
|
647
|
-
if (Math.abs(dy) * w > Math.abs(dx) * h) {
|
|
648
|
-
if (dy < 0) {
|
|
649
|
-
h = -h;
|
|
650
|
-
}
|
|
651
|
-
sx = dy === 0 ? 0 : h * dx / dy;
|
|
652
|
-
sy = h;
|
|
653
|
-
} else {
|
|
654
|
-
if (dx < 0) {
|
|
655
|
-
w = -w;
|
|
656
|
-
}
|
|
657
|
-
sx = w;
|
|
658
|
-
sy = dx === 0 ? 0 : w * dy / dx;
|
|
659
|
-
}
|
|
660
|
-
return { x: x + sx, y: y + sy };
|
|
661
|
-
}, "intersectRect");
|
|
662
|
-
var intersect_rect_default = intersectRect;
|
|
663
|
-
|
|
664
|
-
// src/dagre-wrapper/intersect/index.js
|
|
665
|
-
var intersect_default = {
|
|
666
|
-
node: intersect_node_default,
|
|
667
|
-
circle: intersect_circle_default,
|
|
668
|
-
ellipse: intersect_ellipse_default,
|
|
669
|
-
polygon: intersect_polygon_default,
|
|
670
|
-
rect: intersect_rect_default
|
|
671
|
-
};
|
|
672
|
-
|
|
673
|
-
// src/dagre-wrapper/shapes/note.js
|
|
674
|
-
var note = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
675
|
-
const useHtmlLabels = node.useHtmlLabels || (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels;
|
|
676
|
-
if (!useHtmlLabels) {
|
|
677
|
-
node.centerLabel = true;
|
|
678
|
-
}
|
|
679
|
-
const { shapeSvg, bbox, halfPadding } = await labelHelper(
|
|
680
|
-
parent,
|
|
681
|
-
node,
|
|
682
|
-
"node " + node.classes,
|
|
683
|
-
true
|
|
684
|
-
);
|
|
685
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.info("Classes = ", node.classes);
|
|
686
|
-
const rect2 = shapeSvg.insert("rect", ":first-child");
|
|
687
|
-
rect2.attr("rx", node.rx).attr("ry", node.ry).attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + node.padding).attr("height", bbox.height + node.padding);
|
|
688
|
-
updateNodeBounds(node, rect2);
|
|
689
|
-
node.intersect = function(point2) {
|
|
690
|
-
return intersect_default.rect(node, point2);
|
|
691
|
-
};
|
|
692
|
-
return shapeSvg;
|
|
693
|
-
}, "note");
|
|
694
|
-
var note_default = note;
|
|
695
|
-
|
|
696
|
-
// src/dagre-wrapper/nodes.js
|
|
697
|
-
var formatClass = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((str) => {
|
|
698
|
-
if (str) {
|
|
699
|
-
return " " + str;
|
|
700
|
-
}
|
|
701
|
-
return "";
|
|
702
|
-
}, "formatClass");
|
|
703
|
-
var getClassesFromNode = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((node, otherClasses) => {
|
|
704
|
-
return `${otherClasses ? otherClasses : "node default"}${formatClass(node.classes)} ${formatClass(
|
|
705
|
-
node.class
|
|
706
|
-
)}`;
|
|
707
|
-
}, "getClassesFromNode");
|
|
708
|
-
var question = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
709
|
-
const { shapeSvg, bbox } = await labelHelper(
|
|
710
|
-
parent,
|
|
711
|
-
node,
|
|
712
|
-
getClassesFromNode(node, void 0),
|
|
713
|
-
true
|
|
714
|
-
);
|
|
715
|
-
const w = bbox.width + node.padding;
|
|
716
|
-
const h = bbox.height + node.padding;
|
|
717
|
-
const s = w + h;
|
|
718
|
-
const points = [
|
|
719
|
-
{ x: s / 2, y: 0 },
|
|
720
|
-
{ x: s, y: -s / 2 },
|
|
721
|
-
{ x: s / 2, y: -s },
|
|
722
|
-
{ x: 0, y: -s / 2 }
|
|
723
|
-
];
|
|
724
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.info("Question main (Circle)");
|
|
725
|
-
const questionElem = insertPolygonShape(shapeSvg, s, s, points);
|
|
726
|
-
questionElem.attr("style", node.style);
|
|
727
|
-
updateNodeBounds(node, questionElem);
|
|
728
|
-
node.intersect = function(point2) {
|
|
729
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.warn("Intersect called");
|
|
730
|
-
return intersect_default.polygon(node, points, point2);
|
|
731
|
-
};
|
|
732
|
-
return shapeSvg;
|
|
733
|
-
}, "question");
|
|
734
|
-
var choice = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((parent, node) => {
|
|
735
|
-
const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id);
|
|
736
|
-
const s = 28;
|
|
737
|
-
const points = [
|
|
738
|
-
{ x: 0, y: s / 2 },
|
|
739
|
-
{ x: s / 2, y: 0 },
|
|
740
|
-
{ x: 0, y: -s / 2 },
|
|
741
|
-
{ x: -s / 2, y: 0 }
|
|
742
|
-
];
|
|
743
|
-
const choice2 = shapeSvg.insert("polygon", ":first-child").attr(
|
|
744
|
-
"points",
|
|
745
|
-
points.map(function(d) {
|
|
746
|
-
return d.x + "," + d.y;
|
|
747
|
-
}).join(" ")
|
|
748
|
-
);
|
|
749
|
-
choice2.attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28);
|
|
750
|
-
node.width = 28;
|
|
751
|
-
node.height = 28;
|
|
752
|
-
node.intersect = function(point2) {
|
|
753
|
-
return intersect_default.circle(node, 14, point2);
|
|
754
|
-
};
|
|
755
|
-
return shapeSvg;
|
|
756
|
-
}, "choice");
|
|
757
|
-
var hexagon = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
758
|
-
const { shapeSvg, bbox } = await labelHelper(
|
|
759
|
-
parent,
|
|
760
|
-
node,
|
|
761
|
-
getClassesFromNode(node, void 0),
|
|
762
|
-
true
|
|
763
|
-
);
|
|
764
|
-
const f = 4;
|
|
765
|
-
const h = bbox.height + node.padding;
|
|
766
|
-
const m = h / f;
|
|
767
|
-
const w = bbox.width + 2 * m + node.padding;
|
|
768
|
-
const points = [
|
|
769
|
-
{ x: m, y: 0 },
|
|
770
|
-
{ x: w - m, y: 0 },
|
|
771
|
-
{ x: w, y: -h / 2 },
|
|
772
|
-
{ x: w - m, y: -h },
|
|
773
|
-
{ x: m, y: -h },
|
|
774
|
-
{ x: 0, y: -h / 2 }
|
|
775
|
-
];
|
|
776
|
-
const hex = insertPolygonShape(shapeSvg, w, h, points);
|
|
777
|
-
hex.attr("style", node.style);
|
|
778
|
-
updateNodeBounds(node, hex);
|
|
779
|
-
node.intersect = function(point2) {
|
|
780
|
-
return intersect_default.polygon(node, points, point2);
|
|
781
|
-
};
|
|
782
|
-
return shapeSvg;
|
|
783
|
-
}, "hexagon");
|
|
784
|
-
var block_arrow = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
785
|
-
const { shapeSvg, bbox } = await labelHelper(parent, node, void 0, true);
|
|
786
|
-
const f = 2;
|
|
787
|
-
const h = bbox.height + 2 * node.padding;
|
|
788
|
-
const m = h / f;
|
|
789
|
-
const w = bbox.width + 2 * m + node.padding;
|
|
790
|
-
const points = getArrowPoints(node.directions, bbox, node);
|
|
791
|
-
const blockArrow = insertPolygonShape(shapeSvg, w, h, points);
|
|
792
|
-
blockArrow.attr("style", node.style);
|
|
793
|
-
updateNodeBounds(node, blockArrow);
|
|
794
|
-
node.intersect = function(point2) {
|
|
795
|
-
return intersect_default.polygon(node, points, point2);
|
|
796
|
-
};
|
|
797
|
-
return shapeSvg;
|
|
798
|
-
}, "block_arrow");
|
|
799
|
-
var rect_left_inv_arrow = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
800
|
-
const { shapeSvg, bbox } = await labelHelper(
|
|
801
|
-
parent,
|
|
802
|
-
node,
|
|
803
|
-
getClassesFromNode(node, void 0),
|
|
804
|
-
true
|
|
805
|
-
);
|
|
806
|
-
const w = bbox.width + node.padding;
|
|
807
|
-
const h = bbox.height + node.padding;
|
|
808
|
-
const points = [
|
|
809
|
-
{ x: -h / 2, y: 0 },
|
|
810
|
-
{ x: w, y: 0 },
|
|
811
|
-
{ x: w, y: -h },
|
|
812
|
-
{ x: -h / 2, y: -h },
|
|
813
|
-
{ x: 0, y: -h / 2 }
|
|
814
|
-
];
|
|
815
|
-
const el = insertPolygonShape(shapeSvg, w, h, points);
|
|
816
|
-
el.attr("style", node.style);
|
|
817
|
-
node.width = w + h;
|
|
818
|
-
node.height = h;
|
|
819
|
-
node.intersect = function(point2) {
|
|
820
|
-
return intersect_default.polygon(node, points, point2);
|
|
821
|
-
};
|
|
822
|
-
return shapeSvg;
|
|
823
|
-
}, "rect_left_inv_arrow");
|
|
824
|
-
var lean_right = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
825
|
-
const { shapeSvg, bbox } = await labelHelper(parent, node, getClassesFromNode(node), true);
|
|
826
|
-
const w = bbox.width + node.padding;
|
|
827
|
-
const h = bbox.height + node.padding;
|
|
828
|
-
const points = [
|
|
829
|
-
{ x: -2 * h / 6, y: 0 },
|
|
830
|
-
{ x: w - h / 6, y: 0 },
|
|
831
|
-
{ x: w + 2 * h / 6, y: -h },
|
|
832
|
-
{ x: h / 6, y: -h }
|
|
833
|
-
];
|
|
834
|
-
const el = insertPolygonShape(shapeSvg, w, h, points);
|
|
835
|
-
el.attr("style", node.style);
|
|
836
|
-
updateNodeBounds(node, el);
|
|
837
|
-
node.intersect = function(point2) {
|
|
838
|
-
return intersect_default.polygon(node, points, point2);
|
|
839
|
-
};
|
|
840
|
-
return shapeSvg;
|
|
841
|
-
}, "lean_right");
|
|
842
|
-
var lean_left = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
843
|
-
const { shapeSvg, bbox } = await labelHelper(
|
|
844
|
-
parent,
|
|
845
|
-
node,
|
|
846
|
-
getClassesFromNode(node, void 0),
|
|
847
|
-
true
|
|
848
|
-
);
|
|
849
|
-
const w = bbox.width + node.padding;
|
|
850
|
-
const h = bbox.height + node.padding;
|
|
851
|
-
const points = [
|
|
852
|
-
{ x: 2 * h / 6, y: 0 },
|
|
853
|
-
{ x: w + h / 6, y: 0 },
|
|
854
|
-
{ x: w - 2 * h / 6, y: -h },
|
|
855
|
-
{ x: -h / 6, y: -h }
|
|
856
|
-
];
|
|
857
|
-
const el = insertPolygonShape(shapeSvg, w, h, points);
|
|
858
|
-
el.attr("style", node.style);
|
|
859
|
-
updateNodeBounds(node, el);
|
|
860
|
-
node.intersect = function(point2) {
|
|
861
|
-
return intersect_default.polygon(node, points, point2);
|
|
862
|
-
};
|
|
863
|
-
return shapeSvg;
|
|
864
|
-
}, "lean_left");
|
|
865
|
-
var trapezoid = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
866
|
-
const { shapeSvg, bbox } = await labelHelper(
|
|
867
|
-
parent,
|
|
868
|
-
node,
|
|
869
|
-
getClassesFromNode(node, void 0),
|
|
870
|
-
true
|
|
871
|
-
);
|
|
872
|
-
const w = bbox.width + node.padding;
|
|
873
|
-
const h = bbox.height + node.padding;
|
|
874
|
-
const points = [
|
|
875
|
-
{ x: -2 * h / 6, y: 0 },
|
|
876
|
-
{ x: w + 2 * h / 6, y: 0 },
|
|
877
|
-
{ x: w - h / 6, y: -h },
|
|
878
|
-
{ x: h / 6, y: -h }
|
|
879
|
-
];
|
|
880
|
-
const el = insertPolygonShape(shapeSvg, w, h, points);
|
|
881
|
-
el.attr("style", node.style);
|
|
882
|
-
updateNodeBounds(node, el);
|
|
883
|
-
node.intersect = function(point2) {
|
|
884
|
-
return intersect_default.polygon(node, points, point2);
|
|
885
|
-
};
|
|
886
|
-
return shapeSvg;
|
|
887
|
-
}, "trapezoid");
|
|
888
|
-
var inv_trapezoid = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
889
|
-
const { shapeSvg, bbox } = await labelHelper(
|
|
890
|
-
parent,
|
|
891
|
-
node,
|
|
892
|
-
getClassesFromNode(node, void 0),
|
|
893
|
-
true
|
|
894
|
-
);
|
|
895
|
-
const w = bbox.width + node.padding;
|
|
896
|
-
const h = bbox.height + node.padding;
|
|
897
|
-
const points = [
|
|
898
|
-
{ x: h / 6, y: 0 },
|
|
899
|
-
{ x: w - h / 6, y: 0 },
|
|
900
|
-
{ x: w + 2 * h / 6, y: -h },
|
|
901
|
-
{ x: -2 * h / 6, y: -h }
|
|
902
|
-
];
|
|
903
|
-
const el = insertPolygonShape(shapeSvg, w, h, points);
|
|
904
|
-
el.attr("style", node.style);
|
|
905
|
-
updateNodeBounds(node, el);
|
|
906
|
-
node.intersect = function(point2) {
|
|
907
|
-
return intersect_default.polygon(node, points, point2);
|
|
908
|
-
};
|
|
909
|
-
return shapeSvg;
|
|
910
|
-
}, "inv_trapezoid");
|
|
911
|
-
var rect_right_inv_arrow = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
912
|
-
const { shapeSvg, bbox } = await labelHelper(
|
|
913
|
-
parent,
|
|
914
|
-
node,
|
|
915
|
-
getClassesFromNode(node, void 0),
|
|
916
|
-
true
|
|
917
|
-
);
|
|
918
|
-
const w = bbox.width + node.padding;
|
|
919
|
-
const h = bbox.height + node.padding;
|
|
920
|
-
const points = [
|
|
921
|
-
{ x: 0, y: 0 },
|
|
922
|
-
{ x: w + h / 2, y: 0 },
|
|
923
|
-
{ x: w, y: -h / 2 },
|
|
924
|
-
{ x: w + h / 2, y: -h },
|
|
925
|
-
{ x: 0, y: -h }
|
|
926
|
-
];
|
|
927
|
-
const el = insertPolygonShape(shapeSvg, w, h, points);
|
|
928
|
-
el.attr("style", node.style);
|
|
929
|
-
updateNodeBounds(node, el);
|
|
930
|
-
node.intersect = function(point2) {
|
|
931
|
-
return intersect_default.polygon(node, points, point2);
|
|
932
|
-
};
|
|
933
|
-
return shapeSvg;
|
|
934
|
-
}, "rect_right_inv_arrow");
|
|
935
|
-
var cylinder = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
936
|
-
const { shapeSvg, bbox } = await labelHelper(
|
|
937
|
-
parent,
|
|
938
|
-
node,
|
|
939
|
-
getClassesFromNode(node, void 0),
|
|
940
|
-
true
|
|
941
|
-
);
|
|
942
|
-
const w = bbox.width + node.padding;
|
|
943
|
-
const rx = w / 2;
|
|
944
|
-
const ry = rx / (2.5 + w / 50);
|
|
945
|
-
const h = bbox.height + ry + node.padding;
|
|
946
|
-
const shape = "M 0," + ry + " a " + rx + "," + ry + " 0,0,0 " + w + " 0 a " + rx + "," + ry + " 0,0,0 " + -w + " 0 l 0," + h + " a " + rx + "," + ry + " 0,0,0 " + w + " 0 l 0," + -h;
|
|
947
|
-
const el = shapeSvg.attr("label-offset-y", ry).insert("path", ":first-child").attr("style", node.style).attr("d", shape).attr("transform", "translate(" + -w / 2 + "," + -(h / 2 + ry) + ")");
|
|
948
|
-
updateNodeBounds(node, el);
|
|
949
|
-
node.intersect = function(point2) {
|
|
950
|
-
const pos = intersect_default.rect(node, point2);
|
|
951
|
-
const x = pos.x - node.x;
|
|
952
|
-
if (rx != 0 && (Math.abs(x) < node.width / 2 || Math.abs(x) == node.width / 2 && Math.abs(pos.y - node.y) > node.height / 2 - ry)) {
|
|
953
|
-
let y = ry * ry * (1 - x * x / (rx * rx));
|
|
954
|
-
if (y != 0) {
|
|
955
|
-
y = Math.sqrt(y);
|
|
956
|
-
}
|
|
957
|
-
y = ry - y;
|
|
958
|
-
if (point2.y - node.y > 0) {
|
|
959
|
-
y = -y;
|
|
960
|
-
}
|
|
961
|
-
pos.y += y;
|
|
962
|
-
}
|
|
963
|
-
return pos;
|
|
964
|
-
};
|
|
965
|
-
return shapeSvg;
|
|
966
|
-
}, "cylinder");
|
|
967
|
-
var rect = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
968
|
-
const { shapeSvg, bbox, halfPadding } = await labelHelper(
|
|
969
|
-
parent,
|
|
970
|
-
node,
|
|
971
|
-
"node " + node.classes + " " + node.class,
|
|
972
|
-
true
|
|
973
|
-
);
|
|
974
|
-
const rect2 = shapeSvg.insert("rect", ":first-child");
|
|
975
|
-
const totalWidth = node.positioned ? node.width : bbox.width + node.padding;
|
|
976
|
-
const totalHeight = node.positioned ? node.height : bbox.height + node.padding;
|
|
977
|
-
const x = node.positioned ? -totalWidth / 2 : -bbox.width / 2 - halfPadding;
|
|
978
|
-
const y = node.positioned ? -totalHeight / 2 : -bbox.height / 2 - halfPadding;
|
|
979
|
-
rect2.attr("class", "basic label-container").attr("style", node.style).attr("rx", node.rx).attr("ry", node.ry).attr("x", x).attr("y", y).attr("width", totalWidth).attr("height", totalHeight);
|
|
980
|
-
if (node.props) {
|
|
981
|
-
const propKeys = new Set(Object.keys(node.props));
|
|
982
|
-
if (node.props.borders) {
|
|
983
|
-
applyNodePropertyBorders(rect2, node.props.borders, totalWidth, totalHeight);
|
|
984
|
-
propKeys.delete("borders");
|
|
985
|
-
}
|
|
986
|
-
propKeys.forEach((propKey) => {
|
|
987
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.warn(`Unknown node property ${propKey}`);
|
|
988
|
-
});
|
|
989
|
-
}
|
|
990
|
-
updateNodeBounds(node, rect2);
|
|
991
|
-
node.intersect = function(point2) {
|
|
992
|
-
return intersect_default.rect(node, point2);
|
|
993
|
-
};
|
|
994
|
-
return shapeSvg;
|
|
995
|
-
}, "rect");
|
|
996
|
-
var composite = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
997
|
-
const { shapeSvg, bbox, halfPadding } = await labelHelper(
|
|
998
|
-
parent,
|
|
999
|
-
node,
|
|
1000
|
-
"node " + node.classes,
|
|
1001
|
-
true
|
|
1002
|
-
);
|
|
1003
|
-
const rect2 = shapeSvg.insert("rect", ":first-child");
|
|
1004
|
-
const totalWidth = node.positioned ? node.width : bbox.width + node.padding;
|
|
1005
|
-
const totalHeight = node.positioned ? node.height : bbox.height + node.padding;
|
|
1006
|
-
const x = node.positioned ? -totalWidth / 2 : -bbox.width / 2 - halfPadding;
|
|
1007
|
-
const y = node.positioned ? -totalHeight / 2 : -bbox.height / 2 - halfPadding;
|
|
1008
|
-
rect2.attr("class", "basic cluster composite label-container").attr("style", node.style).attr("rx", node.rx).attr("ry", node.ry).attr("x", x).attr("y", y).attr("width", totalWidth).attr("height", totalHeight);
|
|
1009
|
-
if (node.props) {
|
|
1010
|
-
const propKeys = new Set(Object.keys(node.props));
|
|
1011
|
-
if (node.props.borders) {
|
|
1012
|
-
applyNodePropertyBorders(rect2, node.props.borders, totalWidth, totalHeight);
|
|
1013
|
-
propKeys.delete("borders");
|
|
1014
|
-
}
|
|
1015
|
-
propKeys.forEach((propKey) => {
|
|
1016
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.warn(`Unknown node property ${propKey}`);
|
|
1017
|
-
});
|
|
1018
|
-
}
|
|
1019
|
-
updateNodeBounds(node, rect2);
|
|
1020
|
-
node.intersect = function(point2) {
|
|
1021
|
-
return intersect_default.rect(node, point2);
|
|
1022
|
-
};
|
|
1023
|
-
return shapeSvg;
|
|
1024
|
-
}, "composite");
|
|
1025
|
-
var labelRect = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
1026
|
-
const { shapeSvg } = await labelHelper(parent, node, "label", true);
|
|
1027
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.trace("Classes = ", node.class);
|
|
1028
|
-
const rect2 = shapeSvg.insert("rect", ":first-child");
|
|
1029
|
-
const totalWidth = 0;
|
|
1030
|
-
const totalHeight = 0;
|
|
1031
|
-
rect2.attr("width", totalWidth).attr("height", totalHeight);
|
|
1032
|
-
shapeSvg.attr("class", "label edgeLabel");
|
|
1033
|
-
if (node.props) {
|
|
1034
|
-
const propKeys = new Set(Object.keys(node.props));
|
|
1035
|
-
if (node.props.borders) {
|
|
1036
|
-
applyNodePropertyBorders(rect2, node.props.borders, totalWidth, totalHeight);
|
|
1037
|
-
propKeys.delete("borders");
|
|
1038
|
-
}
|
|
1039
|
-
propKeys.forEach((propKey) => {
|
|
1040
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.warn(`Unknown node property ${propKey}`);
|
|
1041
|
-
});
|
|
1042
|
-
}
|
|
1043
|
-
updateNodeBounds(node, rect2);
|
|
1044
|
-
node.intersect = function(point2) {
|
|
1045
|
-
return intersect_default.rect(node, point2);
|
|
1046
|
-
};
|
|
1047
|
-
return shapeSvg;
|
|
1048
|
-
}, "labelRect");
|
|
1049
|
-
function applyNodePropertyBorders(rect2, borders, totalWidth, totalHeight) {
|
|
1050
|
-
const strokeDashArray = [];
|
|
1051
|
-
const addBorder = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((length) => {
|
|
1052
|
-
strokeDashArray.push(length, 0);
|
|
1053
|
-
}, "addBorder");
|
|
1054
|
-
const skipBorder = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((length) => {
|
|
1055
|
-
strokeDashArray.push(0, length);
|
|
1056
|
-
}, "skipBorder");
|
|
1057
|
-
if (borders.includes("t")) {
|
|
1058
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("add top border");
|
|
1059
|
-
addBorder(totalWidth);
|
|
1060
|
-
} else {
|
|
1061
|
-
skipBorder(totalWidth);
|
|
1062
|
-
}
|
|
1063
|
-
if (borders.includes("r")) {
|
|
1064
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("add right border");
|
|
1065
|
-
addBorder(totalHeight);
|
|
1066
|
-
} else {
|
|
1067
|
-
skipBorder(totalHeight);
|
|
1068
|
-
}
|
|
1069
|
-
if (borders.includes("b")) {
|
|
1070
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("add bottom border");
|
|
1071
|
-
addBorder(totalWidth);
|
|
1072
|
-
} else {
|
|
1073
|
-
skipBorder(totalWidth);
|
|
1074
|
-
}
|
|
1075
|
-
if (borders.includes("l")) {
|
|
1076
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("add left border");
|
|
1077
|
-
addBorder(totalHeight);
|
|
1078
|
-
} else {
|
|
1079
|
-
skipBorder(totalHeight);
|
|
1080
|
-
}
|
|
1081
|
-
rect2.attr("stroke-dasharray", strokeDashArray.join(" "));
|
|
1082
|
-
}
|
|
1083
|
-
(0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(applyNodePropertyBorders, "applyNodePropertyBorders");
|
|
1084
|
-
var rectWithTitle = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((parent, node) => {
|
|
1085
|
-
let classes;
|
|
1086
|
-
if (!node.classes) {
|
|
1087
|
-
classes = "node default";
|
|
1088
|
-
} else {
|
|
1089
|
-
classes = "node " + node.classes;
|
|
1090
|
-
}
|
|
1091
|
-
const shapeSvg = parent.insert("g").attr("class", classes).attr("id", node.domId || node.id);
|
|
1092
|
-
const rect2 = shapeSvg.insert("rect", ":first-child");
|
|
1093
|
-
const innerLine = shapeSvg.insert("line");
|
|
1094
|
-
const label = shapeSvg.insert("g").attr("class", "label");
|
|
1095
|
-
const text2 = node.labelText.flat ? node.labelText.flat() : node.labelText;
|
|
1096
|
-
let title = "";
|
|
1097
|
-
if (typeof text2 === "object") {
|
|
1098
|
-
title = text2[0];
|
|
1099
|
-
} else {
|
|
1100
|
-
title = text2;
|
|
1101
|
-
}
|
|
1102
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.info("Label text abc79", title, text2, typeof text2 === "object");
|
|
1103
|
-
const text = label.node().appendChild(createLabel_default(title, node.labelStyle, true, true));
|
|
1104
|
-
let bbox = { width: 0, height: 0 };
|
|
1105
|
-
if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
|
|
1106
|
-
const div = text.children[0];
|
|
1107
|
-
const dv = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(text);
|
|
1108
|
-
bbox = div.getBoundingClientRect();
|
|
1109
|
-
dv.attr("width", bbox.width);
|
|
1110
|
-
dv.attr("height", bbox.height);
|
|
1111
|
-
}
|
|
1112
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.info("Text 2", text2);
|
|
1113
|
-
const textRows = text2.slice(1, text2.length);
|
|
1114
|
-
let titleBox = text.getBBox();
|
|
1115
|
-
const descr = label.node().appendChild(
|
|
1116
|
-
createLabel_default(textRows.join ? textRows.join("<br/>") : textRows, node.labelStyle, true, true)
|
|
1117
|
-
);
|
|
1118
|
-
if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
|
|
1119
|
-
const div = descr.children[0];
|
|
1120
|
-
const dv = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(descr);
|
|
1121
|
-
bbox = div.getBoundingClientRect();
|
|
1122
|
-
dv.attr("width", bbox.width);
|
|
1123
|
-
dv.attr("height", bbox.height);
|
|
1124
|
-
}
|
|
1125
|
-
const halfPadding = node.padding / 2;
|
|
1126
|
-
(0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(descr).attr(
|
|
1127
|
-
"transform",
|
|
1128
|
-
"translate( " + // (titleBox.width - bbox.width) / 2 +
|
|
1129
|
-
(bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ", " + (titleBox.height + halfPadding + 5) + ")"
|
|
1130
|
-
);
|
|
1131
|
-
(0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(text).attr(
|
|
1132
|
-
"transform",
|
|
1133
|
-
"translate( " + // (titleBox.width - bbox.width) / 2 +
|
|
1134
|
-
(bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ", 0)"
|
|
1135
|
-
);
|
|
1136
|
-
bbox = label.node().getBBox();
|
|
1137
|
-
label.attr(
|
|
1138
|
-
"transform",
|
|
1139
|
-
"translate(" + -bbox.width / 2 + ", " + (-bbox.height / 2 - halfPadding + 3) + ")"
|
|
1140
|
-
);
|
|
1141
|
-
rect2.attr("class", "outer title-state").attr("x", -bbox.width / 2 - halfPadding).attr("y", -bbox.height / 2 - halfPadding).attr("width", bbox.width + node.padding).attr("height", bbox.height + node.padding);
|
|
1142
|
-
innerLine.attr("class", "divider").attr("x1", -bbox.width / 2 - halfPadding).attr("x2", bbox.width / 2 + halfPadding).attr("y1", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding).attr("y2", -bbox.height / 2 - halfPadding + titleBox.height + halfPadding);
|
|
1143
|
-
updateNodeBounds(node, rect2);
|
|
1144
|
-
node.intersect = function(point2) {
|
|
1145
|
-
return intersect_default.rect(node, point2);
|
|
1146
|
-
};
|
|
1147
|
-
return shapeSvg;
|
|
1148
|
-
}, "rectWithTitle");
|
|
1149
|
-
var stadium = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
1150
|
-
const { shapeSvg, bbox } = await labelHelper(
|
|
1151
|
-
parent,
|
|
1152
|
-
node,
|
|
1153
|
-
getClassesFromNode(node, void 0),
|
|
1154
|
-
true
|
|
1155
|
-
);
|
|
1156
|
-
const h = bbox.height + node.padding;
|
|
1157
|
-
const w = bbox.width + h / 4 + node.padding;
|
|
1158
|
-
const rect2 = shapeSvg.insert("rect", ":first-child").attr("style", node.style).attr("rx", h / 2).attr("ry", h / 2).attr("x", -w / 2).attr("y", -h / 2).attr("width", w).attr("height", h);
|
|
1159
|
-
updateNodeBounds(node, rect2);
|
|
1160
|
-
node.intersect = function(point2) {
|
|
1161
|
-
return intersect_default.rect(node, point2);
|
|
1162
|
-
};
|
|
1163
|
-
return shapeSvg;
|
|
1164
|
-
}, "stadium");
|
|
1165
|
-
var circle2 = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
1166
|
-
const { shapeSvg, bbox, halfPadding } = await labelHelper(
|
|
1167
|
-
parent,
|
|
1168
|
-
node,
|
|
1169
|
-
getClassesFromNode(node, void 0),
|
|
1170
|
-
true
|
|
1171
|
-
);
|
|
1172
|
-
const circle3 = shapeSvg.insert("circle", ":first-child");
|
|
1173
|
-
circle3.attr("style", node.style).attr("rx", node.rx).attr("ry", node.ry).attr("r", bbox.width / 2 + halfPadding).attr("width", bbox.width + node.padding).attr("height", bbox.height + node.padding);
|
|
1174
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.info("Circle main");
|
|
1175
|
-
updateNodeBounds(node, circle3);
|
|
1176
|
-
node.intersect = function(point2) {
|
|
1177
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.info("Circle intersect", node, bbox.width / 2 + halfPadding, point2);
|
|
1178
|
-
return intersect_default.circle(node, bbox.width / 2 + halfPadding, point2);
|
|
1179
|
-
};
|
|
1180
|
-
return shapeSvg;
|
|
1181
|
-
}, "circle");
|
|
1182
|
-
var doublecircle = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
1183
|
-
const { shapeSvg, bbox, halfPadding } = await labelHelper(
|
|
1184
|
-
parent,
|
|
1185
|
-
node,
|
|
1186
|
-
getClassesFromNode(node, void 0),
|
|
1187
|
-
true
|
|
1188
|
-
);
|
|
1189
|
-
const gap = 5;
|
|
1190
|
-
const circleGroup = shapeSvg.insert("g", ":first-child");
|
|
1191
|
-
const outerCircle = circleGroup.insert("circle");
|
|
1192
|
-
const innerCircle = circleGroup.insert("circle");
|
|
1193
|
-
circleGroup.attr("class", node.class);
|
|
1194
|
-
outerCircle.attr("style", node.style).attr("rx", node.rx).attr("ry", node.ry).attr("r", bbox.width / 2 + halfPadding + gap).attr("width", bbox.width + node.padding + gap * 2).attr("height", bbox.height + node.padding + gap * 2);
|
|
1195
|
-
innerCircle.attr("style", node.style).attr("rx", node.rx).attr("ry", node.ry).attr("r", bbox.width / 2 + halfPadding).attr("width", bbox.width + node.padding).attr("height", bbox.height + node.padding);
|
|
1196
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.info("DoubleCircle main");
|
|
1197
|
-
updateNodeBounds(node, outerCircle);
|
|
1198
|
-
node.intersect = function(point2) {
|
|
1199
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.info("DoubleCircle intersect", node, bbox.width / 2 + halfPadding + gap, point2);
|
|
1200
|
-
return intersect_default.circle(node, bbox.width / 2 + halfPadding + gap, point2);
|
|
1201
|
-
};
|
|
1202
|
-
return shapeSvg;
|
|
1203
|
-
}, "doublecircle");
|
|
1204
|
-
var subroutine = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (parent, node) => {
|
|
1205
|
-
const { shapeSvg, bbox } = await labelHelper(
|
|
1206
|
-
parent,
|
|
1207
|
-
node,
|
|
1208
|
-
getClassesFromNode(node, void 0),
|
|
1209
|
-
true
|
|
1210
|
-
);
|
|
1211
|
-
const w = bbox.width + node.padding;
|
|
1212
|
-
const h = bbox.height + node.padding;
|
|
1213
|
-
const points = [
|
|
1214
|
-
{ x: 0, y: 0 },
|
|
1215
|
-
{ x: w, y: 0 },
|
|
1216
|
-
{ x: w, y: -h },
|
|
1217
|
-
{ x: 0, y: -h },
|
|
1218
|
-
{ x: 0, y: 0 },
|
|
1219
|
-
{ x: -8, y: 0 },
|
|
1220
|
-
{ x: w + 8, y: 0 },
|
|
1221
|
-
{ x: w + 8, y: -h },
|
|
1222
|
-
{ x: -8, y: -h },
|
|
1223
|
-
{ x: -8, y: 0 }
|
|
1224
|
-
];
|
|
1225
|
-
const el = insertPolygonShape(shapeSvg, w, h, points);
|
|
1226
|
-
el.attr("style", node.style);
|
|
1227
|
-
updateNodeBounds(node, el);
|
|
1228
|
-
node.intersect = function(point2) {
|
|
1229
|
-
return intersect_default.polygon(node, points, point2);
|
|
1230
|
-
};
|
|
1231
|
-
return shapeSvg;
|
|
1232
|
-
}, "subroutine");
|
|
1233
|
-
var start = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((parent, node) => {
|
|
1234
|
-
const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id);
|
|
1235
|
-
const circle3 = shapeSvg.insert("circle", ":first-child");
|
|
1236
|
-
circle3.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
|
|
1237
|
-
updateNodeBounds(node, circle3);
|
|
1238
|
-
node.intersect = function(point2) {
|
|
1239
|
-
return intersect_default.circle(node, 7, point2);
|
|
1240
|
-
};
|
|
1241
|
-
return shapeSvg;
|
|
1242
|
-
}, "start");
|
|
1243
|
-
var forkJoin = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((parent, node, dir) => {
|
|
1244
|
-
const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id);
|
|
1245
|
-
let width = 70;
|
|
1246
|
-
let height = 10;
|
|
1247
|
-
if (dir === "LR") {
|
|
1248
|
-
width = 10;
|
|
1249
|
-
height = 70;
|
|
1250
|
-
}
|
|
1251
|
-
const shape = shapeSvg.append("rect").attr("x", -1 * width / 2).attr("y", -1 * height / 2).attr("width", width).attr("height", height).attr("class", "fork-join");
|
|
1252
|
-
updateNodeBounds(node, shape);
|
|
1253
|
-
node.height = node.height + node.padding / 2;
|
|
1254
|
-
node.width = node.width + node.padding / 2;
|
|
1255
|
-
node.intersect = function(point2) {
|
|
1256
|
-
return intersect_default.rect(node, point2);
|
|
1257
|
-
};
|
|
1258
|
-
return shapeSvg;
|
|
1259
|
-
}, "forkJoin");
|
|
1260
|
-
var end = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((parent, node) => {
|
|
1261
|
-
const shapeSvg = parent.insert("g").attr("class", "node default").attr("id", node.domId || node.id);
|
|
1262
|
-
const innerCircle = shapeSvg.insert("circle", ":first-child");
|
|
1263
|
-
const circle3 = shapeSvg.insert("circle", ":first-child");
|
|
1264
|
-
circle3.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
|
|
1265
|
-
innerCircle.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10);
|
|
1266
|
-
updateNodeBounds(node, circle3);
|
|
1267
|
-
node.intersect = function(point2) {
|
|
1268
|
-
return intersect_default.circle(node, 7, point2);
|
|
1269
|
-
};
|
|
1270
|
-
return shapeSvg;
|
|
1271
|
-
}, "end");
|
|
1272
|
-
var class_box = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((parent, node) => {
|
|
1273
|
-
const halfPadding = node.padding / 2;
|
|
1274
|
-
const rowPadding = 4;
|
|
1275
|
-
const lineHeight = 8;
|
|
1276
|
-
let classes;
|
|
1277
|
-
if (!node.classes) {
|
|
1278
|
-
classes = "node default";
|
|
1279
|
-
} else {
|
|
1280
|
-
classes = "node " + node.classes;
|
|
1281
|
-
}
|
|
1282
|
-
const shapeSvg = parent.insert("g").attr("class", classes).attr("id", node.domId || node.id);
|
|
1283
|
-
const rect2 = shapeSvg.insert("rect", ":first-child");
|
|
1284
|
-
const topLine = shapeSvg.insert("line");
|
|
1285
|
-
const bottomLine = shapeSvg.insert("line");
|
|
1286
|
-
let maxWidth = 0;
|
|
1287
|
-
let maxHeight = rowPadding;
|
|
1288
|
-
const labelContainer = shapeSvg.insert("g").attr("class", "label");
|
|
1289
|
-
let verticalPos = 0;
|
|
1290
|
-
const hasInterface = node.classData.annotations?.[0];
|
|
1291
|
-
const interfaceLabelText = node.classData.annotations[0] ? "\xAB" + node.classData.annotations[0] + "\xBB" : "";
|
|
1292
|
-
const interfaceLabel = labelContainer.node().appendChild(createLabel_default(interfaceLabelText, node.labelStyle, true, true));
|
|
1293
|
-
let interfaceBBox = interfaceLabel.getBBox();
|
|
1294
|
-
if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
|
|
1295
|
-
const div = interfaceLabel.children[0];
|
|
1296
|
-
const dv = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(interfaceLabel);
|
|
1297
|
-
interfaceBBox = div.getBoundingClientRect();
|
|
1298
|
-
dv.attr("width", interfaceBBox.width);
|
|
1299
|
-
dv.attr("height", interfaceBBox.height);
|
|
1300
|
-
}
|
|
1301
|
-
if (node.classData.annotations[0]) {
|
|
1302
|
-
maxHeight += interfaceBBox.height + rowPadding;
|
|
1303
|
-
maxWidth += interfaceBBox.width;
|
|
1304
|
-
}
|
|
1305
|
-
let classTitleString = node.classData.label;
|
|
1306
|
-
if (node.classData.type !== void 0 && node.classData.type !== "") {
|
|
1307
|
-
if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels) {
|
|
1308
|
-
classTitleString += "<" + node.classData.type + ">";
|
|
1309
|
-
} else {
|
|
1310
|
-
classTitleString += "<" + node.classData.type + ">";
|
|
1311
|
-
}
|
|
1312
|
-
}
|
|
1313
|
-
const classTitleLabel = labelContainer.node().appendChild(createLabel_default(classTitleString, node.labelStyle, true, true));
|
|
1314
|
-
(0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(classTitleLabel).attr("class", "classTitle");
|
|
1315
|
-
let classTitleBBox = classTitleLabel.getBBox();
|
|
1316
|
-
if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
|
|
1317
|
-
const div = classTitleLabel.children[0];
|
|
1318
|
-
const dv = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(classTitleLabel);
|
|
1319
|
-
classTitleBBox = div.getBoundingClientRect();
|
|
1320
|
-
dv.attr("width", classTitleBBox.width);
|
|
1321
|
-
dv.attr("height", classTitleBBox.height);
|
|
1322
|
-
}
|
|
1323
|
-
maxHeight += classTitleBBox.height + rowPadding;
|
|
1324
|
-
if (classTitleBBox.width > maxWidth) {
|
|
1325
|
-
maxWidth = classTitleBBox.width;
|
|
1326
|
-
}
|
|
1327
|
-
const classAttributes = [];
|
|
1328
|
-
node.classData.members.forEach((member) => {
|
|
1329
|
-
const parsedInfo = member.getDisplayDetails();
|
|
1330
|
-
let parsedText = parsedInfo.displayText;
|
|
1331
|
-
if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels) {
|
|
1332
|
-
parsedText = parsedText.replace(/</g, "<").replace(/>/g, ">");
|
|
1333
|
-
}
|
|
1334
|
-
const lbl = labelContainer.node().appendChild(
|
|
1335
|
-
createLabel_default(
|
|
1336
|
-
parsedText,
|
|
1337
|
-
parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle,
|
|
1338
|
-
true,
|
|
1339
|
-
true
|
|
1340
|
-
)
|
|
1341
|
-
);
|
|
1342
|
-
let bbox = lbl.getBBox();
|
|
1343
|
-
if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
|
|
1344
|
-
const div = lbl.children[0];
|
|
1345
|
-
const dv = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(lbl);
|
|
1346
|
-
bbox = div.getBoundingClientRect();
|
|
1347
|
-
dv.attr("width", bbox.width);
|
|
1348
|
-
dv.attr("height", bbox.height);
|
|
1349
|
-
}
|
|
1350
|
-
if (bbox.width > maxWidth) {
|
|
1351
|
-
maxWidth = bbox.width;
|
|
1352
|
-
}
|
|
1353
|
-
maxHeight += bbox.height + rowPadding;
|
|
1354
|
-
classAttributes.push(lbl);
|
|
1355
|
-
});
|
|
1356
|
-
maxHeight += lineHeight;
|
|
1357
|
-
const classMethods = [];
|
|
1358
|
-
node.classData.methods.forEach((member) => {
|
|
1359
|
-
const parsedInfo = member.getDisplayDetails();
|
|
1360
|
-
let displayText = parsedInfo.displayText;
|
|
1361
|
-
if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels) {
|
|
1362
|
-
displayText = displayText.replace(/</g, "<").replace(/>/g, ">");
|
|
1363
|
-
}
|
|
1364
|
-
const lbl = labelContainer.node().appendChild(
|
|
1365
|
-
createLabel_default(
|
|
1366
|
-
displayText,
|
|
1367
|
-
parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle,
|
|
1368
|
-
true,
|
|
1369
|
-
true
|
|
1370
|
-
)
|
|
1371
|
-
);
|
|
1372
|
-
let bbox = lbl.getBBox();
|
|
1373
|
-
if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels)) {
|
|
1374
|
-
const div = lbl.children[0];
|
|
1375
|
-
const dv = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(lbl);
|
|
1376
|
-
bbox = div.getBoundingClientRect();
|
|
1377
|
-
dv.attr("width", bbox.width);
|
|
1378
|
-
dv.attr("height", bbox.height);
|
|
1379
|
-
}
|
|
1380
|
-
if (bbox.width > maxWidth) {
|
|
1381
|
-
maxWidth = bbox.width;
|
|
1382
|
-
}
|
|
1383
|
-
maxHeight += bbox.height + rowPadding;
|
|
1384
|
-
classMethods.push(lbl);
|
|
1385
|
-
});
|
|
1386
|
-
maxHeight += lineHeight;
|
|
1387
|
-
if (hasInterface) {
|
|
1388
|
-
let diffX2 = (maxWidth - interfaceBBox.width) / 2;
|
|
1389
|
-
(0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(interfaceLabel).attr(
|
|
1390
|
-
"transform",
|
|
1391
|
-
"translate( " + (-1 * maxWidth / 2 + diffX2) + ", " + -1 * maxHeight / 2 + ")"
|
|
1392
|
-
);
|
|
1393
|
-
verticalPos = interfaceBBox.height + rowPadding;
|
|
1394
|
-
}
|
|
1395
|
-
let diffX = (maxWidth - classTitleBBox.width) / 2;
|
|
1396
|
-
(0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(classTitleLabel).attr(
|
|
1397
|
-
"transform",
|
|
1398
|
-
"translate( " + (-1 * maxWidth / 2 + diffX) + ", " + (-1 * maxHeight / 2 + verticalPos) + ")"
|
|
1399
|
-
);
|
|
1400
|
-
verticalPos += classTitleBBox.height + rowPadding;
|
|
1401
|
-
topLine.attr("class", "divider").attr("x1", -maxWidth / 2 - halfPadding).attr("x2", maxWidth / 2 + halfPadding).attr("y1", -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr("y2", -maxHeight / 2 - halfPadding + lineHeight + verticalPos);
|
|
1402
|
-
verticalPos += lineHeight;
|
|
1403
|
-
classAttributes.forEach((lbl) => {
|
|
1404
|
-
(0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(lbl).attr(
|
|
1405
|
-
"transform",
|
|
1406
|
-
"translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos + lineHeight / 2) + ")"
|
|
1407
|
-
);
|
|
1408
|
-
const memberBBox = lbl?.getBBox();
|
|
1409
|
-
verticalPos += (memberBBox?.height ?? 0) + rowPadding;
|
|
1410
|
-
});
|
|
1411
|
-
verticalPos += lineHeight;
|
|
1412
|
-
bottomLine.attr("class", "divider").attr("x1", -maxWidth / 2 - halfPadding).attr("x2", maxWidth / 2 + halfPadding).attr("y1", -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr("y2", -maxHeight / 2 - halfPadding + lineHeight + verticalPos);
|
|
1413
|
-
verticalPos += lineHeight;
|
|
1414
|
-
classMethods.forEach((lbl) => {
|
|
1415
|
-
(0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(lbl).attr(
|
|
1416
|
-
"transform",
|
|
1417
|
-
"translate( " + -maxWidth / 2 + ", " + (-1 * maxHeight / 2 + verticalPos) + ")"
|
|
1418
|
-
);
|
|
1419
|
-
const memberBBox = lbl?.getBBox();
|
|
1420
|
-
verticalPos += (memberBBox?.height ?? 0) + rowPadding;
|
|
1421
|
-
});
|
|
1422
|
-
rect2.attr("style", node.style).attr("class", "outer title-state").attr("x", -maxWidth / 2 - halfPadding).attr("y", -(maxHeight / 2) - halfPadding).attr("width", maxWidth + node.padding).attr("height", maxHeight + node.padding);
|
|
1423
|
-
updateNodeBounds(node, rect2);
|
|
1424
|
-
node.intersect = function(point2) {
|
|
1425
|
-
return intersect_default.rect(node, point2);
|
|
1426
|
-
};
|
|
1427
|
-
return shapeSvg;
|
|
1428
|
-
}, "class_box");
|
|
1429
|
-
var shapes = {
|
|
1430
|
-
rhombus: question,
|
|
1431
|
-
composite,
|
|
1432
|
-
question,
|
|
1433
|
-
rect,
|
|
1434
|
-
labelRect,
|
|
1435
|
-
rectWithTitle,
|
|
1436
|
-
choice,
|
|
1437
|
-
circle: circle2,
|
|
1438
|
-
doublecircle,
|
|
1439
|
-
stadium,
|
|
1440
|
-
hexagon,
|
|
1441
|
-
block_arrow,
|
|
1442
|
-
rect_left_inv_arrow,
|
|
1443
|
-
lean_right,
|
|
1444
|
-
lean_left,
|
|
1445
|
-
trapezoid,
|
|
1446
|
-
inv_trapezoid,
|
|
1447
|
-
rect_right_inv_arrow,
|
|
1448
|
-
cylinder,
|
|
1449
|
-
start,
|
|
1450
|
-
end,
|
|
1451
|
-
note: note_default,
|
|
1452
|
-
subroutine,
|
|
1453
|
-
fork: forkJoin,
|
|
1454
|
-
join: forkJoin,
|
|
1455
|
-
class_box
|
|
1456
|
-
};
|
|
1457
|
-
var nodeElems = {};
|
|
1458
|
-
var insertNode = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async (elem, node, renderOptions) => {
|
|
1459
|
-
let newEl;
|
|
1460
|
-
let el;
|
|
1461
|
-
if (node.link) {
|
|
1462
|
-
let target;
|
|
1463
|
-
if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().securityLevel === "sandbox") {
|
|
1464
|
-
target = "_top";
|
|
1465
|
-
} else if (node.linkTarget) {
|
|
1466
|
-
target = node.linkTarget || "_blank";
|
|
1467
|
-
}
|
|
1468
|
-
newEl = elem.insert("svg:a").attr("xlink:href", node.link).attr("target", target);
|
|
1469
|
-
el = await shapes[node.shape](newEl, node, renderOptions);
|
|
1470
|
-
} else {
|
|
1471
|
-
el = await shapes[node.shape](elem, node, renderOptions);
|
|
1472
|
-
newEl = el;
|
|
1473
|
-
}
|
|
1474
|
-
if (node.tooltip) {
|
|
1475
|
-
el.attr("title", node.tooltip);
|
|
1476
|
-
}
|
|
1477
|
-
if (node.class) {
|
|
1478
|
-
el.attr("class", "node default " + node.class);
|
|
1479
|
-
}
|
|
1480
|
-
nodeElems[node.id] = newEl;
|
|
1481
|
-
if (node.haveCallback) {
|
|
1482
|
-
nodeElems[node.id].attr("class", nodeElems[node.id].attr("class") + " clickable");
|
|
1483
|
-
}
|
|
1484
|
-
return newEl;
|
|
1485
|
-
}, "insertNode");
|
|
1486
|
-
var setNodeElem = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, node) => {
|
|
1487
|
-
nodeElems[node.id] = elem;
|
|
1488
|
-
}, "setNodeElem");
|
|
1489
|
-
var clear = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(() => {
|
|
1490
|
-
nodeElems = {};
|
|
1491
|
-
}, "clear");
|
|
1492
|
-
var positionNode = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((node) => {
|
|
1493
|
-
const el = nodeElems[node.id];
|
|
1494
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.trace(
|
|
1495
|
-
"Transforming node",
|
|
1496
|
-
node.diff,
|
|
1497
|
-
node,
|
|
1498
|
-
"translate(" + (node.x - node.width / 2 - 5) + ", " + node.width / 2 + ")"
|
|
1499
|
-
);
|
|
1500
|
-
const padding = 8;
|
|
1501
|
-
const diff = node.diff || 0;
|
|
1502
|
-
if (node.clusterNode) {
|
|
1503
|
-
el.attr(
|
|
1504
|
-
"transform",
|
|
1505
|
-
"translate(" + (node.x + diff - node.width / 2) + ", " + (node.y - node.height / 2 - padding) + ")"
|
|
1506
|
-
);
|
|
1507
|
-
} else {
|
|
1508
|
-
el.attr("transform", "translate(" + node.x + ", " + node.y + ")");
|
|
1509
|
-
}
|
|
1510
|
-
return diff;
|
|
1511
|
-
}, "positionNode");
|
|
1512
|
-
|
|
1513
|
-
// src/dagre-wrapper/edges.js
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
// src/dagre-wrapper/edgeMarker.ts
|
|
1517
|
-
var addEdgeMarkers = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((svgPath, edge, url, id, diagramType) => {
|
|
1518
|
-
if (edge.arrowTypeStart) {
|
|
1519
|
-
addEdgeMarker(svgPath, "start", edge.arrowTypeStart, url, id, diagramType);
|
|
1520
|
-
}
|
|
1521
|
-
if (edge.arrowTypeEnd) {
|
|
1522
|
-
addEdgeMarker(svgPath, "end", edge.arrowTypeEnd, url, id, diagramType);
|
|
1523
|
-
}
|
|
1524
|
-
}, "addEdgeMarkers");
|
|
1525
|
-
var arrowTypesMap = {
|
|
1526
|
-
arrow_cross: "cross",
|
|
1527
|
-
arrow_point: "point",
|
|
1528
|
-
arrow_barb: "barb",
|
|
1529
|
-
arrow_circle: "circle",
|
|
1530
|
-
aggregation: "aggregation",
|
|
1531
|
-
extension: "extension",
|
|
1532
|
-
composition: "composition",
|
|
1533
|
-
dependency: "dependency",
|
|
1534
|
-
lollipop: "lollipop"
|
|
1535
|
-
};
|
|
1536
|
-
var addEdgeMarker = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((svgPath, position, arrowType, url, id, diagramType) => {
|
|
1537
|
-
const endMarkerType = arrowTypesMap[arrowType];
|
|
1538
|
-
if (!endMarkerType) {
|
|
1539
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.warn(`Unknown arrow type: ${arrowType}`);
|
|
1540
|
-
return;
|
|
1541
|
-
}
|
|
1542
|
-
const suffix = position === "start" ? "Start" : "End";
|
|
1543
|
-
svgPath.attr(`marker-${position}`, `url(${url}#${id}_${diagramType}-${endMarkerType}${suffix})`);
|
|
1544
|
-
}, "addEdgeMarker");
|
|
1545
|
-
|
|
1546
|
-
// src/dagre-wrapper/edges.js
|
|
1547
|
-
var edgeLabels = {};
|
|
1548
|
-
var terminalLabels = {};
|
|
1549
|
-
var clear2 = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(() => {
|
|
1550
|
-
edgeLabels = {};
|
|
1551
|
-
terminalLabels = {};
|
|
1552
|
-
}, "clear");
|
|
1553
|
-
var insertEdgeLabel = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((elem, edge) => {
|
|
1554
|
-
const config = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)();
|
|
1555
|
-
const useHtmlLabels = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .evaluate */ ._3)(config.flowchart.htmlLabels);
|
|
1556
|
-
const labelElement = edge.labelType === "markdown" ? (0,_chunk_U7L4IQIU_mjs__WEBPACK_IMPORTED_MODULE_1__/* .createText */ .GZ)(
|
|
1557
|
-
elem,
|
|
1558
|
-
edge.label,
|
|
1559
|
-
{
|
|
1560
|
-
style: edge.labelStyle,
|
|
1561
|
-
useHtmlLabels,
|
|
1562
|
-
addSvgBackground: true
|
|
1563
|
-
},
|
|
1564
|
-
config
|
|
1565
|
-
) : createLabel_default(edge.label, edge.labelStyle);
|
|
1566
|
-
const edgeLabel = elem.insert("g").attr("class", "edgeLabel");
|
|
1567
|
-
const label = edgeLabel.insert("g").attr("class", "label");
|
|
1568
|
-
label.node().appendChild(labelElement);
|
|
1569
|
-
let bbox = labelElement.getBBox();
|
|
1570
|
-
if (useHtmlLabels) {
|
|
1571
|
-
const div = labelElement.children[0];
|
|
1572
|
-
const dv = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(labelElement);
|
|
1573
|
-
bbox = div.getBoundingClientRect();
|
|
1574
|
-
dv.attr("width", bbox.width);
|
|
1575
|
-
dv.attr("height", bbox.height);
|
|
1576
|
-
}
|
|
1577
|
-
label.attr("transform", "translate(" + -bbox.width / 2 + ", " + -bbox.height / 2 + ")");
|
|
1578
|
-
edgeLabels[edge.id] = edgeLabel;
|
|
1579
|
-
edge.width = bbox.width;
|
|
1580
|
-
edge.height = bbox.height;
|
|
1581
|
-
let fo;
|
|
1582
|
-
if (edge.startLabelLeft) {
|
|
1583
|
-
const startLabelElement = createLabel_default(edge.startLabelLeft, edge.labelStyle);
|
|
1584
|
-
const startEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
|
|
1585
|
-
const inner = startEdgeLabelLeft.insert("g").attr("class", "inner");
|
|
1586
|
-
fo = inner.node().appendChild(startLabelElement);
|
|
1587
|
-
const slBox = startLabelElement.getBBox();
|
|
1588
|
-
inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
|
|
1589
|
-
if (!terminalLabels[edge.id]) {
|
|
1590
|
-
terminalLabels[edge.id] = {};
|
|
1591
|
-
}
|
|
1592
|
-
terminalLabels[edge.id].startLeft = startEdgeLabelLeft;
|
|
1593
|
-
setTerminalWidth(fo, edge.startLabelLeft);
|
|
1594
|
-
}
|
|
1595
|
-
if (edge.startLabelRight) {
|
|
1596
|
-
const startLabelElement = createLabel_default(edge.startLabelRight, edge.labelStyle);
|
|
1597
|
-
const startEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
|
|
1598
|
-
const inner = startEdgeLabelRight.insert("g").attr("class", "inner");
|
|
1599
|
-
fo = startEdgeLabelRight.node().appendChild(startLabelElement);
|
|
1600
|
-
inner.node().appendChild(startLabelElement);
|
|
1601
|
-
const slBox = startLabelElement.getBBox();
|
|
1602
|
-
inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
|
|
1603
|
-
if (!terminalLabels[edge.id]) {
|
|
1604
|
-
terminalLabels[edge.id] = {};
|
|
1605
|
-
}
|
|
1606
|
-
terminalLabels[edge.id].startRight = startEdgeLabelRight;
|
|
1607
|
-
setTerminalWidth(fo, edge.startLabelRight);
|
|
1608
|
-
}
|
|
1609
|
-
if (edge.endLabelLeft) {
|
|
1610
|
-
const endLabelElement = createLabel_default(edge.endLabelLeft, edge.labelStyle);
|
|
1611
|
-
const endEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
|
|
1612
|
-
const inner = endEdgeLabelLeft.insert("g").attr("class", "inner");
|
|
1613
|
-
fo = inner.node().appendChild(endLabelElement);
|
|
1614
|
-
const slBox = endLabelElement.getBBox();
|
|
1615
|
-
inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
|
|
1616
|
-
endEdgeLabelLeft.node().appendChild(endLabelElement);
|
|
1617
|
-
if (!terminalLabels[edge.id]) {
|
|
1618
|
-
terminalLabels[edge.id] = {};
|
|
1619
|
-
}
|
|
1620
|
-
terminalLabels[edge.id].endLeft = endEdgeLabelLeft;
|
|
1621
|
-
setTerminalWidth(fo, edge.endLabelLeft);
|
|
1622
|
-
}
|
|
1623
|
-
if (edge.endLabelRight) {
|
|
1624
|
-
const endLabelElement = createLabel_default(edge.endLabelRight, edge.labelStyle);
|
|
1625
|
-
const endEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
|
|
1626
|
-
const inner = endEdgeLabelRight.insert("g").attr("class", "inner");
|
|
1627
|
-
fo = inner.node().appendChild(endLabelElement);
|
|
1628
|
-
const slBox = endLabelElement.getBBox();
|
|
1629
|
-
inner.attr("transform", "translate(" + -slBox.width / 2 + ", " + -slBox.height / 2 + ")");
|
|
1630
|
-
endEdgeLabelRight.node().appendChild(endLabelElement);
|
|
1631
|
-
if (!terminalLabels[edge.id]) {
|
|
1632
|
-
terminalLabels[edge.id] = {};
|
|
1633
|
-
}
|
|
1634
|
-
terminalLabels[edge.id].endRight = endEdgeLabelRight;
|
|
1635
|
-
setTerminalWidth(fo, edge.endLabelRight);
|
|
1636
|
-
}
|
|
1637
|
-
return labelElement;
|
|
1638
|
-
}, "insertEdgeLabel");
|
|
1639
|
-
function setTerminalWidth(fo, value) {
|
|
1640
|
-
if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.htmlLabels && fo) {
|
|
1641
|
-
fo.style.width = value.length * 9 + "px";
|
|
1642
|
-
fo.style.height = "12px";
|
|
1643
|
-
}
|
|
1644
|
-
}
|
|
1645
|
-
(0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(setTerminalWidth, "setTerminalWidth");
|
|
1646
|
-
var positionEdgeLabel = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((edge, paths) => {
|
|
1647
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("Moving label abc88 ", edge.id, edge.label, edgeLabels[edge.id], paths);
|
|
1648
|
-
let path = paths.updatedPath ? paths.updatedPath : paths.originalPath;
|
|
1649
|
-
const siteConfig = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)();
|
|
1650
|
-
const { subGraphTitleTotalMargin } = (0,_chunk_I3FGKTZ5_mjs__WEBPACK_IMPORTED_MODULE_0__/* .getSubGraphTitleMargins */ .O)(siteConfig);
|
|
1651
|
-
if (edge.label) {
|
|
1652
|
-
const el = edgeLabels[edge.id];
|
|
1653
|
-
let x = edge.x;
|
|
1654
|
-
let y = edge.y;
|
|
1655
|
-
if (path) {
|
|
1656
|
-
const pos = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calcLabelPosition(path);
|
|
1657
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug(
|
|
1658
|
-
"Moving label " + edge.label + " from (",
|
|
1659
|
-
x,
|
|
1660
|
-
",",
|
|
1661
|
-
y,
|
|
1662
|
-
") to (",
|
|
1663
|
-
pos.x,
|
|
1664
|
-
",",
|
|
1665
|
-
pos.y,
|
|
1666
|
-
") abc88"
|
|
1667
|
-
);
|
|
1668
|
-
if (paths.updatedPath) {
|
|
1669
|
-
x = pos.x;
|
|
1670
|
-
y = pos.y;
|
|
1671
|
-
}
|
|
1672
|
-
}
|
|
1673
|
-
el.attr("transform", `translate(${x}, ${y + subGraphTitleTotalMargin / 2})`);
|
|
1674
|
-
}
|
|
1675
|
-
if (edge.startLabelLeft) {
|
|
1676
|
-
const el = terminalLabels[edge.id].startLeft;
|
|
1677
|
-
let x = edge.x;
|
|
1678
|
-
let y = edge.y;
|
|
1679
|
-
if (path) {
|
|
1680
|
-
const pos = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_left", path);
|
|
1681
|
-
x = pos.x;
|
|
1682
|
-
y = pos.y;
|
|
1683
|
-
}
|
|
1684
|
-
el.attr("transform", `translate(${x}, ${y})`);
|
|
1685
|
-
}
|
|
1686
|
-
if (edge.startLabelRight) {
|
|
1687
|
-
const el = terminalLabels[edge.id].startRight;
|
|
1688
|
-
let x = edge.x;
|
|
1689
|
-
let y = edge.y;
|
|
1690
|
-
if (path) {
|
|
1691
|
-
const pos = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calcTerminalLabelPosition(
|
|
1692
|
-
edge.arrowTypeStart ? 10 : 0,
|
|
1693
|
-
"start_right",
|
|
1694
|
-
path
|
|
1695
|
-
);
|
|
1696
|
-
x = pos.x;
|
|
1697
|
-
y = pos.y;
|
|
1698
|
-
}
|
|
1699
|
-
el.attr("transform", `translate(${x}, ${y})`);
|
|
1700
|
-
}
|
|
1701
|
-
if (edge.endLabelLeft) {
|
|
1702
|
-
const el = terminalLabels[edge.id].endLeft;
|
|
1703
|
-
let x = edge.x;
|
|
1704
|
-
let y = edge.y;
|
|
1705
|
-
if (path) {
|
|
1706
|
-
const pos = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path);
|
|
1707
|
-
x = pos.x;
|
|
1708
|
-
y = pos.y;
|
|
1709
|
-
}
|
|
1710
|
-
el.attr("transform", `translate(${x}, ${y})`);
|
|
1711
|
-
}
|
|
1712
|
-
if (edge.endLabelRight) {
|
|
1713
|
-
const el = terminalLabels[edge.id].endRight;
|
|
1714
|
-
let x = edge.x;
|
|
1715
|
-
let y = edge.y;
|
|
1716
|
-
if (path) {
|
|
1717
|
-
const pos = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path);
|
|
1718
|
-
x = pos.x;
|
|
1719
|
-
y = pos.y;
|
|
1720
|
-
}
|
|
1721
|
-
el.attr("transform", `translate(${x}, ${y})`);
|
|
1722
|
-
}
|
|
1723
|
-
}, "positionEdgeLabel");
|
|
1724
|
-
var outsideNode = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((node, point2) => {
|
|
1725
|
-
const x = node.x;
|
|
1726
|
-
const y = node.y;
|
|
1727
|
-
const dx = Math.abs(point2.x - x);
|
|
1728
|
-
const dy = Math.abs(point2.y - y);
|
|
1729
|
-
const w = node.width / 2;
|
|
1730
|
-
const h = node.height / 2;
|
|
1731
|
-
if (dx >= w || dy >= h) {
|
|
1732
|
-
return true;
|
|
1733
|
-
}
|
|
1734
|
-
return false;
|
|
1735
|
-
}, "outsideNode");
|
|
1736
|
-
var intersection = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((node, outsidePoint, insidePoint) => {
|
|
1737
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug(`intersection calc abc89:
|
|
1738
|
-
outsidePoint: ${JSON.stringify(outsidePoint)}
|
|
1739
|
-
insidePoint : ${JSON.stringify(insidePoint)}
|
|
1740
|
-
node : x:${node.x} y:${node.y} w:${node.width} h:${node.height}`);
|
|
1741
|
-
const x = node.x;
|
|
1742
|
-
const y = node.y;
|
|
1743
|
-
const dx = Math.abs(x - insidePoint.x);
|
|
1744
|
-
const w = node.width / 2;
|
|
1745
|
-
let r = insidePoint.x < outsidePoint.x ? w - dx : w + dx;
|
|
1746
|
-
const h = node.height / 2;
|
|
1747
|
-
const Q = Math.abs(outsidePoint.y - insidePoint.y);
|
|
1748
|
-
const R = Math.abs(outsidePoint.x - insidePoint.x);
|
|
1749
|
-
if (Math.abs(y - outsidePoint.y) * w > Math.abs(x - outsidePoint.x) * h) {
|
|
1750
|
-
let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y;
|
|
1751
|
-
r = R * q / Q;
|
|
1752
|
-
const res = {
|
|
1753
|
-
x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r,
|
|
1754
|
-
y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q
|
|
1755
|
-
};
|
|
1756
|
-
if (r === 0) {
|
|
1757
|
-
res.x = outsidePoint.x;
|
|
1758
|
-
res.y = outsidePoint.y;
|
|
1759
|
-
}
|
|
1760
|
-
if (R === 0) {
|
|
1761
|
-
res.x = outsidePoint.x;
|
|
1762
|
-
}
|
|
1763
|
-
if (Q === 0) {
|
|
1764
|
-
res.y = outsidePoint.y;
|
|
1765
|
-
}
|
|
1766
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug(`abc89 topp/bott calc, Q ${Q}, q ${q}, R ${R}, r ${r}`, res);
|
|
1767
|
-
return res;
|
|
1768
|
-
} else {
|
|
1769
|
-
if (insidePoint.x < outsidePoint.x) {
|
|
1770
|
-
r = outsidePoint.x - w - x;
|
|
1771
|
-
} else {
|
|
1772
|
-
r = x - w - outsidePoint.x;
|
|
1773
|
-
}
|
|
1774
|
-
let q = Q * r / R;
|
|
1775
|
-
let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - R + r;
|
|
1776
|
-
let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q : insidePoint.y - q;
|
|
1777
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug(`sides calc abc89, Q ${Q}, q ${q}, R ${R}, r ${r}`, { _x, _y });
|
|
1778
|
-
if (r === 0) {
|
|
1779
|
-
_x = outsidePoint.x;
|
|
1780
|
-
_y = outsidePoint.y;
|
|
1781
|
-
}
|
|
1782
|
-
if (R === 0) {
|
|
1783
|
-
_x = outsidePoint.x;
|
|
1784
|
-
}
|
|
1785
|
-
if (Q === 0) {
|
|
1786
|
-
_y = outsidePoint.y;
|
|
1787
|
-
}
|
|
1788
|
-
return { x: _x, y: _y };
|
|
1789
|
-
}
|
|
1790
|
-
}, "intersection");
|
|
1791
|
-
var cutPathAtIntersect = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((_points, boundaryNode) => {
|
|
1792
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("abc88 cutPathAtIntersect", _points, boundaryNode);
|
|
1793
|
-
let points = [];
|
|
1794
|
-
let lastPointOutside = _points[0];
|
|
1795
|
-
let isInside = false;
|
|
1796
|
-
_points.forEach((point2) => {
|
|
1797
|
-
if (!outsideNode(boundaryNode, point2) && !isInside) {
|
|
1798
|
-
const inter = intersection(boundaryNode, lastPointOutside, point2);
|
|
1799
|
-
let pointPresent = false;
|
|
1800
|
-
points.forEach((p) => {
|
|
1801
|
-
pointPresent = pointPresent || p.x === inter.x && p.y === inter.y;
|
|
1802
|
-
});
|
|
1803
|
-
if (!points.some((e) => e.x === inter.x && e.y === inter.y)) {
|
|
1804
|
-
points.push(inter);
|
|
1805
|
-
}
|
|
1806
|
-
isInside = true;
|
|
1807
|
-
} else {
|
|
1808
|
-
lastPointOutside = point2;
|
|
1809
|
-
if (!isInside) {
|
|
1810
|
-
points.push(point2);
|
|
1811
|
-
}
|
|
1812
|
-
}
|
|
1813
|
-
});
|
|
1814
|
-
return points;
|
|
1815
|
-
}, "cutPathAtIntersect");
|
|
1816
|
-
var insertEdge = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem, e, edge, clusterDb, diagramType, graph, id) {
|
|
1817
|
-
let points = edge.points;
|
|
1818
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("abc88 InsertEdge: edge=", edge, "e=", e);
|
|
1819
|
-
let pointsHasChanged = false;
|
|
1820
|
-
const tail = graph.node(e.v);
|
|
1821
|
-
var head = graph.node(e.w);
|
|
1822
|
-
if (head?.intersect && tail?.intersect) {
|
|
1823
|
-
points = points.slice(1, edge.points.length - 1);
|
|
1824
|
-
points.unshift(tail.intersect(points[0]));
|
|
1825
|
-
points.push(head.intersect(points[points.length - 1]));
|
|
1826
|
-
}
|
|
1827
|
-
if (edge.toCluster) {
|
|
1828
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("to cluster abc88", clusterDb[edge.toCluster]);
|
|
1829
|
-
points = cutPathAtIntersect(edge.points, clusterDb[edge.toCluster].node);
|
|
1830
|
-
pointsHasChanged = true;
|
|
1831
|
-
}
|
|
1832
|
-
if (edge.fromCluster) {
|
|
1833
|
-
_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("from cluster abc88", clusterDb[edge.fromCluster]);
|
|
1834
|
-
points = cutPathAtIntersect(points.reverse(), clusterDb[edge.fromCluster].node).reverse();
|
|
1835
|
-
pointsHasChanged = true;
|
|
1836
|
-
}
|
|
1837
|
-
const lineData = points.filter((p) => !Number.isNaN(p.y));
|
|
1838
|
-
let curve = d3__WEBPACK_IMPORTED_MODULE_4__/* .curveBasis */ .qrM;
|
|
1839
|
-
if (edge.curve && (diagramType === "graph" || diagramType === "flowchart")) {
|
|
1840
|
-
curve = edge.curve;
|
|
1841
|
-
}
|
|
1842
|
-
const { x, y } = (0,_chunk_I3FGKTZ5_mjs__WEBPACK_IMPORTED_MODULE_0__/* .getLineFunctionsWithOffset */ .R)(edge);
|
|
1843
|
-
const lineFunction = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .line */ .n8j)().x(x).y(y).curve(curve);
|
|
1844
|
-
let strokeClasses;
|
|
1845
|
-
switch (edge.thickness) {
|
|
1846
|
-
case "normal":
|
|
1847
|
-
strokeClasses = "edge-thickness-normal";
|
|
1848
|
-
break;
|
|
1849
|
-
case "thick":
|
|
1850
|
-
strokeClasses = "edge-thickness-thick";
|
|
1851
|
-
break;
|
|
1852
|
-
case "invisible":
|
|
1853
|
-
strokeClasses = "edge-thickness-thick";
|
|
1854
|
-
break;
|
|
1855
|
-
default:
|
|
1856
|
-
strokeClasses = "";
|
|
1857
|
-
}
|
|
1858
|
-
switch (edge.pattern) {
|
|
1859
|
-
case "solid":
|
|
1860
|
-
strokeClasses += " edge-pattern-solid";
|
|
1861
|
-
break;
|
|
1862
|
-
case "dotted":
|
|
1863
|
-
strokeClasses += " edge-pattern-dotted";
|
|
1864
|
-
break;
|
|
1865
|
-
case "dashed":
|
|
1866
|
-
strokeClasses += " edge-pattern-dashed";
|
|
1867
|
-
break;
|
|
1868
|
-
}
|
|
1869
|
-
const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", edge.id).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "")).attr("style", edge.style);
|
|
1870
|
-
let url = "";
|
|
1871
|
-
if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().flowchart.arrowMarkerAbsolute || (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().state.arrowMarkerAbsolute) {
|
|
1872
|
-
url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
|
|
1873
|
-
url = url.replace(/\(/g, "\\(");
|
|
1874
|
-
url = url.replace(/\)/g, "\\)");
|
|
1875
|
-
}
|
|
1876
|
-
addEdgeMarkers(svgPath, edge, url, id, diagramType);
|
|
1877
|
-
let paths = {};
|
|
1878
|
-
if (pointsHasChanged) {
|
|
1879
|
-
paths.updatedPath = points;
|
|
1880
|
-
}
|
|
1881
|
-
paths.originalPath = edge.points;
|
|
1882
|
-
return paths;
|
|
1883
|
-
}, "insertEdge");
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
/***/ })
|
|
1889
|
-
|
|
1890
|
-
};
|
|
1891
|
-
;
|
|
1892
|
-
//# sourceMappingURL=150.node.js.map
|