@loopstack/loopstack-studio 0.29.4 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.js +3 -1
- package/dist/api/config.js +5 -4
- package/dist/api/environments.js +5 -1
- package/dist/api/processor.js +4 -1
- package/dist/app/EnvironmentEmbedRoot.js +22 -30
- package/dist/components/ai-elements/code-block.js +4 -4
- package/dist/components/dynamic-form/CodeContent.js +1 -1
- package/dist/components/dynamic-form/Form.js +31 -51
- package/dist/components/dynamic-form/FormBody.js +1 -1
- package/dist/components/motion/FadeIn.js +72 -0
- package/dist/components/motion/StreamingText.js +49 -0
- package/dist/components/ui/accordion.js +2 -2
- package/dist/components/ui-widgets/UiWidget.js +11 -10
- package/dist/components/ui-widgets/widgets/AiPromptInput.js +31 -28
- package/dist/events/sse-client-events.js +7 -1
- package/dist/features/code-explorer/components/FileContentViewer.js +2 -2
- package/dist/features/debug/components/WorkflowFlowViewer.js +49 -51
- package/dist/features/documents/DocumentRenderer.js +18 -17
- package/dist/features/documents/components/DocumentItem.js +42 -20
- package/dist/features/documents/components/DocumentList.js +34 -36
- package/dist/features/documents/components/DocumentMetadataPills.js +102 -49
- package/dist/features/documents/document-details/DocumentDetails.js +577 -377
- package/dist/features/documents/document-details/PromptDetails.js +118 -130
- package/dist/features/documents/document-details/document-debug-utils.js +100 -0
- package/dist/features/documents/renderers/ChoicesRenderer.js +41 -38
- package/dist/features/documents/renderers/ConfirmPromptRenderer.js +31 -28
- package/dist/features/documents/renderers/DocumentFormRenderer.js +62 -70
- package/dist/features/documents/renderers/LlmMessage.js +52 -47
- package/dist/features/documents/renderers/TextPromptRenderer.js +32 -29
- package/dist/features/documents/renderers/useDocumentTransition.js +4 -4
- package/dist/features/feature-registry/FeatureRegistryProvider.js +32 -10
- package/dist/features/feature-registry/available-features.js +12 -0
- package/dist/features/feature-registry/index.js +2 -1
- package/dist/features/file-explorer/components/FileExplorerPanel.js +55 -51
- package/dist/features/git/components/GitBranchBadge.js +31 -0
- package/dist/features/git/components/GitCommitList.js +46 -0
- package/dist/features/git/components/GitRemoteStatus.js +84 -0
- package/dist/features/git/components/WorkbenchGitPanel.js +81 -0
- package/dist/features/git/git-feature.js +12 -0
- package/dist/features/git/hooks/useGit.js +78 -0
- package/dist/features/git/index.js +1 -0
- package/dist/features/oauth/OAuthPromptRenderer.js +137 -142
- package/dist/features/runs/Runs.js +4 -4
- package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
- package/dist/features/secrets/renderers/SecretInputRenderer.js +30 -29
- package/dist/features/workbench/Workbench.js +25 -33
- package/dist/features/workbench/WorkflowItem.js +9 -9
- package/dist/features/workbench/WorkflowList.js +61 -62
- package/dist/features/workbench/components/NewRunDialog.js +237 -209
- package/dist/features/workbench/components/RecentRunItem.js +3 -3
- package/dist/features/workbench/components/WorkbenchEnvironmentPanel.js +8 -8
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +1 -1
- package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
- package/dist/features/workbench/components/WorkflowForms.js +11 -10
- package/dist/features/workbench/components/WorkflowHistoryItem.js +16 -36
- package/dist/features/workbench/components/WorkflowHistoryList.js +19 -17
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +3 -3
- package/dist/features/workbench/hooks/useLlmStreamingDocuments.js +159 -0
- package/dist/features/workbench/hooks/useWorkflowData.js +58 -31
- package/dist/features/workbench/index.js +2 -2
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +53 -53
- package/dist/features/workspaces/Workspaces.js +134 -125
- package/dist/features/workspaces/components/CreateWorkspace.js +115 -107
- package/dist/features/workspaces/components/ExecutionTimeline.js +2 -2
- package/dist/features/workspaces/components/WorkflowRunForm.js +127 -104
- package/dist/features/workspaces/components/WorkspaceHomePage.js +6 -89
- package/dist/features/workspaces/components/workflow-form/ArgumentsView.js +1 -1
- package/dist/features/workspaces/components/workflow-form/SelectionView.js +15 -15
- package/dist/hooks/index.js +3 -2
- package/dist/hooks/query-keys.js +43 -30
- package/dist/hooks/useConfig.js +28 -22
- package/dist/hooks/useEnvironments.js +27 -2
- package/dist/hooks/useProcessor.js +14 -1
- package/dist/hooks/useWorkflows.js +4 -4
- package/dist/index.d.ts +116 -15
- package/dist/index.js +9 -8
- package/dist/node_modules/d3/src/index.js +13 -13
- package/dist/node_modules/d3-scale/src/continuous.js +16 -16
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-3BPJPVTR.js +43 -43
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-GPEHLZMM.js +270 -270
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAUBKEIU.js +90 -90
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-3OPIFGDE.js +458 -458
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-55IACEB6.js +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5ZQYHXKU.js +37 -37
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-727SXJPM.js +208 -208
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-KSCS5N6A.js +145 -145
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ND2GUHAM.js +7 -7
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-O5CBEL6O.js +41 -41
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-WU5MYG2G.js +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/cose-bilkent-S5V4N54A.js +6 -6
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-KO2AKTUF.js +30 -30
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-OG6HWLK6.js +82 -82
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-TEJ5UH35.js +65 -65
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-I6XJVG4X.js +227 -227
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-6RSMTGT7.js +104 -104
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-PVQCEYII.js +104 -104
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-JHISSGLW.js +49 -49
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-W4KKPZXB.js +101 -101
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-5OEKKPKP.js +20 -20
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-3UESZ5HK.js +354 -354
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-AJRCARHV.js +53 -53
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-PNZ67QCA.js +113 -113
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-CIIHVFJN.js +90 -90
- package/dist/node_modules/mermaid/dist/mermaid.core.js +156 -156
- package/dist/node_modules/motion/dist/es/react.js +9 -2
- package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
- package/dist/pages/DebugWorkflowsPage.js +76 -106
- package/dist/pages/EmbedWorkbenchPage.js +1 -1
- package/dist/pages/PreviewWorkbenchPage.js +6 -6
- package/dist/pages/WorkbenchPage.js +43 -47
- package/dist/pages/WorkflowDebugPage.js +6 -12
- package/dist/pages/WorkspacePage.js +40 -66
- package/dist/pages/WorkspaceRunsPage.js +24 -31
- package/package.json +2 -2
|
@@ -1,51 +1,51 @@
|
|
|
1
|
+
import select_default from "../../../../d3-selection/src/select.js";
|
|
1
2
|
import { __name, log } from "./chunk-AGHRB4JF.js";
|
|
2
3
|
import { evaluate, getConfig, getConfig2, getEffectiveHtmlLabels, hasKatex, parseGenericTypes, sanitizeText, sanitizeText3 } from "./chunk-CSCIHK7Q.js";
|
|
3
|
-
import select_default from "../../../../d3-selection/src/select.js";
|
|
4
4
|
import "../../../../d3/src/index.js";
|
|
5
5
|
import { calculateTextWidth, decodeEntities, handleUndefinedAttr } from "./chunk-5ZQYHXKU.js";
|
|
6
6
|
import { configureLabelImages, getSubGraphTitleMargins } from "./chunk-L5ZTLDWV.js";
|
|
7
7
|
import { compileStyles, solidStateFill, styles2String, userNodeOverrides } from "./chunk-NZK2D7GU.js";
|
|
8
8
|
import { createText, getIconSVG } from "./chunk-O5CBEL6O.js";
|
|
9
9
|
import { at } from "../../../../roughjs/bundled/rough.esm.js";
|
|
10
|
-
var labelHelper = /* @__PURE__ */ __name(async (
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
let
|
|
14
|
-
h =
|
|
15
|
-
let y = !!
|
|
16
|
-
useHtmlLabels:
|
|
17
|
-
width:
|
|
10
|
+
var labelHelper = /* @__PURE__ */ __name(async (a, o, c) => {
|
|
11
|
+
let u, d = o.useHtmlLabels || evaluate(getConfig2()?.htmlLabels);
|
|
12
|
+
u = c || "node default";
|
|
13
|
+
let f = a.insert("g").attr("class", u).attr("id", o.domId || o.id), m = f.insert("g").attr("class", "label").attr("style", handleUndefinedAttr(o.labelStyle)), h;
|
|
14
|
+
h = o.label === void 0 ? "" : typeof o.label == "string" ? o.label : o.label[0];
|
|
15
|
+
let y = !!o.icon || !!o.img, b = o.labelType === "markdown", x = await createText(m, sanitizeText(decodeEntities(h), getConfig2()), {
|
|
16
|
+
useHtmlLabels: d,
|
|
17
|
+
width: o.width || getConfig2().flowchart?.wrappingWidth,
|
|
18
18
|
classes: b ? "markdown-node-label" : "",
|
|
19
|
-
style:
|
|
19
|
+
style: o.labelStyle,
|
|
20
20
|
addSvgBackground: y,
|
|
21
21
|
markdown: b
|
|
22
|
-
}, getConfig2()), S = x.getBBox(), C = (
|
|
23
|
-
if (
|
|
24
|
-
let
|
|
25
|
-
await configureLabelImages(
|
|
22
|
+
}, getConfig2()), S = x.getBBox(), C = (o?.padding ?? 0) / 2;
|
|
23
|
+
if (d) {
|
|
24
|
+
let a = x.children[0], o = select_default(x);
|
|
25
|
+
await configureLabelImages(a, h), S = a.getBoundingClientRect(), o.attr("width", S.width), o.attr("height", S.height);
|
|
26
26
|
}
|
|
27
|
-
return
|
|
28
|
-
shapeSvg:
|
|
27
|
+
return d ? m.attr("transform", "translate(" + -S.width / 2 + ", " + -S.height / 2 + ")") : m.attr("transform", "translate(0, " + -S.height / 2 + ")"), o.centerLabel && m.attr("transform", "translate(" + -S.width / 2 + ", " + -S.height / 2 + ")"), m.insert("rect", ":first-child"), {
|
|
28
|
+
shapeSvg: f,
|
|
29
29
|
bbox: S,
|
|
30
30
|
halfPadding: C,
|
|
31
|
-
label:
|
|
31
|
+
label: m
|
|
32
32
|
};
|
|
33
|
-
}, "labelHelper"), insertLabel = /* @__PURE__ */ __name(async (
|
|
34
|
-
let
|
|
35
|
-
useHtmlLabels:
|
|
36
|
-
width:
|
|
37
|
-
style:
|
|
38
|
-
addSvgBackground: !!
|
|
39
|
-
}),
|
|
33
|
+
}, "labelHelper"), insertLabel = /* @__PURE__ */ __name(async (a, o, s) => {
|
|
34
|
+
let c = s.useHtmlLabels ?? getEffectiveHtmlLabels(getConfig2()), d = a.insert("g").attr("class", "label").attr("style", s.labelStyle || ""), f = await createText(d, sanitizeText(decodeEntities(o), getConfig2()), {
|
|
35
|
+
useHtmlLabels: c,
|
|
36
|
+
width: s.width || getConfig2()?.flowchart?.wrappingWidth,
|
|
37
|
+
style: s.labelStyle,
|
|
38
|
+
addSvgBackground: !!s.icon || !!s.img
|
|
39
|
+
}), m = f.getBBox(), h = s.padding / 2;
|
|
40
40
|
if (getEffectiveHtmlLabels(getConfig2())) {
|
|
41
|
-
let
|
|
42
|
-
|
|
41
|
+
let a = f.children[0], o = select_default(f);
|
|
42
|
+
m = a.getBoundingClientRect(), o.attr("width", m.width), o.attr("height", m.height);
|
|
43
43
|
}
|
|
44
|
-
return
|
|
45
|
-
shapeSvg:
|
|
46
|
-
bbox:
|
|
44
|
+
return c ? d.attr("transform", "translate(" + -m.width / 2 + ", " + -m.height / 2 + ")") : d.attr("transform", "translate(0, " + -m.height / 2 + ")"), s.centerLabel && d.attr("transform", "translate(" + -m.width / 2 + ", " + -m.height / 2 + ")"), d.insert("rect", ":first-child"), {
|
|
45
|
+
shapeSvg: a,
|
|
46
|
+
bbox: m,
|
|
47
47
|
halfPadding: h,
|
|
48
|
-
label:
|
|
48
|
+
label: d
|
|
49
49
|
};
|
|
50
50
|
}, "insertLabel"), updateNodeBounds = /* @__PURE__ */ __name((e, a) => {
|
|
51
51
|
let o = a.node().getBBox();
|
|
@@ -80,8 +80,8 @@ function generateCirclePoints(e, a, o, s, c, l) {
|
|
|
80
80
|
return u;
|
|
81
81
|
}
|
|
82
82
|
__name(generateCirclePoints, "generateCirclePoints");
|
|
83
|
-
function mergePaths(
|
|
84
|
-
let o = Array.from(
|
|
83
|
+
function mergePaths(e) {
|
|
84
|
+
let o = Array.from(e.childNodes).filter((e) => e.tagName === "path"), s = document.createElementNS("http://www.w3.org/2000/svg", "path"), c = o.map((e) => e.getAttribute("d")).filter((e) => e !== null).join(" ");
|
|
85
85
|
s.setAttribute("d", c);
|
|
86
86
|
let l = o.find((e) => e.getAttribute("fill") !== "none"), u = o.find((e) => e.getAttribute("stroke") !== "none"), d = /* @__PURE__ */ __name((e, a) => e?.getAttribute(a) ?? void 0, "getAttr");
|
|
87
87
|
if (l) {
|
|
@@ -113,7 +113,7 @@ var intersect_rect_default = /* @__PURE__ */ __name((e, a) => {
|
|
|
113
113
|
x: o + f,
|
|
114
114
|
y: s + p
|
|
115
115
|
};
|
|
116
|
-
}, "intersectRect"), createLabel_default = /* @__PURE__ */ __name(async (e, a, o, s = !1,
|
|
116
|
+
}, "intersectRect"), createLabel_default = /* @__PURE__ */ __name(async (e, a, o, s = !1, c = !1) => {
|
|
117
117
|
let d = a || "";
|
|
118
118
|
typeof d == "object" && (d = d[0]);
|
|
119
119
|
let f = getConfig2(), p = getEffectiveHtmlLabels(f);
|
|
@@ -122,7 +122,7 @@ var intersect_rect_default = /* @__PURE__ */ __name((e, a) => {
|
|
|
122
122
|
isTitle: s,
|
|
123
123
|
useHtmlLabels: p,
|
|
124
124
|
markdown: !1,
|
|
125
|
-
isNode:
|
|
125
|
+
isNode: c,
|
|
126
126
|
width: Infinity
|
|
127
127
|
}, f);
|
|
128
128
|
}, "createLabel"), createRoundedRectPathD = /* @__PURE__ */ __name((e, a, o, s, c) => [
|
|
@@ -170,43 +170,43 @@ var intersect_rect_default = /* @__PURE__ */ __name((e, a) => {
|
|
|
170
170
|
e + c,
|
|
171
171
|
a,
|
|
172
172
|
"Z"
|
|
173
|
-
].join(" "), "createRoundedRectPathD"), rect = /* @__PURE__ */ __name(async (
|
|
174
|
-
log.info("Creating subgraph rect for ",
|
|
175
|
-
let
|
|
176
|
-
E =
|
|
177
|
-
style:
|
|
173
|
+
].join(" "), "createRoundedRectPathD"), rect = /* @__PURE__ */ __name(async (a, s) => {
|
|
174
|
+
log.info("Creating subgraph rect for ", s.id, s);
|
|
175
|
+
let c = getConfig2(), { themeVariables: d, handDrawnSeed: f } = c, { clusterBkg: p, clusterBorder: m } = d, { labelStyles: h, nodeStyles: g, borderStyles: _, backgroundStyles: v } = styles2String(s), b = a.insert("g").attr("class", "cluster " + s.cssClasses).attr("id", s.domId).attr("data-look", s.look), x = getEffectiveHtmlLabels(c), T = b.insert("g").attr("class", "cluster-label "), E;
|
|
176
|
+
E = s.labelType === "markdown" ? await createText(T, s.label, {
|
|
177
|
+
style: s.labelStyle,
|
|
178
178
|
useHtmlLabels: x,
|
|
179
179
|
isNode: !0,
|
|
180
|
-
width:
|
|
181
|
-
}) : await createLabel_default(T,
|
|
180
|
+
width: s.width
|
|
181
|
+
}) : await createLabel_default(T, s.label, s.labelStyle || "", !1, !0);
|
|
182
182
|
let D = E.getBBox();
|
|
183
|
-
if (getEffectiveHtmlLabels(
|
|
184
|
-
let
|
|
185
|
-
D =
|
|
183
|
+
if (getEffectiveHtmlLabels(c)) {
|
|
184
|
+
let a = E.children[0], o = select_default(E);
|
|
185
|
+
D = a.getBoundingClientRect(), o.attr("width", D.width), o.attr("height", D.height);
|
|
186
186
|
}
|
|
187
|
-
let O =
|
|
188
|
-
|
|
189
|
-
let k =
|
|
190
|
-
log.trace("Data ",
|
|
187
|
+
let O = s.width <= D.width + s.padding ? D.width + s.padding : s.width;
|
|
188
|
+
s.width <= D.width + s.padding ? s.diff = (O - s.width) / 2 - s.padding : s.diff = -s.padding;
|
|
189
|
+
let k = s.height, A = s.x - O / 2, j = s.y - k / 2;
|
|
190
|
+
log.trace("Data ", s, JSON.stringify(s));
|
|
191
191
|
let M;
|
|
192
|
-
if (
|
|
193
|
-
let e = at.svg(b),
|
|
192
|
+
if (s.look === "handDrawn") {
|
|
193
|
+
let e = at.svg(b), a = userNodeOverrides(s, {
|
|
194
194
|
roughness: .7,
|
|
195
|
-
fill:
|
|
196
|
-
stroke:
|
|
195
|
+
fill: p,
|
|
196
|
+
stroke: m,
|
|
197
197
|
fillWeight: 3,
|
|
198
|
-
seed:
|
|
199
|
-
}), c = e.path(createRoundedRectPathD(A, j, O, k, 0),
|
|
198
|
+
seed: f
|
|
199
|
+
}), c = e.path(createRoundedRectPathD(A, j, O, k, 0), a);
|
|
200
200
|
M = b.insert(() => (log.debug("Rough node insert CXC", c), c), ":first-child"), M.select("path:nth-child(2)").attr("style", _.join(";")), M.select("path").attr("style", v.join(";").replace("fill", "stroke"));
|
|
201
|
-
} else M = b.insert("rect", ":first-child"), M.attr("style", g).attr("rx",
|
|
202
|
-
let { subGraphTitleTopMargin: N } = getSubGraphTitleMargins(
|
|
203
|
-
if (T.attr("transform", `translate(${
|
|
201
|
+
} else M = b.insert("rect", ":first-child"), M.attr("style", g).attr("rx", s.rx).attr("ry", s.ry).attr("x", A).attr("y", j).attr("width", O).attr("height", k);
|
|
202
|
+
let { subGraphTitleTopMargin: N } = getSubGraphTitleMargins(c);
|
|
203
|
+
if (T.attr("transform", `translate(${s.x - D.width / 2}, ${s.y - s.height / 2 + N})`), h) {
|
|
204
204
|
let e = T.select("span");
|
|
205
205
|
e && e.attr("style", h);
|
|
206
206
|
}
|
|
207
207
|
let L = M.node().getBBox();
|
|
208
|
-
return
|
|
209
|
-
return intersect_rect_default(
|
|
208
|
+
return s.offsetX = 0, s.width = L.width, s.height = L.height, s.offsetY = D.height - s.padding / 2, s.intersect = function(e) {
|
|
209
|
+
return intersect_rect_default(s, e);
|
|
210
210
|
}, {
|
|
211
211
|
cluster: b,
|
|
212
212
|
labelBBox: D
|
|
@@ -214,36 +214,36 @@ var intersect_rect_default = /* @__PURE__ */ __name((e, a) => {
|
|
|
214
214
|
}, "rect"), shapes = {
|
|
215
215
|
rect,
|
|
216
216
|
squareRect: rect,
|
|
217
|
-
roundedWithTitle: /* @__PURE__ */ __name(async (
|
|
218
|
-
let
|
|
219
|
-
if (getEffectiveHtmlLabels(
|
|
220
|
-
let
|
|
221
|
-
x =
|
|
217
|
+
roundedWithTitle: /* @__PURE__ */ __name(async (a, o) => {
|
|
218
|
+
let s = getConfig2(), { themeVariables: c, handDrawnSeed: d } = s, { altBackground: f, compositeBackground: p, compositeTitleBackground: m, nodeBorder: h } = c, g = a.insert("g").attr("class", o.cssClasses).attr("id", o.domId).attr("data-id", o.id).attr("data-look", o.look), _ = g.insert("g", ":first-child"), v = g.insert("g").attr("class", "cluster-label"), y = g.append("rect"), b = await createLabel_default(v, o.label, o.labelStyle, void 0, !0), x = b.getBBox();
|
|
219
|
+
if (getEffectiveHtmlLabels(s)) {
|
|
220
|
+
let a = b.children[0], o = select_default(b);
|
|
221
|
+
x = a.getBoundingClientRect(), o.attr("width", x.width), o.attr("height", x.height);
|
|
222
222
|
}
|
|
223
|
-
let S = 0 *
|
|
224
|
-
|
|
225
|
-
let T =
|
|
226
|
-
|
|
227
|
-
let k =
|
|
228
|
-
if (
|
|
229
|
-
let e =
|
|
223
|
+
let S = 0 * o.padding, C = S / 2, w = (o.width <= x.width + o.padding ? x.width + o.padding : o.width) + S;
|
|
224
|
+
o.width <= x.width + o.padding ? o.diff = (w - o.width) / 2 - o.padding : o.diff = -o.padding;
|
|
225
|
+
let T = o.height + S, E = o.height + S - x.height - 6, D = o.x - w / 2, O = o.y - T / 2;
|
|
226
|
+
o.width = w;
|
|
227
|
+
let k = o.y - o.height / 2 - C + x.height + 2, A;
|
|
228
|
+
if (o.look === "handDrawn") {
|
|
229
|
+
let e = o.cssClasses.includes("statediagram-cluster-alt"), a = at.svg(g), s = o.rx || o.ry ? a.path(createRoundedRectPathD(D, O, w, T, 10), {
|
|
230
230
|
roughness: .7,
|
|
231
|
-
fill:
|
|
231
|
+
fill: m,
|
|
232
232
|
fillStyle: "solid",
|
|
233
233
|
stroke: h,
|
|
234
|
-
seed:
|
|
235
|
-
}) :
|
|
234
|
+
seed: d
|
|
235
|
+
}) : a.rectangle(D, O, w, T, { seed: d });
|
|
236
236
|
A = g.insert(() => s, ":first-child");
|
|
237
|
-
let c =
|
|
238
|
-
fill: e ?
|
|
237
|
+
let c = a.rectangle(D, k, w, E, {
|
|
238
|
+
fill: e ? f : p,
|
|
239
239
|
fillStyle: e ? "hachure" : "solid",
|
|
240
240
|
stroke: h,
|
|
241
|
-
seed:
|
|
241
|
+
seed: d
|
|
242
242
|
});
|
|
243
243
|
A = g.insert(() => s, ":first-child"), y = g.insert(() => c);
|
|
244
|
-
} else A = _.insert("rect", ":first-child"), A.attr("class", "outer").attr("x", D).attr("y", O).attr("width", w).attr("height", T).attr("data-look",
|
|
245
|
-
return v.attr("transform", `translate(${
|
|
246
|
-
return intersect_rect_default(
|
|
244
|
+
} else A = _.insert("rect", ":first-child"), A.attr("class", "outer").attr("x", D).attr("y", O).attr("width", w).attr("height", T).attr("data-look", o.look), y.attr("class", "inner").attr("x", D).attr("y", k).attr("width", w).attr("height", E);
|
|
245
|
+
return v.attr("transform", `translate(${o.x - x.width / 2}, ${O + 1 - (getEffectiveHtmlLabels(s) ? 0 : 3)})`), o.height = A.node().getBBox().height, o.offsetX = 0, o.offsetY = x.height - o.padding / 2, o.labelBBox = x, o.intersect = function(e) {
|
|
246
|
+
return intersect_rect_default(o, e);
|
|
247
247
|
}, {
|
|
248
248
|
cluster: g,
|
|
249
249
|
labelBBox: x
|
|
@@ -264,7 +264,7 @@ var intersect_rect_default = /* @__PURE__ */ __name((e, a) => {
|
|
|
264
264
|
};
|
|
265
265
|
}, "noteGroup"),
|
|
266
266
|
divider: /* @__PURE__ */ __name((e, a) => {
|
|
267
|
-
let { themeVariables: o, handDrawnSeed: s } = getConfig2(), { nodeBorder:
|
|
267
|
+
let { themeVariables: o, handDrawnSeed: s } = getConfig2(), { nodeBorder: c } = o, u = e.insert("g").attr("class", a.cssClasses).attr("id", a.domId).attr("data-look", a.look), d = u.insert("g", ":first-child"), f = 0 * a.padding, p = a.width + f;
|
|
268
268
|
a.diff = -a.padding;
|
|
269
269
|
let m = a.height + f, h = a.x - p / 2, g = a.y - m / 2;
|
|
270
270
|
a.width = p;
|
|
@@ -274,7 +274,7 @@ var intersect_rect_default = /* @__PURE__ */ __name((e, a) => {
|
|
|
274
274
|
fill: "lightgrey",
|
|
275
275
|
roughness: .5,
|
|
276
276
|
strokeLineDash: [5],
|
|
277
|
-
stroke:
|
|
277
|
+
stroke: c,
|
|
278
278
|
seed: s
|
|
279
279
|
});
|
|
280
280
|
_ = u.insert(() => e, ":first-child");
|
|
@@ -290,41 +290,41 @@ var intersect_rect_default = /* @__PURE__ */ __name((e, a) => {
|
|
|
290
290
|
labelBBox: {}
|
|
291
291
|
};
|
|
292
292
|
}, "divider"),
|
|
293
|
-
kanbanSection: /* @__PURE__ */ __name(async (
|
|
294
|
-
log.info("Creating subgraph rect for ",
|
|
295
|
-
let
|
|
296
|
-
style:
|
|
293
|
+
kanbanSection: /* @__PURE__ */ __name(async (a, s) => {
|
|
294
|
+
log.info("Creating subgraph rect for ", s.id, s);
|
|
295
|
+
let c = getConfig2(), { themeVariables: d, handDrawnSeed: f } = c, { clusterBkg: p, clusterBorder: m } = d, { labelStyles: h, nodeStyles: g, borderStyles: _, backgroundStyles: v } = styles2String(s), b = a.insert("g").attr("class", "cluster " + s.cssClasses).attr("id", s.domId).attr("data-look", s.look), x = getEffectiveHtmlLabels(c), T = b.insert("g").attr("class", "cluster-label "), E = await createText(T, s.label, {
|
|
296
|
+
style: s.labelStyle,
|
|
297
297
|
useHtmlLabels: x,
|
|
298
298
|
isNode: !0,
|
|
299
|
-
width:
|
|
299
|
+
width: s.width
|
|
300
300
|
}), D = E.getBBox();
|
|
301
|
-
if (getEffectiveHtmlLabels(
|
|
302
|
-
let
|
|
303
|
-
D =
|
|
301
|
+
if (getEffectiveHtmlLabels(c)) {
|
|
302
|
+
let a = E.children[0], o = select_default(E);
|
|
303
|
+
D = a.getBoundingClientRect(), o.attr("width", D.width), o.attr("height", D.height);
|
|
304
304
|
}
|
|
305
|
-
let O =
|
|
306
|
-
|
|
307
|
-
let k =
|
|
308
|
-
log.trace("Data ",
|
|
305
|
+
let O = s.width <= D.width + s.padding ? D.width + s.padding : s.width;
|
|
306
|
+
s.width <= D.width + s.padding ? s.diff = (O - s.width) / 2 - s.padding : s.diff = -s.padding;
|
|
307
|
+
let k = s.height, A = s.x - O / 2, j = s.y - k / 2;
|
|
308
|
+
log.trace("Data ", s, JSON.stringify(s));
|
|
309
309
|
let M;
|
|
310
|
-
if (
|
|
311
|
-
let e = at.svg(b),
|
|
310
|
+
if (s.look === "handDrawn") {
|
|
311
|
+
let e = at.svg(b), a = userNodeOverrides(s, {
|
|
312
312
|
roughness: .7,
|
|
313
|
-
fill:
|
|
314
|
-
stroke:
|
|
313
|
+
fill: p,
|
|
314
|
+
stroke: m,
|
|
315
315
|
fillWeight: 4,
|
|
316
|
-
seed:
|
|
317
|
-
}), c = e.path(createRoundedRectPathD(A, j, O, k,
|
|
316
|
+
seed: f
|
|
317
|
+
}), c = e.path(createRoundedRectPathD(A, j, O, k, s.rx), a);
|
|
318
318
|
M = b.insert(() => (log.debug("Rough node insert CXC", c), c), ":first-child"), M.select("path:nth-child(2)").attr("style", _.join(";")), M.select("path").attr("style", v.join(";").replace("fill", "stroke"));
|
|
319
|
-
} else M = b.insert("rect", ":first-child"), M.attr("style", g).attr("rx",
|
|
320
|
-
let { subGraphTitleTopMargin: N } = getSubGraphTitleMargins(
|
|
321
|
-
if (T.attr("transform", `translate(${
|
|
319
|
+
} else M = b.insert("rect", ":first-child"), M.attr("style", g).attr("rx", s.rx).attr("ry", s.ry).attr("x", A).attr("y", j).attr("width", O).attr("height", k);
|
|
320
|
+
let { subGraphTitleTopMargin: N } = getSubGraphTitleMargins(c);
|
|
321
|
+
if (T.attr("transform", `translate(${s.x - D.width / 2}, ${s.y - s.height / 2 + N})`), h) {
|
|
322
322
|
let e = T.select("span");
|
|
323
323
|
e && e.attr("style", h);
|
|
324
324
|
}
|
|
325
325
|
let F = M.node().getBBox();
|
|
326
|
-
return
|
|
327
|
-
return intersect_rect_default(
|
|
326
|
+
return s.offsetX = 0, s.width = F.width, s.height = F.height, s.offsetY = D.height - s.padding / 2, s.intersect = function(e) {
|
|
327
|
+
return intersect_rect_default(s, e);
|
|
328
328
|
}, {
|
|
329
329
|
cluster: b,
|
|
330
330
|
labelBBox: D
|
|
@@ -407,20 +407,20 @@ var intersect_default = {
|
|
|
407
407
|
polygon: intersectPolygon,
|
|
408
408
|
rect: intersect_rect_default
|
|
409
409
|
};
|
|
410
|
-
function anchor(e,
|
|
411
|
-
let { labelStyles: s } = styles2String(
|
|
412
|
-
|
|
413
|
-
let c = getNodeClasses(
|
|
410
|
+
function anchor(e, a) {
|
|
411
|
+
let { labelStyles: s } = styles2String(a);
|
|
412
|
+
a.labelStyle = s;
|
|
413
|
+
let c = getNodeClasses(a), l = c;
|
|
414
414
|
c || (l = "anchor");
|
|
415
|
-
let u = e.insert("g").attr("class", l).attr("id",
|
|
415
|
+
let u = e.insert("g").attr("class", l).attr("id", a.domId || a.id), { cssStyles: d } = a, f = at.svg(u), p = userNodeOverrides(a, {
|
|
416
416
|
fill: "black",
|
|
417
417
|
stroke: "none",
|
|
418
418
|
fillStyle: "solid"
|
|
419
419
|
});
|
|
420
|
-
|
|
420
|
+
a.look !== "handDrawn" && (p.roughness = 0);
|
|
421
421
|
let m = f.circle(0, 0, 2, p), h = u.insert(() => m, ":first-child");
|
|
422
|
-
return h.attr("class", "anchor").attr("style", handleUndefinedAttr(d)), updateNodeBounds(
|
|
423
|
-
return log.info("Circle intersect",
|
|
422
|
+
return h.attr("class", "anchor").attr("style", handleUndefinedAttr(d)), updateNodeBounds(a, h), a.intersect = function(e) {
|
|
423
|
+
return log.info("Circle intersect", a, 1, e), intersect_default.circle(a, 1, e);
|
|
424
424
|
}, u;
|
|
425
425
|
}
|
|
426
426
|
__name(anchor, "anchor");
|
|
@@ -445,13 +445,13 @@ function calculateArcSagitta(e, a, o) {
|
|
|
445
445
|
return c * (1 - Math.sqrt(1 - (e / s / 2) ** 2));
|
|
446
446
|
}
|
|
447
447
|
__name(calculateArcSagitta, "calculateArcSagitta");
|
|
448
|
-
async function bowTieRect(
|
|
448
|
+
async function bowTieRect(e, o) {
|
|
449
449
|
let { labelStyles: s, nodeStyles: c } = styles2String(o);
|
|
450
450
|
o.labelStyle = s;
|
|
451
451
|
let l = o.padding ?? 0, u = o.look === "neo" ? 16 : l, d = o.look === "neo" ? 12 : l, f = /* @__PURE__ */ __name((e) => e + d, "calcTotalHeight"), p = /* @__PURE__ */ __name((e) => {
|
|
452
452
|
let a = e / 2;
|
|
453
453
|
return [a / (2.5 + e / 50), a];
|
|
454
|
-
}, "calcEllipseRadius"), { shapeSvg: m, bbox: h } = await labelHelper(
|
|
454
|
+
}, "calcEllipseRadius"), { shapeSvg: m, bbox: h } = await labelHelper(e, o, getNodeClasses(o)), g = f(o?.height ? o?.height : h.height), [_, v] = p(g), y = calculateArcSagitta(g, _, v), b = (o?.width ? o?.width : h.width) + u * 2 + y - y, x = g, { cssStyles: w } = o, T = [
|
|
455
455
|
{
|
|
456
456
|
x: b / 2,
|
|
457
457
|
y: -x / 2
|
|
@@ -547,19 +547,19 @@ function choice(e, a) {
|
|
|
547
547
|
}, s;
|
|
548
548
|
}
|
|
549
549
|
__name(choice, "choice");
|
|
550
|
-
async function circle(e,
|
|
551
|
-
let { labelStyles: c, nodeStyles: l } = styles2String(
|
|
552
|
-
|
|
553
|
-
let { shapeSvg: u, bbox: d, halfPadding: f } = await labelHelper(e,
|
|
554
|
-
if (
|
|
555
|
-
let e = at.svg(u),
|
|
550
|
+
async function circle(e, a, s) {
|
|
551
|
+
let { labelStyles: c, nodeStyles: l } = styles2String(a);
|
|
552
|
+
a.labelStyle = c;
|
|
553
|
+
let { shapeSvg: u, bbox: d, halfPadding: f } = await labelHelper(e, a, getNodeClasses(a)), p = s?.padding ?? f, m = a.look === "neo" ? d.width / 2 + 32 : d.width / 2 + p, h, { cssStyles: g } = a;
|
|
554
|
+
if (a.look === "handDrawn") {
|
|
555
|
+
let e = at.svg(u), o = userNodeOverrides(a, {}), s = e.circle(0, 0, m * 2, o);
|
|
556
556
|
h = u.insert(() => s, ":first-child"), h.attr("class", "basic label-container").attr("style", handleUndefinedAttr(g));
|
|
557
557
|
} else h = u.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", l).attr("r", m).attr("cx", 0).attr("cy", 0);
|
|
558
|
-
return updateNodeBounds(
|
|
558
|
+
return updateNodeBounds(a, h), a.calcIntersect = function(e, a) {
|
|
559
559
|
let o = e.width / 2;
|
|
560
560
|
return intersect_default.circle(e, o, a);
|
|
561
|
-
},
|
|
562
|
-
return log.info("Circle intersect",
|
|
561
|
+
}, a.intersect = function(e) {
|
|
562
|
+
return log.info("Circle intersect", a, m, e), intersect_default.circle(a, m, e);
|
|
563
563
|
}, u;
|
|
564
564
|
}
|
|
565
565
|
__name(circle, "circle");
|
|
@@ -581,17 +581,17 @@ function createLine(e) {
|
|
|
581
581
|
M ${c.x},${c.y} L ${u.x},${u.y}`;
|
|
582
582
|
}
|
|
583
583
|
__name(createLine, "createLine");
|
|
584
|
-
function crossedCircle(e,
|
|
585
|
-
let { labelStyles: s, nodeStyles: c } = styles2String(
|
|
586
|
-
|
|
587
|
-
let l = e.insert("g").attr("class", getNodeClasses(
|
|
588
|
-
|
|
584
|
+
function crossedCircle(e, a) {
|
|
585
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(a);
|
|
586
|
+
a.labelStyle = s, a.label = "";
|
|
587
|
+
let l = e.insert("g").attr("class", getNodeClasses(a)).attr("id", a.domId ?? a.id), u = Math.max(30, a?.width ?? 0), { cssStyles: d } = a, f = at.svg(l), p = userNodeOverrides(a, {});
|
|
588
|
+
a.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
|
|
589
589
|
let m = f.circle(0, 0, u * 2, p), h = createLine(u), g = f.path(h, p), _ = l.insert(() => m, ":first-child");
|
|
590
|
-
return _.insert(() => g), _.attr("class", "outer-path"), d &&
|
|
591
|
-
return log.info("crossedCircle intersect",
|
|
590
|
+
return _.insert(() => g), _.attr("class", "outer-path"), d && a.look !== "handDrawn" && _.selectAll("path").attr("style", d), c && a.look !== "handDrawn" && _.selectAll("path").attr("style", c), updateNodeBounds(a, _), a.intersect = function(e) {
|
|
591
|
+
return log.info("crossedCircle intersect", a, {
|
|
592
592
|
radius: u,
|
|
593
593
|
point: e
|
|
594
|
-
}), intersect_default.circle(
|
|
594
|
+
}), intersect_default.circle(a, u, e);
|
|
595
595
|
}, l;
|
|
596
596
|
}
|
|
597
597
|
__name(crossedCircle, "crossedCircle");
|
|
@@ -966,50 +966,50 @@ async function dividedRectangle(e, a) {
|
|
|
966
966
|
}, u;
|
|
967
967
|
}
|
|
968
968
|
__name(dividedRectangle, "dividedRectangle");
|
|
969
|
-
async function doublecircle(e,
|
|
970
|
-
let { labelStyles: s, nodeStyles: c } = styles2String(
|
|
971
|
-
|
|
972
|
-
let u =
|
|
973
|
-
if (
|
|
974
|
-
let e = at.svg(f),
|
|
969
|
+
async function doublecircle(e, a) {
|
|
970
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(a), l = a.look === "neo" ? 12 : 5;
|
|
971
|
+
a.labelStyle = s;
|
|
972
|
+
let u = a.padding ?? 0, d = a.look === "neo" ? 16 : u, { shapeSvg: f, bbox: p } = await labelHelper(e, a, getNodeClasses(a)), m = (a?.width ? a?.width / 2 : p.width / 2) + (d ?? 0), h = m - l, g, { cssStyles: v } = a;
|
|
973
|
+
if (a.look === "handDrawn") {
|
|
974
|
+
let e = at.svg(f), o = userNodeOverrides(a, {
|
|
975
975
|
roughness: .2,
|
|
976
976
|
strokeWidth: 2.5
|
|
977
|
-
}), s = userNodeOverrides(
|
|
977
|
+
}), s = userNodeOverrides(a, {
|
|
978
978
|
roughness: .2,
|
|
979
979
|
strokeWidth: 1.5
|
|
980
|
-
}), c = e.circle(0, 0, m * 2,
|
|
981
|
-
g = f.insert("g", ":first-child"), g.attr("class", handleUndefinedAttr(
|
|
980
|
+
}), c = e.circle(0, 0, m * 2, o), l = e.circle(0, 0, h * 2, s);
|
|
981
|
+
g = f.insert("g", ":first-child"), g.attr("class", handleUndefinedAttr(a.cssClasses)).attr("style", handleUndefinedAttr(v)), g.node()?.appendChild(c), g.node()?.appendChild(l);
|
|
982
982
|
} else {
|
|
983
983
|
g = f.insert("g", ":first-child");
|
|
984
984
|
let e = g.insert("circle", ":first-child"), a = g.insert("circle");
|
|
985
985
|
g.attr("class", "basic label-container").attr("style", c), e.attr("class", "outer-circle").attr("style", c).attr("r", m).attr("cx", 0).attr("cy", 0), a.attr("class", "inner-circle").attr("style", c).attr("r", h).attr("cx", 0).attr("cy", 0);
|
|
986
986
|
}
|
|
987
|
-
return updateNodeBounds(
|
|
988
|
-
return log.info("DoubleCircle intersect",
|
|
987
|
+
return updateNodeBounds(a, g), a.intersect = function(e) {
|
|
988
|
+
return log.info("DoubleCircle intersect", a, m, e), intersect_default.circle(a, m, e);
|
|
989
989
|
}, f;
|
|
990
990
|
}
|
|
991
991
|
__name(doublecircle, "doublecircle");
|
|
992
|
-
function filledCircle(e,
|
|
993
|
-
let { labelStyles: c, nodeStyles: l } = styles2String(
|
|
994
|
-
|
|
995
|
-
let u = e.insert("g").attr("class", getNodeClasses(
|
|
996
|
-
|
|
992
|
+
function filledCircle(e, a, { config: { themeVariables: s } }) {
|
|
993
|
+
let { labelStyles: c, nodeStyles: l } = styles2String(a);
|
|
994
|
+
a.label = "", a.labelStyle = c;
|
|
995
|
+
let u = e.insert("g").attr("class", getNodeClasses(a)).attr("id", a.domId ?? a.id), { cssStyles: d } = a, f = at.svg(u), { nodeBorder: p } = s, m = userNodeOverrides(a, { fillStyle: "solid" });
|
|
996
|
+
a.look !== "handDrawn" && (m.roughness = 0);
|
|
997
997
|
let h = f.circle(0, 0, 14, m), g = u.insert(() => h, ":first-child");
|
|
998
|
-
return g.selectAll("path").attr("style", `fill: ${p} !important;`), d && d.length > 0 &&
|
|
999
|
-
return log.info("filledCircle intersect",
|
|
998
|
+
return g.selectAll("path").attr("style", `fill: ${p} !important;`), d && d.length > 0 && a.look !== "handDrawn" && g.selectAll("path").attr("style", d), l && a.look !== "handDrawn" && g.selectAll("path").attr("style", l), updateNodeBounds(a, g), a.intersect = function(e) {
|
|
999
|
+
return log.info("filledCircle intersect", a, {
|
|
1000
1000
|
radius: 7,
|
|
1001
1001
|
point: e
|
|
1002
|
-
}), intersect_default.circle(
|
|
1002
|
+
}), intersect_default.circle(a, 7, e);
|
|
1003
1003
|
}, u;
|
|
1004
1004
|
}
|
|
1005
1005
|
__name(filledCircle, "filledCircle");
|
|
1006
1006
|
var MIN_HEIGHT2 = 10, MIN_WIDTH2 = 10;
|
|
1007
|
-
async function flippedTriangle(e,
|
|
1008
|
-
let { labelStyles: s, nodeStyles: c } = styles2String(
|
|
1009
|
-
|
|
1010
|
-
let l =
|
|
1011
|
-
(
|
|
1012
|
-
let { shapeSvg: d, bbox: f, label: p } = await labelHelper(e,
|
|
1007
|
+
async function flippedTriangle(e, a) {
|
|
1008
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(a);
|
|
1009
|
+
a.labelStyle = s;
|
|
1010
|
+
let l = a.padding ?? 0, u = a.look === "neo" ? l * 2 : l;
|
|
1011
|
+
(a.width || a.height) && (a.height = a?.height ?? 0, a.height < MIN_HEIGHT2 && (a.height = MIN_HEIGHT2), a.width = (a?.width ?? 0) - u - u / 2, a.width < MIN_WIDTH2 && (a.width = MIN_WIDTH2));
|
|
1012
|
+
let { shapeSvg: d, bbox: f, label: p } = await labelHelper(e, a, getNodeClasses(a)), m = (a?.width ? a?.width : f.width) + (u ?? 0), h = a?.height ? a?.height : m + f.height, g = h, _ = [
|
|
1013
1013
|
{
|
|
1014
1014
|
x: 0,
|
|
1015
1015
|
y: -h
|
|
@@ -1022,11 +1022,11 @@ async function flippedTriangle(e, o) {
|
|
|
1022
1022
|
x: g / 2,
|
|
1023
1023
|
y: 0
|
|
1024
1024
|
}
|
|
1025
|
-
], { cssStyles: v } =
|
|
1026
|
-
|
|
1025
|
+
], { cssStyles: v } = a, y = at.svg(d), b = userNodeOverrides(a, {});
|
|
1026
|
+
a.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
|
|
1027
1027
|
let x = createPathFromPoints(_), w = y.path(x, b), T = d.insert(() => w, ":first-child").attr("transform", `translate(${-h / 2}, ${h / 2})`).attr("class", "outer-path");
|
|
1028
|
-
return v &&
|
|
1029
|
-
return log.info("Triangle intersect",
|
|
1028
|
+
return v && a.look !== "handDrawn" && T.selectChildren("path").attr("style", v), c && a.look !== "handDrawn" && T.selectChildren("path").attr("style", c), a.width = m, a.height = h, updateNodeBounds(a, T), p.attr("transform", `translate(${-f.width / 2 - (f.x - (f.left ?? 0))}, ${-h / 2 + (a.padding ?? 0) / 2 + (f.y - (f.top ?? 0))})`), a.intersect = function(e) {
|
|
1029
|
+
return log.info("Triangle intersect", a, _, e), intersect_default.polygon(a, _, e);
|
|
1030
1030
|
}, d;
|
|
1031
1031
|
}
|
|
1032
1032
|
__name(flippedTriangle, "flippedTriangle");
|
|
@@ -1048,13 +1048,13 @@ function forkJoin(e, a, { dir: o, config: { state: s, themeVariables: c } }) {
|
|
|
1048
1048
|
}, u;
|
|
1049
1049
|
}
|
|
1050
1050
|
__name(forkJoin, "forkJoin");
|
|
1051
|
-
async function halfRoundedRectangle(e,
|
|
1052
|
-
let { labelStyles: s, nodeStyles: c } = styles2String(
|
|
1053
|
-
|
|
1054
|
-
let l =
|
|
1055
|
-
(
|
|
1056
|
-
let { shapeSvg: d, bbox: f } = await labelHelper(e,
|
|
1057
|
-
|
|
1051
|
+
async function halfRoundedRectangle(e, a) {
|
|
1052
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(a);
|
|
1053
|
+
a.labelStyle = s;
|
|
1054
|
+
let l = a.look === "neo" ? 16 : a.padding ?? 0, u = a.look === "neo" ? 12 : a.padding ?? 0;
|
|
1055
|
+
(a.width || a.height) && (a.height = (a?.height ?? 0) - u * 2, a.height < 10 && (a.height = 10), a.width = (a?.width ?? 0) - l * 2, a.width < 15 && (a.width = 15));
|
|
1056
|
+
let { shapeSvg: d, bbox: f } = await labelHelper(e, a, getNodeClasses(a)), p = (a?.width ? a?.width : Math.max(15, f.width)) + l * 2, m = (a?.height ? a?.height : Math.max(10, f.height)) + u * 2, h = m / 2, { cssStyles: g } = a, _ = at.svg(d), v = userNodeOverrides(a, {});
|
|
1057
|
+
a.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
|
|
1058
1058
|
let y = [
|
|
1059
1059
|
{
|
|
1060
1060
|
x: -p / 2,
|
|
@@ -1074,11 +1074,11 @@ async function halfRoundedRectangle(e, o) {
|
|
|
1074
1074
|
y: m / 2
|
|
1075
1075
|
}
|
|
1076
1076
|
], b = createPathFromPoints(y), x = _.path(b, v), w = d.insert(() => x, ":first-child");
|
|
1077
|
-
return w.attr("class", "basic label-container outer-path"), g &&
|
|
1078
|
-
return log.info("Pill intersect",
|
|
1077
|
+
return w.attr("class", "basic label-container outer-path"), g && a.look !== "handDrawn" && w.selectChildren("path").attr("style", g), c && a.look !== "handDrawn" && w.selectChildren("path").attr("style", c), updateNodeBounds(a, w), a.intersect = function(e) {
|
|
1078
|
+
return log.info("Pill intersect", a, {
|
|
1079
1079
|
radius: h,
|
|
1080
1080
|
point: e
|
|
1081
|
-
}), intersect_default.polygon(
|
|
1081
|
+
}), intersect_default.polygon(a, y, e);
|
|
1082
1082
|
}, d;
|
|
1083
1083
|
}
|
|
1084
1084
|
__name(halfRoundedRectangle, "halfRoundedRectangle");
|
|
@@ -1134,11 +1134,11 @@ async function hexagon(e, a) {
|
|
|
1134
1134
|
}, f;
|
|
1135
1135
|
}
|
|
1136
1136
|
__name(hexagon, "hexagon");
|
|
1137
|
-
async function hourglass(e,
|
|
1138
|
-
let { labelStyles: s, nodeStyles: c } = styles2String(
|
|
1139
|
-
|
|
1140
|
-
let { shapeSvg: l } = await labelHelper(e,
|
|
1141
|
-
|
|
1137
|
+
async function hourglass(e, a) {
|
|
1138
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(a);
|
|
1139
|
+
a.label = "", a.labelStyle = s;
|
|
1140
|
+
let { shapeSvg: l } = await labelHelper(e, a, getNodeClasses(a)), u = Math.max(30, a?.width ?? 0), d = Math.max(30, a?.height ?? 0), { cssStyles: f } = a, p = at.svg(l), m = userNodeOverrides(a, {});
|
|
1141
|
+
a.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
|
|
1142
1142
|
let h = [
|
|
1143
1143
|
{
|
|
1144
1144
|
x: 0,
|
|
@@ -1157,39 +1157,39 @@ async function hourglass(e, o) {
|
|
|
1157
1157
|
y: d
|
|
1158
1158
|
}
|
|
1159
1159
|
], g = createPathFromPoints(h), _ = p.path(g, m), v = l.insert(() => _, ":first-child");
|
|
1160
|
-
return v.attr("class", "basic label-container outer-path"), f &&
|
|
1161
|
-
return log.info("Pill intersect",
|
|
1160
|
+
return v.attr("class", "basic label-container outer-path"), f && a.look !== "handDrawn" && v.selectChildren("path").attr("style", f), c && a.look !== "handDrawn" && v.selectChildren("path").attr("style", c), v.attr("transform", `translate(${-u / 2}, ${-d / 2})`), updateNodeBounds(a, v), a.intersect = function(e) {
|
|
1161
|
+
return log.info("Pill intersect", a, { points: h }), intersect_default.polygon(a, h, e);
|
|
1162
1162
|
}, l;
|
|
1163
1163
|
}
|
|
1164
1164
|
__name(hourglass, "hourglass");
|
|
1165
|
-
async function icon(e,
|
|
1166
|
-
let { labelStyles: l } = styles2String(
|
|
1167
|
-
|
|
1168
|
-
let u =
|
|
1169
|
-
|
|
1170
|
-
let { shapeSvg: m, bbox: h, label: g } = await labelHelper(e,
|
|
1165
|
+
async function icon(e, a, { config: { themeVariables: s, flowchart: c } }) {
|
|
1166
|
+
let { labelStyles: l } = styles2String(a);
|
|
1167
|
+
a.labelStyle = l;
|
|
1168
|
+
let u = a.assetHeight ?? 48, d = a.assetWidth ?? 48, f = Math.max(u, d), p = c?.wrappingWidth;
|
|
1169
|
+
a.width = Math.max(f, p ?? 0);
|
|
1170
|
+
let { shapeSvg: m, bbox: h, label: g } = await labelHelper(e, a, "icon-shape default"), _ = a.pos === "t", v = f, y = f, { nodeBorder: x } = s, { stylesMap: w } = compileStyles(a), D = -y / 2, k = -v / 2, A = a.label ? 8 : 0, j = at.svg(m), M = userNodeOverrides(a, {
|
|
1171
1171
|
stroke: "none",
|
|
1172
1172
|
fill: "none"
|
|
1173
1173
|
});
|
|
1174
|
-
|
|
1174
|
+
a.look !== "handDrawn" && (M.roughness = 0, M.fillStyle = "solid");
|
|
1175
1175
|
let N = j.rectangle(D, k, y, v, M), P = Math.max(y, h.width), F = v + h.height + A, I = j.rectangle(-P / 2, -F / 2, P, F, {
|
|
1176
1176
|
...M,
|
|
1177
1177
|
fill: "transparent",
|
|
1178
1178
|
stroke: "none"
|
|
1179
1179
|
}), L = m.insert(() => N, ":first-child"), R = m.insert(() => I);
|
|
1180
|
-
if (
|
|
1180
|
+
if (a.icon) {
|
|
1181
1181
|
let e = m.append("g");
|
|
1182
|
-
e.html(`<g>${await getIconSVG(
|
|
1182
|
+
e.html(`<g>${await getIconSVG(a.icon, {
|
|
1183
1183
|
height: f,
|
|
1184
1184
|
width: f,
|
|
1185
1185
|
fallbackPrefix: ""
|
|
1186
1186
|
})}</g>`);
|
|
1187
|
-
let
|
|
1187
|
+
let o = e.node().getBBox(), s = o.width, c = o.height, l = o.x, u = o.y;
|
|
1188
1188
|
e.attr("transform", `translate(${-s / 2 - l},${_ ? h.height / 2 + A / 2 - c / 2 - u : -h.height / 2 - A / 2 - c / 2 - u})`), e.attr("style", `color: ${w.get("stroke") ?? x};`);
|
|
1189
1189
|
}
|
|
1190
|
-
return g.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${_ ? -F / 2 : F / 2 - h.height})`), L.attr("transform", `translate(0,${_ ? h.height / 2 + A / 2 : -h.height / 2 - A / 2})`), updateNodeBounds(
|
|
1191
|
-
if (log.info("iconSquare intersect",
|
|
1192
|
-
let s =
|
|
1190
|
+
return g.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${_ ? -F / 2 : F / 2 - h.height})`), L.attr("transform", `translate(0,${_ ? h.height / 2 + A / 2 : -h.height / 2 - A / 2})`), updateNodeBounds(a, R), a.intersect = function(e) {
|
|
1191
|
+
if (log.info("iconSquare intersect", a, e), !a.label) return intersect_default.rect(a, e);
|
|
1192
|
+
let s = a.x ?? 0, c = a.y ?? 0, l = a.height ?? 0, u = [];
|
|
1193
1193
|
return u = _ ? [
|
|
1194
1194
|
{
|
|
1195
1195
|
x: s - h.width / 2,
|
|
@@ -1256,19 +1256,19 @@ async function icon(e, o, { config: { themeVariables: s, flowchart: c } }) {
|
|
|
1256
1256
|
x: s - y / 2,
|
|
1257
1257
|
y: c - l / 2 + v
|
|
1258
1258
|
}
|
|
1259
|
-
], intersect_default.polygon(
|
|
1259
|
+
], intersect_default.polygon(a, u, e);
|
|
1260
1260
|
}, m;
|
|
1261
1261
|
}
|
|
1262
1262
|
__name(icon, "icon");
|
|
1263
|
-
async function iconCircle(e,
|
|
1264
|
-
let { labelStyles: l } = styles2String(
|
|
1265
|
-
|
|
1266
|
-
let u =
|
|
1267
|
-
|
|
1268
|
-
let { shapeSvg: m, bbox: h, label: g } = await labelHelper(e,
|
|
1269
|
-
|
|
1263
|
+
async function iconCircle(e, a, { config: { themeVariables: s, flowchart: c } }) {
|
|
1264
|
+
let { labelStyles: l } = styles2String(a);
|
|
1265
|
+
a.labelStyle = l;
|
|
1266
|
+
let u = a.assetHeight ?? 48, d = a.assetWidth ?? 48, f = Math.max(u, d), p = c?.wrappingWidth;
|
|
1267
|
+
a.width = Math.max(f, p ?? 0);
|
|
1268
|
+
let { shapeSvg: m, bbox: h, label: g } = await labelHelper(e, a, "icon-shape default"), _ = a.label ? 8 : 0, v = a.pos === "t", { nodeBorder: y, mainBkg: x } = s, { stylesMap: w } = compileStyles(a), D = at.svg(m), k = userNodeOverrides(a, {});
|
|
1269
|
+
a.look !== "handDrawn" && (k.roughness = 0, k.fillStyle = "solid"), k.stroke = w.get("fill") ?? x;
|
|
1270
1270
|
let A = m.append("g");
|
|
1271
|
-
|
|
1271
|
+
a.icon && A.html(`<g>${await getIconSVG(a.icon, {
|
|
1272
1272
|
height: f,
|
|
1273
1273
|
width: f,
|
|
1274
1274
|
fallbackPrefix: ""
|
|
@@ -1278,36 +1278,36 @@ async function iconCircle(e, o, { config: { themeVariables: s, flowchart: c } })
|
|
|
1278
1278
|
fill: "transparent",
|
|
1279
1279
|
stroke: "none"
|
|
1280
1280
|
}), V = m.insert(() => L, ":first-child"), H = m.insert(() => B);
|
|
1281
|
-
return A.attr("transform", `translate(${-M / 2 - P},${v ? h.height / 2 + _ / 2 - N / 2 - F : -h.height / 2 - _ / 2 - N / 2 - F})`), A.attr("style", `color: ${w.get("stroke") ?? y};`), g.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${v ? -z / 2 : z / 2 - h.height})`), V.attr("transform", `translate(0,${v ? h.height / 2 + _ / 2 : -h.height / 2 - _ / 2})`), updateNodeBounds(
|
|
1282
|
-
return log.info("iconSquare intersect",
|
|
1281
|
+
return A.attr("transform", `translate(${-M / 2 - P},${v ? h.height / 2 + _ / 2 - N / 2 - F : -h.height / 2 - _ / 2 - N / 2 - F})`), A.attr("style", `color: ${w.get("stroke") ?? y};`), g.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${v ? -z / 2 : z / 2 - h.height})`), V.attr("transform", `translate(0,${v ? h.height / 2 + _ / 2 : -h.height / 2 - _ / 2})`), updateNodeBounds(a, H), a.intersect = function(e) {
|
|
1282
|
+
return log.info("iconSquare intersect", a, e), intersect_default.rect(a, e);
|
|
1283
1283
|
}, m;
|
|
1284
1284
|
}
|
|
1285
1285
|
__name(iconCircle, "iconCircle");
|
|
1286
|
-
async function iconRounded(e,
|
|
1287
|
-
let { labelStyles: l } = styles2String(
|
|
1288
|
-
|
|
1289
|
-
let u =
|
|
1290
|
-
|
|
1291
|
-
let { shapeSvg: m, bbox: h, halfPadding: g, label: _ } = await labelHelper(e,
|
|
1292
|
-
|
|
1286
|
+
async function iconRounded(e, a, { config: { themeVariables: s, flowchart: c } }) {
|
|
1287
|
+
let { labelStyles: l } = styles2String(a);
|
|
1288
|
+
a.labelStyle = l;
|
|
1289
|
+
let u = a.assetHeight ?? 48, d = a.assetWidth ?? 48, f = Math.max(u, d), p = c?.wrappingWidth;
|
|
1290
|
+
a.width = Math.max(f, p ?? 0);
|
|
1291
|
+
let { shapeSvg: m, bbox: h, halfPadding: g, label: _ } = await labelHelper(e, a, "icon-shape default"), v = a.pos === "t", y = f + g * 2, x = f + g * 2, { nodeBorder: w, mainBkg: D } = s, { stylesMap: k } = compileStyles(a), A = -x / 2, j = -y / 2, M = a.label ? 8 : 0, N = at.svg(m), P = userNodeOverrides(a, {});
|
|
1292
|
+
a.look !== "handDrawn" && (P.roughness = 0, P.fillStyle = "solid"), P.stroke = k.get("fill") ?? D;
|
|
1293
1293
|
let F = N.path(createRoundedRectPathD(A, j, x, y, 5), P), L = Math.max(x, h.width), R = y + h.height + M, z = N.rectangle(-L / 2, -R / 2, L, R, {
|
|
1294
1294
|
...P,
|
|
1295
1295
|
fill: "transparent",
|
|
1296
1296
|
stroke: "none"
|
|
1297
1297
|
}), B = m.insert(() => F, ":first-child").attr("class", "icon-shape2"), V = m.insert(() => z);
|
|
1298
|
-
if (
|
|
1298
|
+
if (a.icon) {
|
|
1299
1299
|
let e = m.append("g");
|
|
1300
|
-
e.html(`<g>${await getIconSVG(
|
|
1300
|
+
e.html(`<g>${await getIconSVG(a.icon, {
|
|
1301
1301
|
height: f,
|
|
1302
1302
|
width: f,
|
|
1303
1303
|
fallbackPrefix: ""
|
|
1304
1304
|
})}</g>`);
|
|
1305
|
-
let
|
|
1305
|
+
let o = e.node().getBBox(), s = o.width, c = o.height, l = o.x, u = o.y;
|
|
1306
1306
|
e.attr("transform", `translate(${-s / 2 - l},${v ? h.height / 2 + M / 2 - c / 2 - u : -h.height / 2 - M / 2 - c / 2 - u})`), e.attr("style", `color: ${k.get("stroke") ?? w};`);
|
|
1307
1307
|
}
|
|
1308
|
-
return _.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${v ? -R / 2 : R / 2 - h.height})`), B.attr("transform", `translate(0,${v ? h.height / 2 + M / 2 : -h.height / 2 - M / 2})`), updateNodeBounds(
|
|
1309
|
-
if (log.info("iconSquare intersect",
|
|
1310
|
-
let s =
|
|
1308
|
+
return _.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${v ? -R / 2 : R / 2 - h.height})`), B.attr("transform", `translate(0,${v ? h.height / 2 + M / 2 : -h.height / 2 - M / 2})`), updateNodeBounds(a, V), a.intersect = function(e) {
|
|
1309
|
+
if (log.info("iconSquare intersect", a, e), !a.label) return intersect_default.rect(a, e);
|
|
1310
|
+
let s = a.x ?? 0, c = a.y ?? 0, l = a.height ?? 0, u = [];
|
|
1311
1311
|
return u = v ? [
|
|
1312
1312
|
{
|
|
1313
1313
|
x: s - h.width / 2,
|
|
@@ -1374,35 +1374,35 @@ async function iconRounded(e, o, { config: { themeVariables: s, flowchart: c } }
|
|
|
1374
1374
|
x: s - x / 2,
|
|
1375
1375
|
y: c - l / 2 + y
|
|
1376
1376
|
}
|
|
1377
|
-
], intersect_default.polygon(
|
|
1377
|
+
], intersect_default.polygon(a, u, e);
|
|
1378
1378
|
}, m;
|
|
1379
1379
|
}
|
|
1380
1380
|
__name(iconRounded, "iconRounded");
|
|
1381
|
-
async function iconSquare(e,
|
|
1382
|
-
let { labelStyles: l } = styles2String(
|
|
1383
|
-
|
|
1384
|
-
let u =
|
|
1385
|
-
|
|
1386
|
-
let { shapeSvg: m, bbox: h, halfPadding: g, label: _ } = await labelHelper(e,
|
|
1387
|
-
|
|
1381
|
+
async function iconSquare(e, a, { config: { themeVariables: s, flowchart: c } }) {
|
|
1382
|
+
let { labelStyles: l } = styles2String(a);
|
|
1383
|
+
a.labelStyle = l;
|
|
1384
|
+
let u = a.assetHeight ?? 48, d = a.assetWidth ?? 48, f = Math.max(u, d), p = c?.wrappingWidth;
|
|
1385
|
+
a.width = Math.max(f, p ?? 0);
|
|
1386
|
+
let { shapeSvg: m, bbox: h, halfPadding: g, label: _ } = await labelHelper(e, a, "icon-shape default"), v = a.pos === "t", y = f + g * 2, x = f + g * 2, { nodeBorder: w, mainBkg: D } = s, { stylesMap: k } = compileStyles(a), A = -x / 2, j = -y / 2, M = a.label ? 8 : 0, N = at.svg(m), P = userNodeOverrides(a, {});
|
|
1387
|
+
a.look !== "handDrawn" && (P.roughness = 0, P.fillStyle = "solid"), P.stroke = k.get("fill") ?? D;
|
|
1388
1388
|
let F = N.path(createRoundedRectPathD(A, j, x, y, .1), P), L = Math.max(x, h.width), R = y + h.height + M, z = N.rectangle(-L / 2, -R / 2, L, R, {
|
|
1389
1389
|
...P,
|
|
1390
1390
|
fill: "transparent",
|
|
1391
1391
|
stroke: "none"
|
|
1392
1392
|
}), B = m.insert(() => F, ":first-child"), V = m.insert(() => z);
|
|
1393
|
-
if (
|
|
1393
|
+
if (a.icon) {
|
|
1394
1394
|
let e = m.append("g");
|
|
1395
|
-
e.html(`<g>${await getIconSVG(
|
|
1395
|
+
e.html(`<g>${await getIconSVG(a.icon, {
|
|
1396
1396
|
height: f,
|
|
1397
1397
|
width: f,
|
|
1398
1398
|
fallbackPrefix: ""
|
|
1399
1399
|
})}</g>`);
|
|
1400
|
-
let
|
|
1400
|
+
let o = e.node().getBBox(), s = o.width, c = o.height, l = o.x, u = o.y;
|
|
1401
1401
|
e.attr("transform", `translate(${-s / 2 - l},${v ? h.height / 2 + M / 2 - c / 2 - u : -h.height / 2 - M / 2 - c / 2 - u})`), e.attr("style", `color: ${k.get("stroke") ?? w};`);
|
|
1402
1402
|
}
|
|
1403
|
-
return _.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${v ? -R / 2 : R / 2 - h.height})`), B.attr("transform", `translate(0,${v ? h.height / 2 + M / 2 : -h.height / 2 - M / 2})`), updateNodeBounds(
|
|
1404
|
-
if (log.info("iconSquare intersect",
|
|
1405
|
-
let s =
|
|
1403
|
+
return _.attr("transform", `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${v ? -R / 2 : R / 2 - h.height})`), B.attr("transform", `translate(0,${v ? h.height / 2 + M / 2 : -h.height / 2 - M / 2})`), updateNodeBounds(a, V), a.intersect = function(e) {
|
|
1404
|
+
if (log.info("iconSquare intersect", a, e), !a.label) return intersect_default.rect(a, e);
|
|
1405
|
+
let s = a.x ?? 0, c = a.y ?? 0, l = a.height ?? 0, u = [];
|
|
1406
1406
|
return u = v ? [
|
|
1407
1407
|
{
|
|
1408
1408
|
x: s - h.width / 2,
|
|
@@ -1469,35 +1469,35 @@ async function iconSquare(e, o, { config: { themeVariables: s, flowchart: c } })
|
|
|
1469
1469
|
x: s - x / 2,
|
|
1470
1470
|
y: c - l / 2 + y
|
|
1471
1471
|
}
|
|
1472
|
-
], intersect_default.polygon(
|
|
1472
|
+
], intersect_default.polygon(a, u, e);
|
|
1473
1473
|
}, m;
|
|
1474
1474
|
}
|
|
1475
1475
|
__name(iconSquare, "iconSquare");
|
|
1476
|
-
async function imageSquare(e,
|
|
1476
|
+
async function imageSquare(e, a, { config: { flowchart: s } }) {
|
|
1477
1477
|
let c = new Image();
|
|
1478
|
-
c.src =
|
|
1478
|
+
c.src = a?.img ?? "", await c.decode();
|
|
1479
1479
|
let l = Number(c.naturalWidth.toString().replace("px", "")), u = Number(c.naturalHeight.toString().replace("px", ""));
|
|
1480
|
-
|
|
1481
|
-
let { labelStyles: d } = styles2String(
|
|
1482
|
-
|
|
1480
|
+
a.imageAspectRatio = l / u;
|
|
1481
|
+
let { labelStyles: d } = styles2String(a);
|
|
1482
|
+
a.labelStyle = d;
|
|
1483
1483
|
let f = s?.wrappingWidth;
|
|
1484
|
-
|
|
1485
|
-
let p = Math.max(
|
|
1486
|
-
|
|
1487
|
-
let { shapeSvg: g, bbox: _, label: v } = await labelHelper(e,
|
|
1488
|
-
|
|
1484
|
+
a.defaultWidth = s?.wrappingWidth;
|
|
1485
|
+
let p = Math.max(a.label ? f ?? 0 : 0, a?.assetWidth ?? l), m = a.constraint === "on" && a?.assetHeight ? a.assetHeight * a.imageAspectRatio : p, h = a.constraint === "on" ? m / a.imageAspectRatio : a?.assetHeight ?? u;
|
|
1486
|
+
a.width = Math.max(m, f ?? 0);
|
|
1487
|
+
let { shapeSvg: g, bbox: _, label: v } = await labelHelper(e, a, "image-shape default"), y = a.pos === "t", b = -m / 2, x = -h / 2, w = a.label ? 8 : 0, T = at.svg(g), D = userNodeOverrides(a, {});
|
|
1488
|
+
a.look !== "handDrawn" && (D.roughness = 0, D.fillStyle = "solid");
|
|
1489
1489
|
let k = T.rectangle(b, x, m, h, D), A = Math.max(m, _.width), j = h + _.height + w, M = T.rectangle(-A / 2, -j / 2, A, j, {
|
|
1490
1490
|
...D,
|
|
1491
1491
|
fill: "none",
|
|
1492
1492
|
stroke: "none"
|
|
1493
1493
|
}), N = g.insert(() => k, ":first-child"), P = g.insert(() => M);
|
|
1494
|
-
if (
|
|
1494
|
+
if (a.img) {
|
|
1495
1495
|
let e = g.append("image");
|
|
1496
|
-
e.attr("href",
|
|
1496
|
+
e.attr("href", a.img), e.attr("width", m), e.attr("height", h), e.attr("preserveAspectRatio", "none"), e.attr("transform", `translate(${-m / 2},${y ? j / 2 - h : -j / 2})`);
|
|
1497
1497
|
}
|
|
1498
|
-
return v.attr("transform", `translate(${-_.width / 2 - (_.x - (_.left ?? 0))},${y ? -h / 2 - _.height / 2 - w / 2 : h / 2 - _.height / 2 + w / 2})`), N.attr("transform", `translate(0,${y ? _.height / 2 + w / 2 : -_.height / 2 - w / 2})`), updateNodeBounds(
|
|
1499
|
-
if (log.info("iconSquare intersect",
|
|
1500
|
-
let s =
|
|
1498
|
+
return v.attr("transform", `translate(${-_.width / 2 - (_.x - (_.left ?? 0))},${y ? -h / 2 - _.height / 2 - w / 2 : h / 2 - _.height / 2 + w / 2})`), N.attr("transform", `translate(0,${y ? _.height / 2 + w / 2 : -_.height / 2 - w / 2})`), updateNodeBounds(a, P), a.intersect = function(e) {
|
|
1499
|
+
if (log.info("iconSquare intersect", a, e), !a.label) return intersect_default.rect(a, e);
|
|
1500
|
+
let s = a.x ?? 0, c = a.y ?? 0, l = a.height ?? 0, u = [];
|
|
1501
1501
|
return u = y ? [
|
|
1502
1502
|
{
|
|
1503
1503
|
x: s - _.width / 2,
|
|
@@ -1564,7 +1564,7 @@ async function imageSquare(e, o, { config: { flowchart: s } }) {
|
|
|
1564
1564
|
x: s - m / 2,
|
|
1565
1565
|
y: c - l / 2 + h
|
|
1566
1566
|
}
|
|
1567
|
-
], intersect_default.polygon(
|
|
1567
|
+
], intersect_default.polygon(a, u, e);
|
|
1568
1568
|
}, g;
|
|
1569
1569
|
}
|
|
1570
1570
|
__name(imageSquare, "imageSquare");
|
|
@@ -1665,10 +1665,10 @@ async function lean_right(e, a) {
|
|
|
1665
1665
|
}, d;
|
|
1666
1666
|
}
|
|
1667
1667
|
__name(lean_right, "lean_right");
|
|
1668
|
-
function lightningBolt(e,
|
|
1669
|
-
let { labelStyles: s, nodeStyles: c } = styles2String(
|
|
1670
|
-
|
|
1671
|
-
let l = e.insert("g").attr("class", getNodeClasses(
|
|
1668
|
+
function lightningBolt(e, a) {
|
|
1669
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(a);
|
|
1670
|
+
a.label = "", a.labelStyle = s;
|
|
1671
|
+
let l = e.insert("g").attr("class", getNodeClasses(a)).attr("id", a.domId ?? a.id), { cssStyles: u } = a, d = Math.max(35, a?.width ?? 0), f = Math.max(35, a?.height ?? 0), p = [
|
|
1672
1672
|
{
|
|
1673
1673
|
x: d,
|
|
1674
1674
|
y: 0
|
|
@@ -1693,11 +1693,11 @@ function lightningBolt(e, o) {
|
|
|
1693
1693
|
x: 14,
|
|
1694
1694
|
y: f - 7 / 2
|
|
1695
1695
|
}
|
|
1696
|
-
], m = at.svg(l), h = userNodeOverrides(
|
|
1697
|
-
|
|
1696
|
+
], m = at.svg(l), h = userNodeOverrides(a, {});
|
|
1697
|
+
a.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
|
|
1698
1698
|
let g = createPathFromPoints(p), _ = m.path(g, h), v = l.insert(() => _, ":first-child");
|
|
1699
|
-
return v.attr("class", "outer-path"), u &&
|
|
1700
|
-
return log.info("lightningBolt intersect",
|
|
1699
|
+
return v.attr("class", "outer-path"), u && a.look !== "handDrawn" && v.selectAll("path").attr("style", u), c && a.look !== "handDrawn" && v.selectAll("path").attr("style", c), v.attr("transform", `translate(-${d / 2},${-f})`), updateNodeBounds(a, v), a.intersect = function(e) {
|
|
1700
|
+
return log.info("lightningBolt intersect", a, e), intersect_default.polygon(a, p, e);
|
|
1701
1701
|
}, l;
|
|
1702
1702
|
}
|
|
1703
1703
|
__name(lightningBolt, "lightningBolt");
|
|
@@ -1965,15 +1965,15 @@ async function multiWaveEdgedRectangle(e, a) {
|
|
|
1965
1965
|
}
|
|
1966
1966
|
__name(multiWaveEdgedRectangle, "multiWaveEdgedRectangle");
|
|
1967
1967
|
async function note(e, a, { config: { themeVariables: o } }) {
|
|
1968
|
-
let { labelStyles:
|
|
1969
|
-
a.labelStyle =
|
|
1968
|
+
let { labelStyles: s, nodeStyles: l } = styles2String(a);
|
|
1969
|
+
a.labelStyle = s, a.useHtmlLabels || getEffectiveHtmlLabels(getConfig()) || (a.centerLabel = !0);
|
|
1970
1970
|
let { shapeSvg: d, bbox: f, label: p } = await labelHelper(e, a, getNodeClasses(a)), m = Math.max(f.width + (a.padding ?? 0) * 2, a?.width ?? 0), h = Math.max(f.height + (a.padding ?? 0) * 2, a?.height ?? 0), g = -m / 2, _ = -h / 2, { cssStyles: v } = a, y = at.svg(d), b = userNodeOverrides(a, {
|
|
1971
1971
|
fill: o.noteBkgColor,
|
|
1972
1972
|
stroke: o.noteBorderColor
|
|
1973
1973
|
});
|
|
1974
1974
|
a.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
|
|
1975
1975
|
let x = y.rectangle(g, _, m, h, b), w = d.insert(() => x, ":first-child");
|
|
1976
|
-
return w.attr("class", "basic label-container outer-path"), p.attr("class", "label noteLabel"), v && a.look !== "handDrawn" && w.selectAll("path").attr("style", v),
|
|
1976
|
+
return w.attr("class", "basic label-container outer-path"), p.attr("class", "label noteLabel"), v && a.look !== "handDrawn" && w.selectAll("path").attr("style", v), l && a.look !== "handDrawn" && w.selectAll("path").attr("style", l), p.attr("transform", `translate(${-f.width / 2 - (f.x - (f.left ?? 0))}, ${-(f.height / 2) - (f.y - (f.top ?? 0))})`), updateNodeBounds(a, w), a.intersect = function(e) {
|
|
1977
1977
|
return intersect_default.rect(a, e);
|
|
1978
1978
|
}, d;
|
|
1979
1979
|
}
|
|
@@ -2070,32 +2070,32 @@ async function rect_left_inv_arrow(e, a) {
|
|
|
2070
2070
|
}, d;
|
|
2071
2071
|
}
|
|
2072
2072
|
__name(rect_left_inv_arrow, "rect_left_inv_arrow");
|
|
2073
|
-
async function rectWithTitle(
|
|
2074
|
-
let { labelStyles:
|
|
2075
|
-
|
|
2076
|
-
let
|
|
2077
|
-
|
|
2078
|
-
let
|
|
2073
|
+
async function rectWithTitle(a, s) {
|
|
2074
|
+
let { labelStyles: c, nodeStyles: d } = styles2String(s);
|
|
2075
|
+
s.labelStyle = c;
|
|
2076
|
+
let f;
|
|
2077
|
+
f = s.cssClasses ? "node " + s.cssClasses : "node default";
|
|
2078
|
+
let p = a.insert("g").attr("class", f).attr("id", s.domId || s.id), m = p.insert("g"), h = p.insert("g").attr("class", "label").attr("style", d), g = s.description, _ = s.label, v = await createLabel_default(h, _, s.labelStyle, !0, !0), y = {
|
|
2079
2079
|
width: 0,
|
|
2080
2080
|
height: 0
|
|
2081
2081
|
};
|
|
2082
2082
|
if (getEffectiveHtmlLabels(getConfig2())) {
|
|
2083
|
-
let
|
|
2084
|
-
y =
|
|
2083
|
+
let a = v.children[0], o = select_default(v);
|
|
2084
|
+
y = a.getBoundingClientRect(), o.attr("width", y.width), o.attr("height", y.height);
|
|
2085
2085
|
}
|
|
2086
2086
|
log.info("Text 2", g);
|
|
2087
|
-
let b = g || [], x = v.getBBox(), w = await createLabel_default(h, Array.isArray(b) ? b.join("<br/>") : b,
|
|
2087
|
+
let b = g || [], x = v.getBBox(), w = await createLabel_default(h, Array.isArray(b) ? b.join("<br/>") : b, s.labelStyle, !0, !0), T = w.children[0], E = select_default(w);
|
|
2088
2088
|
y = T.getBoundingClientRect(), E.attr("width", y.width), E.attr("height", y.height);
|
|
2089
|
-
let D = (
|
|
2089
|
+
let D = (s.padding || 0) / 2;
|
|
2090
2090
|
select_default(w).attr("transform", "translate( " + (y.width > x.width ? 0 : (x.width - y.width) / 2) + ", " + (x.height + D + 5) + ")"), select_default(v).attr("transform", "translate( " + (y.width < x.width ? 0 : -(x.width - y.width) / 2) + ", 0)"), y = h.node().getBBox(), h.attr("transform", "translate(" + -y.width / 2 + ", " + (-y.height / 2 - D + 3) + ")");
|
|
2091
|
-
let k = y.width + (
|
|
2092
|
-
if (
|
|
2093
|
-
let e = at.svg(
|
|
2094
|
-
P =
|
|
2095
|
-
} else N =
|
|
2096
|
-
return updateNodeBounds(
|
|
2097
|
-
return intersect_default.rect(
|
|
2098
|
-
},
|
|
2091
|
+
let k = y.width + (s.padding || 0), A = y.height + (s.padding || 0), j = -y.width / 2 - D, M = -y.height / 2 - D, N, P;
|
|
2092
|
+
if (s.look === "handDrawn") {
|
|
2093
|
+
let e = at.svg(p), a = userNodeOverrides(s, {}), c = e.path(createRoundedRectPathD(j, M, k, A, s.rx || 0), a), l = e.line(-y.width / 2 - D, -y.height / 2 - D + x.height + D, y.width / 2 + D, -y.height / 2 - D + x.height + D, a);
|
|
2094
|
+
P = p.insert(() => (log.debug("Rough node insert CXC", c), l), ":first-child"), N = p.insert(() => (log.debug("Rough node insert CXC", c), c), ":first-child");
|
|
2095
|
+
} else N = m.insert("rect", ":first-child"), P = m.insert("line"), N.attr("class", "outer title-state").attr("style", d).attr("x", -y.width / 2 - D).attr("y", -y.height / 2 - D).attr("width", y.width + (s.padding || 0)).attr("height", y.height + (s.padding || 0)), P.attr("class", "divider").attr("x1", -y.width / 2 - D).attr("x2", y.width / 2 + D).attr("y1", -y.height / 2 - D + x.height + D).attr("y2", -y.height / 2 - D + x.height + D);
|
|
2096
|
+
return updateNodeBounds(s, N), s.intersect = function(e) {
|
|
2097
|
+
return intersect_default.rect(s, e);
|
|
2098
|
+
}, p;
|
|
2099
2099
|
}
|
|
2100
2100
|
__name(rectWithTitle, "rectWithTitle");
|
|
2101
2101
|
async function roundedRect(e, a, { config: { themeVariables: o } }) {
|
|
@@ -2538,12 +2538,12 @@ async function trapezoidalPentagon(e, a) {
|
|
|
2538
2538
|
}
|
|
2539
2539
|
__name(trapezoidalPentagon, "trapezoidalPentagon");
|
|
2540
2540
|
var MIN_HEIGHT5 = 10, MIN_WIDTH5 = 10;
|
|
2541
|
-
async function triangle(e,
|
|
2542
|
-
let { labelStyles:
|
|
2543
|
-
|
|
2544
|
-
let d =
|
|
2545
|
-
(
|
|
2546
|
-
let { shapeSvg: p, bbox: m, label: h } = await labelHelper(e,
|
|
2541
|
+
async function triangle(e, a) {
|
|
2542
|
+
let { labelStyles: c, nodeStyles: u } = styles2String(a);
|
|
2543
|
+
a.labelStyle = c;
|
|
2544
|
+
let d = a.padding ?? 0, f = a.look === "neo" ? d * 2 : d;
|
|
2545
|
+
(a.width || a.height) && (a.width = ((a?.width ?? 0) - f) / 2, a.width < MIN_WIDTH5 && (a.width = MIN_WIDTH5), a.height = a?.height ?? 0, a.height < MIN_HEIGHT5 && (a.height = MIN_HEIGHT5));
|
|
2546
|
+
let { shapeSvg: p, bbox: m, label: h } = await labelHelper(e, a, getNodeClasses(a)), g = evaluate(getConfig2().flowchart?.htmlLabels), _ = (a?.width ? a?.width : m.width) + f, v = a?.height ? a?.height : _ + m.height, y = v, b = [
|
|
2547
2547
|
{
|
|
2548
2548
|
x: 0,
|
|
2549
2549
|
y: 0
|
|
@@ -2556,11 +2556,11 @@ async function triangle(e, s) {
|
|
|
2556
2556
|
x: y / 2,
|
|
2557
2557
|
y: -v
|
|
2558
2558
|
}
|
|
2559
|
-
], { cssStyles: x } =
|
|
2560
|
-
|
|
2559
|
+
], { cssStyles: x } = a, w = at.svg(p), T = userNodeOverrides(a, {});
|
|
2560
|
+
a.look !== "handDrawn" && (T.roughness = 0, T.fillStyle = "solid");
|
|
2561
2561
|
let D = createPathFromPoints(b), j = w.path(D, T), M = p.insert(() => j, ":first-child").attr("transform", `translate(${-v / 2}, ${v / 2})`).attr("class", "outer-path");
|
|
2562
|
-
return x &&
|
|
2563
|
-
return log.info("Triangle intersect",
|
|
2562
|
+
return x && a.look !== "handDrawn" && M.selectChildren("path").attr("style", x), u && a.look !== "handDrawn" && M.selectChildren("path").attr("style", u), a.width = _, a.height = v, updateNodeBounds(a, M), h.attr("transform", `translate(${-m.width / 2 - (m.x - (m.left ?? 0))}, ${v / 2 - (m.height + (a.padding ?? 0) / (g ? 2 : 1) - (m.y - (m.top ?? 0)))})`), a.intersect = function(e) {
|
|
2563
|
+
return log.info("Triangle intersect", a, b, e), intersect_default.polygon(a, b, e);
|
|
2564
2564
|
}, p;
|
|
2565
2565
|
}
|
|
2566
2566
|
__name(triangle, "triangle");
|
|
@@ -2658,50 +2658,50 @@ var COLOR_THEMES = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]),
|
|
|
2658
2658
|
"redux-color",
|
|
2659
2659
|
"redux-dark-color"
|
|
2660
2660
|
]);
|
|
2661
|
-
async function erBox(
|
|
2662
|
-
let
|
|
2663
|
-
|
|
2664
|
-
let { theme:
|
|
2665
|
-
if (
|
|
2666
|
-
let { themeVariables:
|
|
2667
|
-
await erBox(
|
|
2668
|
-
...
|
|
2669
|
-
id:
|
|
2670
|
-
domId: (
|
|
2661
|
+
async function erBox(a, o) {
|
|
2662
|
+
let l = o;
|
|
2663
|
+
l.alias && (o.label = l.alias);
|
|
2664
|
+
let { theme: u, themeVariables: d } = getConfig(), { rowEven: f, rowOdd: p, nodeBorder: m, borderColorArray: g } = d;
|
|
2665
|
+
if (o.look === "handDrawn") {
|
|
2666
|
+
let { themeVariables: e } = getConfig(), { background: s } = e;
|
|
2667
|
+
await erBox(a, {
|
|
2668
|
+
...o,
|
|
2669
|
+
id: o.id + "-background",
|
|
2670
|
+
domId: (o.domId || o.id) + "-background",
|
|
2671
2671
|
look: "default",
|
|
2672
|
-
cssStyles: ["stroke: none", `fill: ${
|
|
2672
|
+
cssStyles: ["stroke: none", `fill: ${s}`]
|
|
2673
2673
|
});
|
|
2674
2674
|
}
|
|
2675
2675
|
let _ = getConfig();
|
|
2676
|
-
|
|
2677
|
-
let v = _.er?.diagramPadding ?? 10, y = _.er?.entityPadding ?? 6, { cssStyles: b } =
|
|
2678
|
-
if (
|
|
2679
|
-
let
|
|
2676
|
+
o.useHtmlLabels = _.htmlLabels;
|
|
2677
|
+
let v = _.er?.diagramPadding ?? 10, y = _.er?.entityPadding ?? 6, { cssStyles: b } = o, { labelStyles: x, nodeStyles: w } = styles2String(o);
|
|
2678
|
+
if (l.attributes.length === 0 && o.label) {
|
|
2679
|
+
let e = {
|
|
2680
2680
|
rx: 0,
|
|
2681
2681
|
ry: 0,
|
|
2682
2682
|
labelPaddingX: v,
|
|
2683
2683
|
labelPaddingY: v * 1.5,
|
|
2684
2684
|
classes: ""
|
|
2685
2685
|
};
|
|
2686
|
-
calculateTextWidth(
|
|
2687
|
-
let
|
|
2688
|
-
if (
|
|
2689
|
-
let e =
|
|
2690
|
-
|
|
2686
|
+
calculateTextWidth(o.label, _) + e.labelPaddingX * 2 < _.er.minEntityWidth && (o.width = _.er.minEntityWidth);
|
|
2687
|
+
let c = await drawRect(a, o, e);
|
|
2688
|
+
if (u != null && COLOR_THEMES.has(u)) {
|
|
2689
|
+
let e = l.colorIndex ?? 0;
|
|
2690
|
+
c.attr("data-color-id", `color-${e % g.length}`);
|
|
2691
2691
|
}
|
|
2692
2692
|
if (!evaluate(_.htmlLabels)) {
|
|
2693
|
-
let e =
|
|
2693
|
+
let e = c.select("text"), a = e.node()?.getBBox();
|
|
2694
2694
|
e.attr("transform", `translate(${-a.width / 2}, 0)`);
|
|
2695
2695
|
}
|
|
2696
|
-
return
|
|
2696
|
+
return c;
|
|
2697
2697
|
}
|
|
2698
2698
|
_.htmlLabels || (v *= 1.25, y *= 1.25);
|
|
2699
|
-
let T = getNodeClasses(
|
|
2699
|
+
let T = getNodeClasses(o);
|
|
2700
2700
|
T ||= "node default";
|
|
2701
|
-
let E =
|
|
2701
|
+
let E = a.insert("g").attr("class", T).attr("id", o.domId || o.id), D = await addText(E, o.label ?? "", _, 0, 0, ["name"], x);
|
|
2702
2702
|
D.height += y;
|
|
2703
2703
|
let A = 0, j = [], M = [], N = 0, P = 0, F = 0, I = 0, L = !0, R = !0;
|
|
2704
|
-
for (let e of
|
|
2704
|
+
for (let e of l.attributes) {
|
|
2705
2705
|
let a = await addText(E, e.type, _, 0, A, ["attribute-type"], x);
|
|
2706
2706
|
N = Math.max(N, a.width + v);
|
|
2707
2707
|
let o = await addText(E, e.name, _, 0, A, ["attribute-name"], x);
|
|
@@ -2723,20 +2723,20 @@ async function erBox(e, a) {
|
|
|
2723
2723
|
let e = D.width + v * 2 - (N + P + F + I);
|
|
2724
2724
|
N += e / z, P += e / z, F > 0 && (F += e / z), I > 0 && (I += e / z);
|
|
2725
2725
|
}
|
|
2726
|
-
let V = N + P + F + I, H = at.svg(E), U = userNodeOverrides(
|
|
2727
|
-
|
|
2726
|
+
let V = N + P + F + I, H = at.svg(E), U = userNodeOverrides(o, {});
|
|
2727
|
+
o.look !== "handDrawn" && (U.roughness = 0, U.fillStyle = "solid");
|
|
2728
2728
|
let W = 0;
|
|
2729
2729
|
M.length > 0 && (W = M.reduce((e, a) => e + (a?.rowHeight ?? 0), 0));
|
|
2730
|
-
let G = Math.max(B.width + v * 2,
|
|
2731
|
-
if (E.selectAll("g:not(:first-child)").each((
|
|
2732
|
-
let
|
|
2733
|
-
if (
|
|
2734
|
-
let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(
|
|
2735
|
-
e && (
|
|
2730
|
+
let G = Math.max(B.width + v * 2, o?.width || 0, V), K = Math.max((W ?? 0) + D.height, o?.height || 0), q = -G / 2, J = -K / 2;
|
|
2731
|
+
if (E.selectAll("g:not(:first-child)").each((a, o, s) => {
|
|
2732
|
+
let c = select_default(s[o]), l = c.attr("transform"), u = 0, d = 0;
|
|
2733
|
+
if (l) {
|
|
2734
|
+
let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(l);
|
|
2735
|
+
e && (u = parseFloat(e[1]), d = parseFloat(e[2]), c.attr("class").includes("attribute-name") ? u += N : c.attr("class").includes("attribute-keys") ? u += N + P : c.attr("class").includes("attribute-comment") && (u += N + P + F));
|
|
2736
2736
|
}
|
|
2737
|
-
|
|
2738
|
-
}), E.select(".name").attr("transform", "translate(" + -D.width / 2 + ", " + (J + y / 2) + ")"),
|
|
2739
|
-
let e =
|
|
2737
|
+
c.attr("transform", `translate(${q + v / 2 + u}, ${d + J + D.height + y / 2})`);
|
|
2738
|
+
}), E.select(".name").attr("transform", "translate(" + -D.width / 2 + ", " + (J + y / 2) + ")"), u != null && COLOR_THEMES.has(u)) {
|
|
2739
|
+
let e = l.colorIndex ?? 0;
|
|
2740
2740
|
E.attr("data-color-id", `color-${e % g.length}`);
|
|
2741
2741
|
}
|
|
2742
2742
|
let Y = H.rectangle(q, J, G, K, U), X = E.insert(() => Y, ":first-child").attr("class", "outer-path").attr("style", b.join(""));
|
|
@@ -2744,8 +2744,8 @@ async function erBox(e, a) {
|
|
|
2744
2744
|
for (let [e, a] of M.entries()) {
|
|
2745
2745
|
let o = (e + 1) % 2 == 0 && a.yOffset !== 0, s = H.rectangle(q, D.height + J + a?.yOffset, G, a?.rowHeight, {
|
|
2746
2746
|
...U,
|
|
2747
|
-
fill: o ?
|
|
2748
|
-
stroke:
|
|
2747
|
+
fill: o ? f : p,
|
|
2748
|
+
stroke: m
|
|
2749
2749
|
});
|
|
2750
2750
|
E.insert(() => s, "g.label").attr("style", b.join("")).attr("class", `row-rect-${o ? "even" : "odd"}`);
|
|
2751
2751
|
}
|
|
@@ -2762,34 +2762,34 @@ async function erBox(e, a) {
|
|
|
2762
2762
|
let a = D.height + J + e;
|
|
2763
2763
|
Q = lineToPolygon(q, a, G + q, a, Z), $ = H.polygon(Q.map((e) => [e.x, e.y]), U), E.insert(() => $).attr("class", "divider");
|
|
2764
2764
|
}
|
|
2765
|
-
if (updateNodeBounds(
|
|
2765
|
+
if (updateNodeBounds(o, X), w && o.look !== "handDrawn") if (u != null && REDUX_THEMES.has(u)) E.selectAll("path").attr("style", w);
|
|
2766
2766
|
else {
|
|
2767
2767
|
let e = w.split(";")?.filter((e) => e.includes("stroke"))?.map((e) => `${e}`).join("; ");
|
|
2768
2768
|
E.selectAll("path").attr("style", e ?? ""), E.selectAll(".row-rect-even path").attr("style", w);
|
|
2769
2769
|
}
|
|
2770
|
-
return
|
|
2771
|
-
return intersect_default.rect(
|
|
2770
|
+
return o.intersect = function(e) {
|
|
2771
|
+
return intersect_default.rect(o, e);
|
|
2772
2772
|
}, E;
|
|
2773
2773
|
}
|
|
2774
2774
|
__name(erBox, "erBox");
|
|
2775
|
-
async function addText(
|
|
2776
|
-
let
|
|
2777
|
-
|
|
2778
|
-
let g =
|
|
2779
|
-
width: calculateTextWidth(
|
|
2780
|
-
style:
|
|
2781
|
-
useHtmlLabels:
|
|
2782
|
-
},
|
|
2783
|
-
if (
|
|
2775
|
+
async function addText(a, o, c, l = 0, u = 0, d = [], p = "") {
|
|
2776
|
+
let m = a.insert("g").attr("class", `label ${d.join(" ")}`).attr("transform", `translate(${l}, ${u})`).attr("style", p);
|
|
2777
|
+
o !== parseGenericTypes(o) && (o = parseGenericTypes(o), o = o.replaceAll("<", "<").replaceAll(">", ">"));
|
|
2778
|
+
let g = m.node().appendChild(await createText(m, o, {
|
|
2779
|
+
width: calculateTextWidth(o, c) + 100,
|
|
2780
|
+
style: p,
|
|
2781
|
+
useHtmlLabels: c.htmlLabels
|
|
2782
|
+
}, c));
|
|
2783
|
+
if (o.includes("<") || o.includes(">")) {
|
|
2784
2784
|
let e = g.children[0];
|
|
2785
2785
|
for (e.textContent = e.textContent.replaceAll("<", "<").replaceAll(">", ">"); e.childNodes[0];) e = e.childNodes[0], e.textContent = e.textContent.replaceAll("<", "<").replaceAll(">", ">");
|
|
2786
2786
|
}
|
|
2787
2787
|
let _ = g.getBBox();
|
|
2788
|
-
if (evaluate(
|
|
2789
|
-
let
|
|
2790
|
-
|
|
2791
|
-
let
|
|
2792
|
-
_ =
|
|
2788
|
+
if (evaluate(c.htmlLabels)) {
|
|
2789
|
+
let a = g.children[0];
|
|
2790
|
+
a.style.textAlign = "start";
|
|
2791
|
+
let o = select_default(g);
|
|
2792
|
+
_ = a.getBoundingClientRect(), o.attr("width", _.width), o.attr("height", _.height);
|
|
2793
2793
|
}
|
|
2794
2794
|
return _;
|
|
2795
2795
|
}
|
|
@@ -2863,23 +2863,23 @@ async function textHelper(e, a, o, s, c = o.class.padding ?? 12) {
|
|
|
2863
2863
|
};
|
|
2864
2864
|
}
|
|
2865
2865
|
__name(textHelper, "textHelper");
|
|
2866
|
-
async function addText2(
|
|
2867
|
-
let
|
|
2868
|
-
y = "text" in
|
|
2869
|
-
let b = await createText(
|
|
2866
|
+
async function addText2(o, l, u, f = []) {
|
|
2867
|
+
let p = o.insert("g").attr("class", "label").attr("style", f.join("; ")), _ = getConfig(), v = "useHtmlLabels" in l ? l.useHtmlLabels : evaluate(_.htmlLabels) ?? !0, y = "";
|
|
2868
|
+
y = "text" in l ? l.text : l.label, !v && y.startsWith("\\") && (y = y.substring(1)), hasKatex(y) && (v = !0);
|
|
2869
|
+
let b = await createText(p, sanitizeText3(decodeEntities(y)), {
|
|
2870
2870
|
width: calculateTextWidth(y, _) + 50,
|
|
2871
2871
|
classes: "markdown-node-label",
|
|
2872
2872
|
useHtmlLabels: v
|
|
2873
2873
|
}, _), x, S = 1;
|
|
2874
2874
|
if (v) {
|
|
2875
|
-
let
|
|
2876
|
-
S =
|
|
2877
|
-
let
|
|
2878
|
-
if (
|
|
2879
|
-
let
|
|
2880
|
-
await Promise.all([...
|
|
2875
|
+
let o = b.children[0], s = select_default(b);
|
|
2876
|
+
S = o.innerHTML.split("<br>").length, o.innerHTML.includes("</math>") && (S += o.innerHTML.split("<mrow>").length - 1);
|
|
2877
|
+
let c = o.getElementsByTagName("img");
|
|
2878
|
+
if (c) {
|
|
2879
|
+
let e = y.replace(/<img[^>]*>/g, "").trim() === "";
|
|
2880
|
+
await Promise.all([...c].map((o) => new Promise((s) => {
|
|
2881
2881
|
function c() {
|
|
2882
|
-
if (o.style.display = "flex", o.style.flexDirection = "column",
|
|
2882
|
+
if (o.style.display = "flex", o.style.flexDirection = "column", e) {
|
|
2883
2883
|
let e = _.fontSize?.toString() ?? window.getComputedStyle(document.body).fontSize, a = parseInt(e, 10) * 5 + "px";
|
|
2884
2884
|
o.style.minWidth = a, o.style.maxWidth = a;
|
|
2885
2885
|
} else o.style.width = "100%";
|
|
@@ -2890,56 +2890,56 @@ async function addText2(a, c, l, d = []) {
|
|
|
2890
2890
|
}), o.addEventListener("error", c), o.addEventListener("load", c);
|
|
2891
2891
|
})));
|
|
2892
2892
|
}
|
|
2893
|
-
x =
|
|
2893
|
+
x = o.getBoundingClientRect(), s.attr("width", x.width), s.attr("height", x.height);
|
|
2894
2894
|
} else {
|
|
2895
|
-
|
|
2896
|
-
let
|
|
2897
|
-
(b.textContent === "" || b.textContent.includes(">")) && (
|
|
2895
|
+
f.includes("font-weight: bolder") && select_default(b).selectAll("tspan").attr("font-weight", ""), S = b.children.length;
|
|
2896
|
+
let a = b.children[0];
|
|
2897
|
+
(b.textContent === "" || b.textContent.includes(">")) && (a.textContent = y[0] + y.substring(1).replaceAll(">", ">").replaceAll("<", "<").trim(), y[1] === " " && (a.textContent = a.textContent[0] + " " + a.textContent.substring(1))), a.textContent === "undefined" && (a.textContent = ""), x = b.getBBox();
|
|
2898
2898
|
}
|
|
2899
|
-
return
|
|
2899
|
+
return p.attr("transform", "translate(0," + (-x.height / (2 * S) + u) + ")"), x.height;
|
|
2900
2900
|
}
|
|
2901
2901
|
__name(addText2, "addText");
|
|
2902
|
-
async function classBox(
|
|
2903
|
-
let
|
|
2902
|
+
async function classBox(a, o) {
|
|
2903
|
+
let c = getConfig2(), { themeVariables: u } = c, { useGradient: d } = u, f = c.class.padding ?? 12, p = f, m = o.useHtmlLabels ?? evaluate(c.htmlLabels) ?? !0, h = o;
|
|
2904
2904
|
h.annotations = h.annotations ?? [], h.members = h.members ?? [], h.methods = h.methods ?? [];
|
|
2905
|
-
let { shapeSvg: g, bbox: _ } = await textHelper(
|
|
2906
|
-
|
|
2905
|
+
let { shapeSvg: g, bbox: _ } = await textHelper(a, o, c, m, p), { labelStyles: v, nodeStyles: y } = styles2String(o);
|
|
2906
|
+
o.labelStyle = v, o.cssStyles = h.styles || "";
|
|
2907
2907
|
let b = h.styles?.join(";") || y || "";
|
|
2908
|
-
|
|
2909
|
-
let x = h.members.length === 0 && h.methods.length === 0 && !
|
|
2910
|
-
|
|
2911
|
-
let E = Math.max(
|
|
2912
|
-
h.members.length === 0 && h.methods.length === 0 ? D +=
|
|
2913
|
-
let A = -E / 2, j = -D / 2, M = x ?
|
|
2914
|
-
k && (M =
|
|
2915
|
-
let N = w.rectangle(A -
|
|
2908
|
+
o.cssStyles ||= b.replaceAll("!important", "").split(";");
|
|
2909
|
+
let x = h.members.length === 0 && h.methods.length === 0 && !c.class?.hideEmptyMembersBox, w = at.svg(g), T = userNodeOverrides(o, {});
|
|
2910
|
+
o.look !== "handDrawn" && (T.roughness = 0, T.fillStyle = "solid");
|
|
2911
|
+
let E = Math.max(o.width ?? 0, _.width), D = Math.max(o.height ?? 0, _.height), k = (o.height ?? 0) > _.height;
|
|
2912
|
+
h.members.length === 0 && h.methods.length === 0 ? D += p : h.members.length > 0 && h.methods.length === 0 && (D += p * 2);
|
|
2913
|
+
let A = -E / 2, j = -D / 2, M = x ? f * 2 : h.members.length === 0 && h.methods.length === 0 ? -f : 0;
|
|
2914
|
+
k && (M = f * 2);
|
|
2915
|
+
let N = w.rectangle(A - f, j - f - (x ? f : h.members.length === 0 && h.methods.length === 0 ? -f / 2 : 0), E + 2 * f, D + 2 * f + M, T), P = g.insert(() => N, ":first-child");
|
|
2916
2916
|
P.attr("class", "basic label-container outer-path");
|
|
2917
|
-
let F = P.node().getBBox(), I = g.select(".annotation-group").node().getBBox().height - (x ?
|
|
2918
|
-
if (g.selectAll(".text").each((
|
|
2919
|
-
let
|
|
2920
|
-
if (
|
|
2921
|
-
let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(
|
|
2922
|
-
e && (
|
|
2917
|
+
let F = P.node().getBBox(), I = g.select(".annotation-group").node().getBBox().height - (x ? f / 2 : 0) || 0, L = g.select(".label-group").node().getBBox().height - (x ? f / 2 : 0) || 0, R = g.select(".members-group").node().getBBox().height - (x ? f / 2 : 0) || 0, z = (I + L + j + f - (j - f - (x ? f : h.members.length === 0 && h.methods.length === 0 ? -f / 2 : 0))) / 2;
|
|
2918
|
+
if (g.selectAll(".text").each((a, o, s) => {
|
|
2919
|
+
let l = select_default(s[o]), u = l.attr("transform"), d = 0;
|
|
2920
|
+
if (u) {
|
|
2921
|
+
let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(u);
|
|
2922
|
+
e && (d = parseFloat(e[2]));
|
|
2923
2923
|
}
|
|
2924
|
-
let _ =
|
|
2925
|
-
if (
|
|
2926
|
-
let e = Math.max(R,
|
|
2927
|
-
_ = k ? Math.max(z, I + L + e + j +
|
|
2924
|
+
let _ = d + j + f - (x ? f : h.members.length === 0 && h.methods.length === 0 ? -f / 2 : 0);
|
|
2925
|
+
if (l.attr("class").includes("methods-group")) {
|
|
2926
|
+
let e = Math.max(R, p / 2);
|
|
2927
|
+
_ = k ? Math.max(z, I + L + e + j + p * 2 + f) + p * 2 : I + L + e + j + p * 4 + f;
|
|
2928
2928
|
}
|
|
2929
|
-
h.members.length === 0 && h.methods.length === 0 &&
|
|
2929
|
+
h.members.length === 0 && h.methods.length === 0 && c.class?.hideEmptyMembersBox && (_ = h.annotations.length > 0 ? d - p : d), m || (_ -= 4);
|
|
2930
2930
|
let v = A;
|
|
2931
|
-
(
|
|
2931
|
+
(l.attr("class").includes("label-group") || l.attr("class").includes("annotation-group")) && (v = -l.node()?.getBBox().width / 2 || 0, g.selectAll("text").each(function(e, a, o) {
|
|
2932
2932
|
window.getComputedStyle(o[a]).textAnchor === "middle" && (v = 0);
|
|
2933
|
-
})),
|
|
2933
|
+
})), l.attr("transform", `translate(${v}, ${_})`);
|
|
2934
2934
|
}), h.members.length > 0 || h.methods.length > 0 || x) {
|
|
2935
|
-
let e = I + L + j +
|
|
2936
|
-
g.insert(() =>
|
|
2935
|
+
let e = I + L + j + f, a = w.line(F.x, e, F.x + F.width, e + .001, T);
|
|
2936
|
+
g.insert(() => a).attr("class", `divider${o.look === "neo" && !d ? " neo-line" : ""}`).attr("style", b);
|
|
2937
2937
|
}
|
|
2938
2938
|
if (x || h.members.length > 0 || h.methods.length > 0) {
|
|
2939
|
-
let e = I + L + R + j +
|
|
2940
|
-
g.insert(() =>
|
|
2939
|
+
let e = I + L + R + j + p * 2 + f, a = w.line(F.x, k ? Math.max(z, e) : e, F.x + F.width, (k ? Math.max(z, e) : e) + .001, T);
|
|
2940
|
+
g.insert(() => a).attr("class", `divider${o.look === "neo" && !d ? " neo-line" : ""}`).attr("style", b);
|
|
2941
2941
|
}
|
|
2942
|
-
if (h.look !== "handDrawn" && g.selectAll("path").attr("style", b), P.select(":nth-child(2)").attr("style", b), g.selectAll(".divider").select("path").attr("style", b),
|
|
2942
|
+
if (h.look !== "handDrawn" && g.selectAll("path").attr("style", b), P.select(":nth-child(2)").attr("style", b), g.selectAll(".divider").select("path").attr("style", b), o.labelStyle ? g.selectAll("span").attr("style", o.labelStyle) : g.selectAll("span").attr("style", b), !m) {
|
|
2943
2943
|
let e = RegExp(/color\s*:\s*([^;]*)/), a = e.exec(b);
|
|
2944
2944
|
if (a) {
|
|
2945
2945
|
let e = a[0].replace("color", "fill");
|
|
@@ -2952,78 +2952,78 @@ async function classBox(e, a) {
|
|
|
2952
2952
|
}
|
|
2953
2953
|
}
|
|
2954
2954
|
}
|
|
2955
|
-
return updateNodeBounds(
|
|
2956
|
-
return intersect_default.rect(
|
|
2955
|
+
return updateNodeBounds(o, P), o.intersect = function(e) {
|
|
2956
|
+
return intersect_default.rect(o, e);
|
|
2957
2957
|
}, g;
|
|
2958
2958
|
}
|
|
2959
2959
|
__name(classBox, "classBox");
|
|
2960
|
-
async function requirementBox(
|
|
2961
|
-
let { labelStyles:
|
|
2962
|
-
|
|
2963
|
-
let
|
|
2964
|
-
v =
|
|
2965
|
-
let y = v, b = await addText3(_,
|
|
2966
|
-
if (y += b + 20,
|
|
2967
|
-
let e = await addText3(_, `${
|
|
2960
|
+
async function requirementBox(a, o) {
|
|
2961
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(o);
|
|
2962
|
+
o.labelStyle = s;
|
|
2963
|
+
let u = o, d = o, f = "verifyMethod" in o, p = getNodeClasses(o), { themeVariables: m } = getConfig2(), { borderColorArray: h, requirementEdgeLabelBackground: g } = m, _ = a.insert("g").attr("class", p).attr("id", o.domId ?? o.id), v;
|
|
2964
|
+
v = f ? await addText3(_, `<<${u.type}>>`, 0, o.labelStyle) : await addText3(_, "<<Element>>", 0, o.labelStyle);
|
|
2965
|
+
let y = v, b = await addText3(_, u.name, y, o.labelStyle + "; font-weight: bold;");
|
|
2966
|
+
if (y += b + 20, f) {
|
|
2967
|
+
let e = await addText3(_, `${u.requirementId ? `ID: ${u.requirementId}` : ""}`, y, o.labelStyle);
|
|
2968
2968
|
y += e;
|
|
2969
|
-
let
|
|
2970
|
-
y +=
|
|
2971
|
-
let s = await addText3(_, `${
|
|
2972
|
-
y += s, await addText3(_, `${
|
|
2969
|
+
let a = await addText3(_, `${u.text ? `Text: ${u.text}` : ""}`, y, o.labelStyle);
|
|
2970
|
+
y += a;
|
|
2971
|
+
let s = await addText3(_, `${u.risk ? `Risk: ${u.risk}` : ""}`, y, o.labelStyle);
|
|
2972
|
+
y += s, await addText3(_, `${u.verifyMethod ? `Verification: ${u.verifyMethod}` : ""}`, y, o.labelStyle);
|
|
2973
2973
|
} else {
|
|
2974
|
-
let e = await addText3(_, `${
|
|
2975
|
-
y += e, await addText3(_, `${
|
|
2974
|
+
let e = await addText3(_, `${d.type ? `Type: ${d.type}` : ""}`, y, o.labelStyle);
|
|
2975
|
+
y += e, await addText3(_, `${d.docRef ? `Doc Ref: ${d.docRef}` : ""}`, y, o.labelStyle);
|
|
2976
2976
|
}
|
|
2977
|
-
let x = (_.node()?.getBBox().width ?? 200) + 20, w = (_.node()?.getBBox().height ?? 200) + 20, T = -x / 2, E = -w / 2, D = at.svg(_), A = userNodeOverrides(
|
|
2978
|
-
|
|
2977
|
+
let x = (_.node()?.getBBox().width ?? 200) + 20, w = (_.node()?.getBBox().height ?? 200) + 20, T = -x / 2, E = -w / 2, D = at.svg(_), A = userNodeOverrides(o, {});
|
|
2978
|
+
o.look !== "handDrawn" && (A.roughness = 0, A.fillStyle = "solid");
|
|
2979
2979
|
let j = D.rectangle(T, E, x, w, A), M = _.insert(() => j, ":first-child");
|
|
2980
|
-
if (M.attr("class", "basic label-container outer-path").attr("style",
|
|
2981
|
-
let e =
|
|
2980
|
+
if (M.attr("class", "basic label-container outer-path").attr("style", c), h?.length) {
|
|
2981
|
+
let e = o.colorIndex ?? 0;
|
|
2982
2982
|
_.attr("data-color-id", `color-${e % h.length}`);
|
|
2983
2983
|
}
|
|
2984
|
-
if (_.selectAll(".label").each((
|
|
2985
|
-
let
|
|
2986
|
-
if (
|
|
2987
|
-
let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(
|
|
2988
|
-
e && (
|
|
2984
|
+
if (_.selectAll(".label").each((a, o, s) => {
|
|
2985
|
+
let c = select_default(s[o]), l = c.attr("transform"), u = 0, d = 0;
|
|
2986
|
+
if (l) {
|
|
2987
|
+
let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(l);
|
|
2988
|
+
e && (u = parseFloat(e[1]), d = parseFloat(e[2]));
|
|
2989
2989
|
}
|
|
2990
|
-
let
|
|
2991
|
-
(
|
|
2990
|
+
let f = d - w / 2, p = T + 20 / 2;
|
|
2991
|
+
(o === 0 || o === 1) && (p = u), c.attr("transform", `translate(${p}, ${f + 20})`);
|
|
2992
2992
|
}), y > v + b + 20) {
|
|
2993
|
-
let e = E + v + b + 20,
|
|
2994
|
-
if (
|
|
2995
|
-
let
|
|
2993
|
+
let e = E + v + b + 20, a;
|
|
2994
|
+
if (o.look === "neo") {
|
|
2995
|
+
let o = .001, s = [
|
|
2996
2996
|
[T, e],
|
|
2997
2997
|
[T + x, e],
|
|
2998
|
-
[T + x, e +
|
|
2999
|
-
[T, e +
|
|
2998
|
+
[T + x, e + o],
|
|
2999
|
+
[T, e + o]
|
|
3000
3000
|
];
|
|
3001
|
-
|
|
3002
|
-
} else
|
|
3003
|
-
_.insert(() =>
|
|
3001
|
+
a = D.polygon(s, A);
|
|
3002
|
+
} else a = D.line(T, e, T + x, e, A);
|
|
3003
|
+
_.insert(() => a).attr("class", "divider");
|
|
3004
3004
|
}
|
|
3005
|
-
return updateNodeBounds(
|
|
3006
|
-
return intersect_default.rect(
|
|
3007
|
-
},
|
|
3005
|
+
return updateNodeBounds(o, M), o.intersect = function(e) {
|
|
3006
|
+
return intersect_default.rect(o, e);
|
|
3007
|
+
}, c && o.look !== "handDrawn" && (g || h?.length) && _.selectAll("path").attr("style", c), _;
|
|
3008
3008
|
}
|
|
3009
3009
|
__name(requirementBox, "requirementBox");
|
|
3010
|
-
async function addText3(
|
|
3011
|
-
if (
|
|
3012
|
-
let
|
|
3013
|
-
width: calculateTextWidth(
|
|
3010
|
+
async function addText3(a, o, s, c = "") {
|
|
3011
|
+
if (o === "") return 0;
|
|
3012
|
+
let u = a.insert("g").attr("class", "label").attr("style", c), d = getConfig2(), f = d.htmlLabels ?? !0, p = await createText(u, sanitizeText3(decodeEntities(o)), {
|
|
3013
|
+
width: calculateTextWidth(o, d) + 50,
|
|
3014
3014
|
classes: "markdown-node-label",
|
|
3015
|
-
useHtmlLabels:
|
|
3016
|
-
style:
|
|
3017
|
-
},
|
|
3018
|
-
if (
|
|
3019
|
-
let
|
|
3020
|
-
_ =
|
|
3015
|
+
useHtmlLabels: f,
|
|
3016
|
+
style: c
|
|
3017
|
+
}, d), _;
|
|
3018
|
+
if (f) {
|
|
3019
|
+
let a = p.children[0], o = select_default(p);
|
|
3020
|
+
_ = a.getBoundingClientRect(), o.attr("width", _.width), o.attr("height", _.height);
|
|
3021
3021
|
} else {
|
|
3022
|
-
let e =
|
|
3023
|
-
for (let a of e.children)
|
|
3024
|
-
_ =
|
|
3022
|
+
let e = p.children[0];
|
|
3023
|
+
for (let a of e.children) c && a.setAttribute("style", c);
|
|
3024
|
+
_ = p.getBBox(), _.height += 6;
|
|
3025
3025
|
}
|
|
3026
|
-
return
|
|
3026
|
+
return u.attr("transform", `translate(${-_.width / 2},${-_.height / 2 + s})`), _.height;
|
|
3027
3027
|
}
|
|
3028
3028
|
__name(addText3, "addText");
|
|
3029
3029
|
var colorFromPriority = /* @__PURE__ */ __name((e) => {
|
|
@@ -3072,10 +3072,10 @@ async function kanbanItem(e, a, { config: o }) {
|
|
|
3072
3072
|
}, u;
|
|
3073
3073
|
}
|
|
3074
3074
|
__name(kanbanItem, "kanbanItem");
|
|
3075
|
-
async function bang(e,
|
|
3076
|
-
let { labelStyles: s, nodeStyles: c } = styles2String(
|
|
3077
|
-
|
|
3078
|
-
let { shapeSvg: l, bbox: u, halfPadding: d, label: f } = await labelHelper(e,
|
|
3075
|
+
async function bang(e, a) {
|
|
3076
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(a);
|
|
3077
|
+
a.labelStyle = s;
|
|
3078
|
+
let { shapeSvg: l, bbox: u, halfPadding: d, label: f } = await labelHelper(e, a, getNodeClasses(a)), p = u.width + 10 * d, m = u.height + 8 * d, h = .15 * p, { cssStyles: g } = a, v = u.width + 20, y = u.height + 20, b = Math.max(p, v), x = Math.max(m, y);
|
|
3079
3079
|
f.attr("transform", `translate(${-u.width / 2}, ${-u.height / 2})`);
|
|
3080
3080
|
let w, T = `M0 0
|
|
3081
3081
|
a${h},${h} 1 0,0 ${b * .25},${-1 * x * .1}
|
|
@@ -3096,21 +3096,21 @@ async function bang(e, o) {
|
|
|
3096
3096
|
a${h * .8},${h * .8} 1 0,0 0,${-1 * x * .34}
|
|
3097
3097
|
a${h},${h} 1 0,0 ${b * .1},${-1 * x * .33}
|
|
3098
3098
|
H0 V0 Z`;
|
|
3099
|
-
if (
|
|
3100
|
-
let e = at.svg(l),
|
|
3099
|
+
if (a.look === "handDrawn") {
|
|
3100
|
+
let e = at.svg(l), o = userNodeOverrides(a, {}), s = e.path(T, o);
|
|
3101
3101
|
w = l.insert(() => s, ":first-child"), w.attr("class", "basic label-container").attr("style", handleUndefinedAttr(g));
|
|
3102
3102
|
} else w = l.insert("path", ":first-child").attr("class", "basic label-container").attr("style", c).attr("d", T);
|
|
3103
|
-
return w.attr("transform", `translate(${-b / 2}, ${-x / 2})`), updateNodeBounds(
|
|
3103
|
+
return w.attr("transform", `translate(${-b / 2}, ${-x / 2})`), updateNodeBounds(a, w), a.calcIntersect = function(e, a) {
|
|
3104
3104
|
return intersect_default.rect(e, a);
|
|
3105
|
-
},
|
|
3106
|
-
return log.info("Bang intersect",
|
|
3105
|
+
}, a.intersect = function(e) {
|
|
3106
|
+
return log.info("Bang intersect", a, e), intersect_default.rect(a, e);
|
|
3107
3107
|
}, l;
|
|
3108
3108
|
}
|
|
3109
3109
|
__name(bang, "bang");
|
|
3110
|
-
async function cloud(e,
|
|
3111
|
-
let { labelStyles: s, nodeStyles: c } = styles2String(
|
|
3112
|
-
|
|
3113
|
-
let { shapeSvg: l, bbox: u, halfPadding: d, label: f } = await labelHelper(e,
|
|
3110
|
+
async function cloud(e, a) {
|
|
3111
|
+
let { labelStyles: s, nodeStyles: c } = styles2String(a);
|
|
3112
|
+
a.labelStyle = s;
|
|
3113
|
+
let { shapeSvg: l, bbox: u, halfPadding: d, label: f } = await labelHelper(e, a, getNodeClasses(a)), p = u.width + 2 * d, m = u.height + 2 * d, h = .15 * p, g = .25 * p, v = .35 * p, y = .2 * p, { cssStyles: b } = a, x, w = `M0 0
|
|
3114
3114
|
a${h},${h} 0 0,1 ${p * .25},${-1 * p * .1}
|
|
3115
3115
|
a${v},${v} 1 0,1 ${p * .4},${-1 * p * .1}
|
|
3116
3116
|
a${g},${g} 1 0,1 ${p * .35},${p * .2}
|
|
@@ -3125,14 +3125,14 @@ async function cloud(e, o) {
|
|
|
3125
3125
|
a${h},${h} 1 0,1 ${-1 * p * .1},${-1 * m * .35}
|
|
3126
3126
|
a${y},${y} 1 0,1 ${p * .1},${-1 * m * .65}
|
|
3127
3127
|
H0 V0 Z`;
|
|
3128
|
-
if (
|
|
3129
|
-
let e = at.svg(l),
|
|
3128
|
+
if (a.look === "handDrawn") {
|
|
3129
|
+
let e = at.svg(l), o = userNodeOverrides(a, {}), s = e.path(w, o);
|
|
3130
3130
|
x = l.insert(() => s, ":first-child"), x.attr("class", "basic label-container").attr("style", handleUndefinedAttr(b));
|
|
3131
3131
|
} else x = l.insert("path", ":first-child").attr("class", "basic label-container").attr("style", c).attr("d", w);
|
|
3132
|
-
return f.attr("transform", `translate(${-u.width / 2}, ${-u.height / 2})`), x.attr("transform", `translate(${-p / 2}, ${-m / 2})`), updateNodeBounds(
|
|
3132
|
+
return f.attr("transform", `translate(${-u.width / 2}, ${-u.height / 2})`), x.attr("transform", `translate(${-p / 2}, ${-m / 2})`), updateNodeBounds(a, x), a.calcIntersect = function(e, a) {
|
|
3133
3133
|
return intersect_default.rect(e, a);
|
|
3134
|
-
},
|
|
3135
|
-
return log.info("Cloud intersect",
|
|
3134
|
+
}, a.intersect = function(e) {
|
|
3135
|
+
return log.info("Cloud intersect", a, e), intersect_default.rect(a, e);
|
|
3136
3136
|
}, l;
|
|
3137
3137
|
}
|
|
3138
3138
|
__name(cloud, "cloud");
|
|
@@ -3658,9 +3658,9 @@ var setNodeElem = /* @__PURE__ */ __name((e, a) => {
|
|
|
3658
3658
|
}, "setNodeElem"), clear2 = /* @__PURE__ */ __name(() => {
|
|
3659
3659
|
nodeElems.clear();
|
|
3660
3660
|
}, "clear"), positionNode = /* @__PURE__ */ __name((e) => {
|
|
3661
|
-
let
|
|
3661
|
+
let a = nodeElems.get(e.id);
|
|
3662
3662
|
log.trace("Transforming node", e.diff, e, "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")");
|
|
3663
3663
|
let s = e.diff || 0;
|
|
3664
|
-
return e.clusterNode ?
|
|
3664
|
+
return e.clusterNode ? a.attr("transform", "translate(" + (e.x + s - e.width / 2) + ", " + (e.y - e.height / 2 - 8) + ")") : a.attr("transform", "translate(" + e.x + ", " + e.y + ")"), s;
|
|
3665
3665
|
}, "positionNode");
|
|
3666
3666
|
export { clear, clear2, createLabel_default, insertCluster, insertNode, isValidShape, labelHelper, positionNode, setNodeElem, updateNodeBounds };
|