@legionworks/facet 1.9.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/LICENSE-APACHE +202 -0
- package/LICENSE-MIT +23 -0
- package/README.md +158 -0
- package/dist/gallery/chunk-4g8rem85.css +656 -0
- package/dist/gallery/chunk-c6s9k9ty.js +5970 -0
- package/dist/gallery/frame/artifact.css +8424 -0
- package/dist/gallery/frame/chunks/abnfDiagram-N423BO3Z-jj74szbm.js +155 -0
- package/dist/gallery/frame/chunks/architecture-TIHT7OUA-cvdjn7dt.js +10 -0
- package/dist/gallery/frame/chunks/architectureDiagram-T3A2C74G-n4z77eg6.js +8675 -0
- package/dist/gallery/frame/chunks/blockDiagram-VBNYF7ZC-7xsqzrd1.js +3529 -0
- package/dist/gallery/frame/chunks/c4Diagram-5PPSVZJV-z2zjs7wx.js +2413 -0
- package/dist/gallery/frame/chunks/classDiagram-JCYQIIEL-ve8rngqp.js +47 -0
- package/dist/gallery/frame/chunks/classDiagram-v2-OCEON4UE-8cfaxb8z.js +47 -0
- package/dist/gallery/frame/chunks/cose-bilkent-JH36ORCC-sn92qexx.js +4822 -0
- package/dist/gallery/frame/chunks/cynefin-VYW2F7L2-tqjv913d.js +10 -0
- package/dist/gallery/frame/chunks/cynefinDiagram-MW4NZA55-c1c0dj12.js +500 -0
- package/dist/gallery/frame/chunks/dagre-VZM6K2ZE-7tyg4yt2.js +476 -0
- package/dist/gallery/frame/chunks/diagram-7IWD3JNH-y4eng9sc.js +526 -0
- package/dist/gallery/frame/chunks/diagram-B4RE2ZJO-rn3p7j5h.js +673 -0
- package/dist/gallery/frame/chunks/diagram-LBJQPF4R-w4a2cm9q.js +255 -0
- package/dist/gallery/frame/chunks/diagram-Q27KOJAE-aqc2v7wy.js +575 -0
- package/dist/gallery/frame/chunks/diagram-UB23O5K3-xncy8nyd.js +355 -0
- package/dist/gallery/frame/chunks/ebnfDiagram-BXEA7PRR-acwgxz16.js +175 -0
- package/dist/gallery/frame/chunks/erDiagram-JOGREHBK-mzp5nswt.js +1332 -0
- package/dist/gallery/frame/chunks/eventmodeling-45OFAUF4-sg07qr0c.js +10 -0
- package/dist/gallery/frame/chunks/flowDiagram-UKHOOZJN-2e5ygs44.js +29 -0
- package/dist/gallery/frame/chunks/ganttDiagram-PKOTCBZU-p2hhh7hr.js +2620 -0
- package/dist/gallery/frame/chunks/gitGraph-TEB2WS4Q-j6kw0naa.js +10 -0
- package/dist/gallery/frame/chunks/gitGraphDiagram-DS77QQ5N-4z9z8wjm.js +1347 -0
- package/dist/gallery/frame/chunks/info-DKCQHKI2-mpt80jd3.js +10 -0
- package/dist/gallery/frame/chunks/infoDiagram-6WML65LV-5rqm3mgg.js +65 -0
- package/dist/gallery/frame/chunks/ishikawaDiagram-WSZJBQD7-b51z96jy.js +975 -0
- package/dist/gallery/frame/chunks/journeyDiagram-NVQOT4AX-9jbfp0pk.js +1272 -0
- package/dist/gallery/frame/chunks/kanban-definition-27J2QSJJ-4x0vx4se.js +1116 -0
- package/dist/gallery/frame/chunks/katex-xfgk95tv.js +14034 -0
- package/dist/gallery/frame/chunks/markdown-1s5vwkf2.js +9 -0
- package/dist/gallery/frame/chunks/markdown-2h6bwsms.js +3239 -0
- package/dist/gallery/frame/chunks/markdown-2x113yh8.js +107 -0
- package/dist/gallery/frame/chunks/markdown-30b7rwmp.js +1943 -0
- package/dist/gallery/frame/chunks/markdown-356bfj4g.js +2031 -0
- package/dist/gallery/frame/chunks/markdown-44n9ea69.js +2406 -0
- package/dist/gallery/frame/chunks/markdown-56enrf2r.js +39 -0
- package/dist/gallery/frame/chunks/markdown-5avymm8t.js +725 -0
- package/dist/gallery/frame/chunks/markdown-6r4svars.js +33 -0
- package/dist/gallery/frame/chunks/markdown-6zz8efx2.js +24 -0
- package/dist/gallery/frame/chunks/markdown-7jp6prnb.js +19 -0
- package/dist/gallery/frame/chunks/markdown-809k7q41.js +55 -0
- package/dist/gallery/frame/chunks/markdown-82xmzhzd.js +1076 -0
- package/dist/gallery/frame/chunks/markdown-92n37gd4.js +7627 -0
- package/dist/gallery/frame/chunks/markdown-ag2sssf8.js +36 -0
- package/dist/gallery/frame/chunks/markdown-b4s7ntq2.js +19 -0
- package/dist/gallery/frame/chunks/markdown-c9k0fvp1.js +100 -0
- package/dist/gallery/frame/chunks/markdown-ceefymn8.js +125 -0
- package/dist/gallery/frame/chunks/markdown-d1wfbs70.js +243 -0
- package/dist/gallery/frame/chunks/markdown-dy5sgjhc.js +11022 -0
- package/dist/gallery/frame/chunks/markdown-dz3z5w30.js +30868 -0
- package/dist/gallery/frame/chunks/markdown-eg6ngz7y.js +30340 -0
- package/dist/gallery/frame/chunks/markdown-ff5wvb43.js +1149 -0
- package/dist/gallery/frame/chunks/markdown-ffg06nfz.js +86 -0
- package/dist/gallery/frame/chunks/markdown-fvfncadf.js +472 -0
- package/dist/gallery/frame/chunks/markdown-gvyszqpv.js +19 -0
- package/dist/gallery/frame/chunks/markdown-gx1p0ew0.js +88 -0
- package/dist/gallery/frame/chunks/markdown-gxye5frz.js +65 -0
- package/dist/gallery/frame/chunks/markdown-h7pzv34e.js +105 -0
- package/dist/gallery/frame/chunks/markdown-hab789t9.js +47 -0
- package/dist/gallery/frame/chunks/markdown-hjp6sj8t.js +125 -0
- package/dist/gallery/frame/chunks/markdown-jka64qgp.js +1993 -0
- package/dist/gallery/frame/chunks/markdown-k8xkn8mw.js +56 -0
- package/dist/gallery/frame/chunks/markdown-m7frq8x8.js +112 -0
- package/dist/gallery/frame/chunks/markdown-p740v4qm.js +36 -0
- package/dist/gallery/frame/chunks/markdown-pxfeh231.js +57 -0
- package/dist/gallery/frame/chunks/markdown-pzgd8z3s.js +87 -0
- package/dist/gallery/frame/chunks/markdown-qx3cngz2.js +1673 -0
- package/dist/gallery/frame/chunks/markdown-rawhfvvc.js +85 -0
- package/dist/gallery/frame/chunks/markdown-rd8w0ng9.js +49 -0
- package/dist/gallery/frame/chunks/markdown-rm2yxfjj.js +2773 -0
- package/dist/gallery/frame/chunks/markdown-s1jatrnk.js +993 -0
- package/dist/gallery/frame/chunks/markdown-sgfg5vvq.js +59 -0
- package/dist/gallery/frame/chunks/markdown-t4ethv9d.js +409 -0
- package/dist/gallery/frame/chunks/markdown-tnmabqvz.js +36 -0
- package/dist/gallery/frame/chunks/markdown-tvdpppw8.js +5292 -0
- package/dist/gallery/frame/chunks/markdown-v0x27twr.js +22 -0
- package/dist/gallery/frame/chunks/markdown-v14td68x.js +36 -0
- package/dist/gallery/frame/chunks/markdown-w6sgd54z.js +36 -0
- package/dist/gallery/frame/chunks/markdown-xw8dsk8b.js +2125 -0
- package/dist/gallery/frame/chunks/markdown-y18mve73.js +85 -0
- package/dist/gallery/frame/chunks/markdown-yengsms5.js +427 -0
- package/dist/gallery/frame/chunks/markdown-z1wc0v0d.js +1826 -0
- package/dist/gallery/frame/chunks/markdown-zazx9h4n.js +329 -0
- package/dist/gallery/frame/chunks/mermaid-de7p4v0x.js +30 -0
- package/dist/gallery/frame/chunks/mindmap-definition-FAOFIHXS-ra44cbem.js +1216 -0
- package/dist/gallery/frame/chunks/packet-7NZHBO7P-xppm5913.js +10 -0
- package/dist/gallery/frame/chunks/pegDiagram-VL7TDLO6-a2a4wg03.js +163 -0
- package/dist/gallery/frame/chunks/pie-RZYD4A2V-hnbxk152.js +10 -0
- package/dist/gallery/frame/chunks/pieDiagram-7S7Q4E2Y-f1vxjtmx.js +311 -0
- package/dist/gallery/frame/chunks/quadrantDiagram-CIZ2JOQS-ywafa6kh.js +1390 -0
- package/dist/gallery/frame/chunks/radar-I7S5WNFK-ewqd27se.js +10 -0
- package/dist/gallery/frame/chunks/railroad-3IZDKUUU-5hy4bdx3.js +10 -0
- package/dist/gallery/frame/chunks/railroad-abnf-AHOZXSZD-bh5sxz0d.js +10 -0
- package/dist/gallery/frame/chunks/railroad-ebnf-EBAXGLYW-6b9c3zeh.js +10 -0
- package/dist/gallery/frame/chunks/railroad-peg-LSFZ7HO6-avc8v39s.js +10 -0
- package/dist/gallery/frame/chunks/railroadDiagram-AXF67PYL-qc61wax4.js +131 -0
- package/dist/gallery/frame/chunks/requirementDiagram-LRYGKXZP-9bs4786c.js +1295 -0
- package/dist/gallery/frame/chunks/sankeyDiagram-W5VNT64P-awt1em8b.js +1339 -0
- package/dist/gallery/frame/chunks/sequenceDiagram-SI44F4Z6-qaf9mz3t.js +4324 -0
- package/dist/gallery/frame/chunks/sizeCapture-X5ZJPWSS-9fq685xd.js +64 -0
- package/dist/gallery/frame/chunks/stateDiagram-OKZ733FA-vx7a7hh0.js +456 -0
- package/dist/gallery/frame/chunks/stateDiagram-v2-UEYNNEHI-x4m6ws5t.js +46 -0
- package/dist/gallery/frame/chunks/swimlanes-SLNWSIFB-e4mxm1gh.js +8287 -0
- package/dist/gallery/frame/chunks/swimlanesDiagram-ULZ7WXOC-0h93e2qq.js +42 -0
- package/dist/gallery/frame/chunks/timeline-definition-Z64GVDOM-wp0bhbzg.js +1549 -0
- package/dist/gallery/frame/chunks/treeView-QDETBFTQ-hcx7n0vt.js +10 -0
- package/dist/gallery/frame/chunks/treemap-6X3UGDF4-av02skdw.js +10 -0
- package/dist/gallery/frame/chunks/vennDiagram-T6HMQDX7-pmvk1p7n.js +2566 -0
- package/dist/gallery/frame/chunks/wardley-OPB4EBWU-njsp6e40.js +10 -0
- package/dist/gallery/frame/chunks/wardleyDiagram-T6FBY63Y-eggmnv4z.js +979 -0
- package/dist/gallery/frame/chunks/xychartDiagram-ELKLHX3M-q40tnpe5.js +1954 -0
- package/dist/gallery/frame/frame.css +183 -0
- package/dist/gallery/frame/runtime/chart.js +42744 -0
- package/dist/gallery/frame/runtime/html.js +14 -0
- package/dist/gallery/frame/runtime/markdown.js +1403 -0
- package/dist/gallery/frame/runtime/mermaid.js +32 -0
- package/dist/gallery/frame/runtime/svg.js +14 -0
- package/dist/gallery/frame/runtime/tsx.js +52 -0
- package/dist/gallery/index.html +104 -0
- package/docs/reference/cli.md +163 -0
- package/docs/reference/export.md +106 -0
- package/docs/reference/html.md +215 -0
- package/docs/reference/http.md +85 -0
- package/docs/reference/mcp.md +78 -0
- package/docs/reference/security.md +119 -0
- package/docs/reference/storage.md +93 -0
- package/docs/reference/tsx.md +101 -0
- package/docs/reference/validation.md +212 -0
- package/package.json +89 -0
- package/scripts/build-gallery.ts +127 -0
- package/scripts/launch-netns.sh +67 -0
- package/skills/facet/SKILL.md +100 -0
- package/src/cli/client.ts +311 -0
- package/src/cli/commands/create.ts +49 -0
- package/src/cli/commands/doctor.ts +249 -0
- package/src/cli/commands/export.ts +179 -0
- package/src/cli/commands/instantiate.ts +35 -0
- package/src/cli/commands/list.ts +49 -0
- package/src/cli/commands/open.ts +75 -0
- package/src/cli/commands/pin.ts +39 -0
- package/src/cli/commands/promote.ts +49 -0
- package/src/cli/commands/publish.ts +122 -0
- package/src/cli/commands/read-back.ts +56 -0
- package/src/cli/commands/status.ts +114 -0
- package/src/cli/commands/watch.ts +146 -0
- package/src/cli/main.ts +522 -0
- package/src/cli/output.ts +106 -0
- package/src/cli/parser.ts +376 -0
- package/src/cli/presenter.ts +212 -0
- package/src/cli/service-metadata.ts +134 -0
- package/src/cli/spawn-service.ts +326 -0
- package/src/css.d.ts +4 -0
- package/src/gallery-web/app.ts +1581 -0
- package/src/gallery-web/export-menu.ts +121 -0
- package/src/gallery-web/export.ts +112 -0
- package/src/gallery-web/favicon.ts +54 -0
- package/src/gallery-web/frame/entries/chart.ts +6 -0
- package/src/gallery-web/frame/entries/html.ts +6 -0
- package/src/gallery-web/frame/entries/markdown.ts +6 -0
- package/src/gallery-web/frame/entries/mermaid.ts +6 -0
- package/src/gallery-web/frame/entries/svg.ts +6 -0
- package/src/gallery-web/frame/entries/tsx.ts +6 -0
- package/src/gallery-web/frame/frame-payload.ts +91 -0
- package/src/gallery-web/frame/renderer-validation.ts +13 -0
- package/src/gallery-web/frame/renderers/chart.ts +182 -0
- package/src/gallery-web/frame/renderers/dompurify-shim.ts +112 -0
- package/src/gallery-web/frame/renderers/html.ts +48 -0
- package/src/gallery-web/frame/renderers/markdown.ts +81 -0
- package/src/gallery-web/frame/renderers/mermaid.ts +120 -0
- package/src/gallery-web/frame/renderers/registry.ts +260 -0
- package/src/gallery-web/frame/renderers/svg.ts +393 -0
- package/src/gallery-web/frame/renderers/tsx.ts +61 -0
- package/src/gallery-web/frame/runtime.ts +501 -0
- package/src/gallery-web/frame/styles/artifact.css +8424 -0
- package/src/gallery-web/frame/styles/frame.css +183 -0
- package/src/gallery-web/frame/styles/html-source.css +23 -0
- package/src/gallery-web/frame/view-box.ts +33 -0
- package/src/gallery-web/frame-html.ts +72 -0
- package/src/gallery-web/index.html +104 -0
- package/src/gallery-web/session.ts +107 -0
- package/src/gallery-web/sse-client.ts +212 -0
- package/src/gallery-web/styles/app.css +420 -0
- package/src/gallery-web/styles/tokens.css +112 -0
- package/src/gallery-web/styles/verdict.css +186 -0
- package/src/gallery-web/swap.ts +64 -0
- package/src/gallery-web/theme.ts +40 -0
- package/src/gallery-web/view-state.ts +93 -0
- package/src/harness-adapters/claude-code/README.md +10 -0
- package/src/harness-adapters/claude-code/facet.sh +4 -0
- package/src/harness-adapters/codex/README.md +10 -0
- package/src/harness-adapters/codex/facet.sh +4 -0
- package/src/harness-adapters/mcp/README.md +13 -0
- package/src/harness-adapters/mcp/cli-bridge.ts +216 -0
- package/src/harness-adapters/mcp/main.ts +15 -0
- package/src/harness-adapters/mcp/server.ts +164 -0
- package/src/harness-adapters/mcp/tool-schemas.ts +53 -0
- package/src/harness-adapters/opencode/README.md +10 -0
- package/src/harness-adapters/opencode/facet.sh +4 -0
- package/src/runtime/compiled-entrypoints.ts +69 -0
- package/src/service/dispatcher.ts +717 -0
- package/src/service/export.ts +218 -0
- package/src/service/http-utils.ts +55 -0
- package/src/service/lexical/expectations.ts +210 -0
- package/src/service/lifecycle/idle-controller.ts +125 -0
- package/src/service/lifecycle/orphan-cleanup.ts +128 -0
- package/src/service/lifecycle/process-lock.ts +235 -0
- package/src/service/main.ts +136 -0
- package/src/service/process.ts +240 -0
- package/src/service/router-guards.ts +239 -0
- package/src/service/router.ts +627 -0
- package/src/service/security/auth.ts +168 -0
- package/src/service/security/host-origin.ts +138 -0
- package/src/service/security/http-guards.ts +13 -0
- package/src/service/security/leases.ts +182 -0
- package/src/service/security/token-store.ts +138 -0
- package/src/service/server.ts +356 -0
- package/src/service/store/database.ts +61 -0
- package/src/service/store/evidence-retention.ts +234 -0
- package/src/service/store/migrations.ts +167 -0
- package/src/service/store/repository-lifecycle.ts +121 -0
- package/src/service/store/repository.ts +732 -0
- package/src/service/store/schema.ts +218 -0
- package/src/service/stored-verdict.ts +97 -0
- package/src/service/stream.ts +301 -0
- package/src/service/verdict-enrichment.ts +45 -0
- package/src/shared/build/frame-bundle-plugins.ts +61 -0
- package/src/shared/build-mode.ts +28 -0
- package/src/shared/config/evidence-read.ts +98 -0
- package/src/shared/config/limits.ts +56 -0
- package/src/shared/config/paths.ts +96 -0
- package/src/shared/contracts/artifact-types.ts +2 -0
- package/src/shared/contracts/artifact.ts +98 -0
- package/src/shared/contracts/commands/_shared.ts +59 -0
- package/src/shared/contracts/commands/guards.ts +86 -0
- package/src/shared/contracts/commands/index.ts +204 -0
- package/src/shared/contracts/commands/names.ts +35 -0
- package/src/shared/contracts/commands/requests.ts +149 -0
- package/src/shared/contracts/commands/results.ts +200 -0
- package/src/shared/contracts/envelope.ts +140 -0
- package/src/shared/contracts/events.ts +41 -0
- package/src/shared/contracts/observed-counts.ts +19 -0
- package/src/shared/contracts/renderers.ts +6 -0
- package/src/shared/contracts/validation.ts +296 -0
- package/src/shared/errors/facet-error.ts +127 -0
- package/src/shared/errors/store-error.ts +68 -0
- package/src/shared/evidence-image.ts +37 -0
- package/src/shared/export.ts +31 -0
- package/src/shared/html/policy.ts +108 -0
- package/src/shared/html/style-vocabulary.ts +352 -0
- package/src/shared/logging/logger.ts +108 -0
- package/src/shared/logging/redact.ts +49 -0
- package/src/shared/security/frozen-csp.ts +13 -0
- package/src/shared/storage-version.ts +2 -0
- package/src/shared/tsx/execution.ts +29 -0
- package/src/shared/tsx/import-policy.ts +94 -0
- package/src/shared/util/dir-permissions.ts +94 -0
- package/src/shared/util/mermaid-nodes.ts +230 -0
- package/src/shared/util/process.ts +67 -0
- package/src/shared/util/time.ts +21 -0
- package/src/shared/version.ts +3 -0
- package/src/validation/sandbox/limits.ts +41 -0
- package/src/validation/sandbox/netns.ts +177 -0
- package/src/validation/tier0/chart.ts +177 -0
- package/src/validation/tier0/dom-shim.ts +54 -0
- package/src/validation/tier0/html.ts +408 -0
- package/src/validation/tier0/markdown.ts +285 -0
- package/src/validation/tier0/mermaid.ts +98 -0
- package/src/validation/tier0/runner.ts +504 -0
- package/src/validation/tier0/svg.ts +321 -0
- package/src/validation/tier0/tsx/allowlist-resolver.ts +77 -0
- package/src/validation/tier0/tsx/ast-policy-capabilities.ts +238 -0
- package/src/validation/tier0/tsx/ast-policy-shared.ts +71 -0
- package/src/validation/tier0/tsx/ast-policy.ts +181 -0
- package/src/validation/tier0/tsx/compiler.ts +156 -0
- package/src/validation/tier0/worker-dispatch.ts +211 -0
- package/src/validation/tier0/worker-entry.ts +96 -0
- package/src/validation/tier0/worker-input.ts +75 -0
- package/src/validation/tier1/browser-process.ts +147 -0
- package/src/validation/tier1/cdp-pipe.ts +281 -0
- package/src/validation/tier1/entries/chart.ts +5 -0
- package/src/validation/tier1/entries/html.ts +6 -0
- package/src/validation/tier1/entries/markdown.ts +5 -0
- package/src/validation/tier1/entries/mermaid.ts +5 -0
- package/src/validation/tier1/entries/svg.ts +5 -0
- package/src/validation/tier1/entries/tsx.ts +5 -0
- package/src/validation/tier1/frame-target.ts +162 -0
- package/src/validation/tier1/harness-entry.ts +261 -0
- package/src/validation/tier1/harness.ts +215 -0
- package/src/validation/tier1/isolated-probe.ts +94 -0
- package/src/validation/tier1/launcher.ts +177 -0
- package/src/validation/tier1/limits.ts +80 -0
- package/src/validation/tier1/nonce.ts +17 -0
- package/src/validation/tier1/protocol-probe.ts +519 -0
- package/src/validation/tier1/runner.ts +1122 -0
- package/src/validation/tier1/verdict.ts +246 -0
- package/src/validation/tier1/webp.ts +69 -0
- package/templates/README.md +88 -0
- package/templates/bar-compare.vl.json +63 -0
- package/templates/capacity-report.tsx +102 -0
- package/templates/decision-record.md +24 -0
- package/templates/deployment-state.mmd +40 -0
- package/templates/exemplar.md +91 -0
- package/templates/facet-story.tsx +799 -0
- package/templates/fleet-dashboard.html +141 -0
- package/templates/html-release-ledger.html +91 -0
- package/templates/html-status-report.html +114 -0
- package/templates/incident-console.tsx +147 -0
- package/templates/legion-boundaries.mmd +23 -0
- package/templates/legion-flow.mmd +15 -0
- package/templates/legion-sequence.mmd +14 -0
- package/templates/legion-state.mmd +7 -0
- package/templates/metric-card.svg +29 -0
- package/templates/observability-map.svg +101 -0
- package/templates/pipeline-audit.md +108 -0
- package/templates/release-metrics.vl.json +98 -0
- package/templates/service-topology.mmd +47 -0
- package/templates/status-report.md +32 -0
- package/templates/system-map.svg +53 -0
- package/templates/timeseries.vl.json +71 -0
- package/templates/tsx-interactive-counter.tsx +19 -0
- package/templates/tsx-status-report.tsx +31 -0
|
@@ -0,0 +1,993 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computeLabelTransform,
|
|
3
|
+
getLineFunctionsWithOffset,
|
|
4
|
+
markerOffsets,
|
|
5
|
+
markerOffsets2
|
|
6
|
+
} from "./markdown-m7frq8x8.js";
|
|
7
|
+
import {
|
|
8
|
+
createLabel_default
|
|
9
|
+
} from "./markdown-tvdpppw8.js";
|
|
10
|
+
import {
|
|
11
|
+
getSubGraphTitleMargins
|
|
12
|
+
} from "./markdown-sgfg5vvq.js";
|
|
13
|
+
import {
|
|
14
|
+
at
|
|
15
|
+
} from "./markdown-82xmzhzd.js";
|
|
16
|
+
import {
|
|
17
|
+
isLabelStyle,
|
|
18
|
+
styles2String
|
|
19
|
+
} from "./markdown-c9k0fvp1.js";
|
|
20
|
+
import {
|
|
21
|
+
createText
|
|
22
|
+
} from "./markdown-qx3cngz2.js";
|
|
23
|
+
import {
|
|
24
|
+
handleUndefinedAttr,
|
|
25
|
+
utils_default
|
|
26
|
+
} from "./markdown-ff5wvb43.js";
|
|
27
|
+
import {
|
|
28
|
+
getConfig,
|
|
29
|
+
getConfig2,
|
|
30
|
+
getEffectiveHtmlLabels
|
|
31
|
+
} from "./markdown-92n37gd4.js";
|
|
32
|
+
import {
|
|
33
|
+
log,
|
|
34
|
+
select_default
|
|
35
|
+
} from "./markdown-xw8dsk8b.js";
|
|
36
|
+
import {
|
|
37
|
+
__name
|
|
38
|
+
} from "./markdown-1s5vwkf2.js";
|
|
39
|
+
import {
|
|
40
|
+
basis_default,
|
|
41
|
+
bumpX,
|
|
42
|
+
bumpY,
|
|
43
|
+
cardinal_default,
|
|
44
|
+
catmullRom_default,
|
|
45
|
+
line_default,
|
|
46
|
+
linear_default,
|
|
47
|
+
monotoneX,
|
|
48
|
+
monotoneY,
|
|
49
|
+
natural_default,
|
|
50
|
+
stepAfter,
|
|
51
|
+
stepBefore,
|
|
52
|
+
step_default
|
|
53
|
+
} from "./markdown-dy5sgjhc.js";
|
|
54
|
+
|
|
55
|
+
// node_modules/mermaid/dist/chunks/mermaid.core/chunk-7Z6QIM7H.mjs
|
|
56
|
+
var addEdgeMarkers = /* @__PURE__ */ __name((svgPath, edge, url, id, diagramType, useMargin = false, strokeColor) => {
|
|
57
|
+
if (edge.arrowTypeStart) {
|
|
58
|
+
addEdgeMarker(svgPath, "start", edge.arrowTypeStart, url, id, diagramType, useMargin, strokeColor);
|
|
59
|
+
}
|
|
60
|
+
if (edge.arrowTypeEnd) {
|
|
61
|
+
addEdgeMarker(svgPath, "end", edge.arrowTypeEnd, url, id, diagramType, useMargin, strokeColor);
|
|
62
|
+
}
|
|
63
|
+
}, "addEdgeMarkers");
|
|
64
|
+
var arrowTypesMap = {
|
|
65
|
+
arrow_cross: { type: "cross", fill: false },
|
|
66
|
+
arrow_point: { type: "point", fill: true },
|
|
67
|
+
arrow_barb: { type: "barb", fill: true },
|
|
68
|
+
arrow_barb_neo: { type: "barb", fill: true },
|
|
69
|
+
arrow_circle: { type: "circle", fill: false },
|
|
70
|
+
aggregation: { type: "aggregation", fill: false },
|
|
71
|
+
extension: { type: "extension", fill: false },
|
|
72
|
+
composition: { type: "composition", fill: true },
|
|
73
|
+
dependency: { type: "dependency", fill: true },
|
|
74
|
+
lollipop: { type: "lollipop", fill: false },
|
|
75
|
+
only_one: { type: "onlyOne", fill: false },
|
|
76
|
+
zero_or_one: { type: "zeroOrOne", fill: false },
|
|
77
|
+
one_or_more: { type: "oneOrMore", fill: false },
|
|
78
|
+
zero_or_more: { type: "zeroOrMore", fill: false },
|
|
79
|
+
requirement_arrow: { type: "requirement_arrow", fill: false },
|
|
80
|
+
requirement_contains: { type: "requirement_contains", fill: false }
|
|
81
|
+
};
|
|
82
|
+
var arrowTypesWithMarginSupport = [
|
|
83
|
+
"cross",
|
|
84
|
+
"point",
|
|
85
|
+
"circle",
|
|
86
|
+
"lollipop",
|
|
87
|
+
"aggregation",
|
|
88
|
+
"extension",
|
|
89
|
+
"composition",
|
|
90
|
+
"dependency",
|
|
91
|
+
"barb"
|
|
92
|
+
];
|
|
93
|
+
var addEdgeMarker = /* @__PURE__ */ __name((svgPath, position, arrowType, url, id, diagramType, useMargin = false, strokeColor) => {
|
|
94
|
+
const arrowTypeInfo = arrowTypesMap[arrowType];
|
|
95
|
+
const marginSupport = arrowTypeInfo && arrowTypesWithMarginSupport.includes(arrowTypeInfo.type);
|
|
96
|
+
if (!arrowTypeInfo) {
|
|
97
|
+
log.warn(`Unknown arrow type: ${arrowType}`);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const endMarkerType = arrowTypeInfo.type;
|
|
101
|
+
const suffix = position === "start" ? "Start" : "End";
|
|
102
|
+
const offset = useMargin && marginSupport ? "-margin" : "";
|
|
103
|
+
const originalMarkerId = `${id}_${diagramType}-${endMarkerType}${suffix}${offset}`;
|
|
104
|
+
if (strokeColor && strokeColor.trim() !== "") {
|
|
105
|
+
const colorId = strokeColor.replace(/[^\dA-Za-z]/g, "_");
|
|
106
|
+
const coloredMarkerId = `${originalMarkerId}_${colorId}`;
|
|
107
|
+
if (!document.getElementById(coloredMarkerId)) {
|
|
108
|
+
const originalMarker = document.getElementById(originalMarkerId);
|
|
109
|
+
if (originalMarker) {
|
|
110
|
+
const coloredMarker = originalMarker.cloneNode(true);
|
|
111
|
+
coloredMarker.id = coloredMarkerId;
|
|
112
|
+
const paths = coloredMarker.querySelectorAll("path, circle, line");
|
|
113
|
+
paths.forEach((path) => {
|
|
114
|
+
path.setAttribute("stroke", strokeColor);
|
|
115
|
+
if (arrowTypeInfo.fill) {
|
|
116
|
+
path.setAttribute("fill", strokeColor);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
originalMarker.parentNode?.appendChild(coloredMarker);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
svgPath.attr(`marker-${position}`, `url(${url}#${coloredMarkerId})`);
|
|
123
|
+
} else {
|
|
124
|
+
svgPath.attr(`marker-${position}`, `url(${url}#${originalMarkerId})`);
|
|
125
|
+
}
|
|
126
|
+
}, "addEdgeMarker");
|
|
127
|
+
var resolveEdgeCurveType = /* @__PURE__ */ __name((edgeCurve) => {
|
|
128
|
+
return typeof edgeCurve === "string" ? edgeCurve : getConfig2()?.flowchart?.curve;
|
|
129
|
+
}, "resolveEdgeCurveType");
|
|
130
|
+
var edgeLabels = /* @__PURE__ */ new Map;
|
|
131
|
+
var terminalLabels = /* @__PURE__ */ new Map;
|
|
132
|
+
var clear = /* @__PURE__ */ __name(() => {
|
|
133
|
+
edgeLabels.clear();
|
|
134
|
+
terminalLabels.clear();
|
|
135
|
+
}, "clear");
|
|
136
|
+
var getLabelStyles = /* @__PURE__ */ __name((styleArray) => {
|
|
137
|
+
if (!styleArray) {
|
|
138
|
+
return "";
|
|
139
|
+
}
|
|
140
|
+
if (typeof styleArray === "string") {
|
|
141
|
+
return styleArray;
|
|
142
|
+
}
|
|
143
|
+
return styleArray.reduce((acc, style) => acc + ";" + style, "");
|
|
144
|
+
}, "getLabelStyles");
|
|
145
|
+
var insertEdgeLabel = /* @__PURE__ */ __name(async (elem, edge) => {
|
|
146
|
+
const config = getConfig2();
|
|
147
|
+
let useHtmlLabels = getEffectiveHtmlLabels(config);
|
|
148
|
+
const { labelStyles } = styles2String(edge);
|
|
149
|
+
edge.labelStyle = labelStyles;
|
|
150
|
+
const edgeLabel = elem.insert("g").attr("class", "edgeLabel");
|
|
151
|
+
const label = edgeLabel.insert("g").attr("class", "label").attr("data-id", edge.id);
|
|
152
|
+
const isMarkdown = edge.labelType === "markdown";
|
|
153
|
+
const markdownWidth = undefined;
|
|
154
|
+
const labelElement = await createText(elem, edge.label, {
|
|
155
|
+
style: getLabelStyles(edge.labelStyle),
|
|
156
|
+
useHtmlLabels,
|
|
157
|
+
addSvgBackground: true,
|
|
158
|
+
isNode: false,
|
|
159
|
+
markdown: isMarkdown,
|
|
160
|
+
width: isMarkdown ? markdownWidth : undefined
|
|
161
|
+
}, config);
|
|
162
|
+
label.node().appendChild(labelElement);
|
|
163
|
+
log.info("abc82", edge, edge.labelType);
|
|
164
|
+
let bbox = labelElement.getBBox();
|
|
165
|
+
let transformBbox = bbox;
|
|
166
|
+
if (useHtmlLabels) {
|
|
167
|
+
const div = labelElement.children[0];
|
|
168
|
+
const dv = select_default(labelElement);
|
|
169
|
+
bbox = div.getBoundingClientRect();
|
|
170
|
+
transformBbox = bbox;
|
|
171
|
+
dv.attr("width", bbox.width);
|
|
172
|
+
dv.attr("height", bbox.height);
|
|
173
|
+
} else {
|
|
174
|
+
const textEl = select_default(labelElement).select("text").node();
|
|
175
|
+
if (textEl && typeof textEl.getBBox === "function") {
|
|
176
|
+
transformBbox = textEl.getBBox();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
label.attr("transform", computeLabelTransform(transformBbox, useHtmlLabels));
|
|
180
|
+
edgeLabels.set(edge.id, edgeLabel);
|
|
181
|
+
edge.width = bbox.width;
|
|
182
|
+
edge.height = bbox.height;
|
|
183
|
+
let fo;
|
|
184
|
+
if (edge.startLabelLeft) {
|
|
185
|
+
const startEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
|
|
186
|
+
const inner = startEdgeLabelLeft.insert("g").attr("class", "inner");
|
|
187
|
+
const startLabelElement = await createLabel_default(inner, edge.startLabelLeft, getLabelStyles(edge.labelStyle) || "", false, false);
|
|
188
|
+
fo = startLabelElement;
|
|
189
|
+
let slBox = startLabelElement.getBBox();
|
|
190
|
+
if (useHtmlLabels) {
|
|
191
|
+
const div = startLabelElement.children[0];
|
|
192
|
+
const dv = select_default(startLabelElement);
|
|
193
|
+
slBox = div.getBoundingClientRect();
|
|
194
|
+
dv.attr("width", slBox.width);
|
|
195
|
+
dv.attr("height", slBox.height);
|
|
196
|
+
}
|
|
197
|
+
inner.attr("transform", computeLabelTransform(slBox, useHtmlLabels));
|
|
198
|
+
if (!terminalLabels.get(edge.id)) {
|
|
199
|
+
terminalLabels.set(edge.id, {});
|
|
200
|
+
}
|
|
201
|
+
terminalLabels.get(edge.id).startLeft = startEdgeLabelLeft;
|
|
202
|
+
setTerminalWidth(fo, edge.startLabelLeft);
|
|
203
|
+
}
|
|
204
|
+
if (edge.startLabelRight) {
|
|
205
|
+
const startEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
|
|
206
|
+
const inner = startEdgeLabelRight.insert("g").attr("class", "inner");
|
|
207
|
+
const startLabelElement = await createLabel_default(inner, edge.startLabelRight, getLabelStyles(edge.labelStyle) || "", false, false);
|
|
208
|
+
fo = startLabelElement;
|
|
209
|
+
let slBox = startLabelElement.getBBox();
|
|
210
|
+
if (useHtmlLabels) {
|
|
211
|
+
const div = startLabelElement.children[0];
|
|
212
|
+
const dv = select_default(startLabelElement);
|
|
213
|
+
slBox = div.getBoundingClientRect();
|
|
214
|
+
dv.attr("width", slBox.width);
|
|
215
|
+
dv.attr("height", slBox.height);
|
|
216
|
+
}
|
|
217
|
+
inner.attr("transform", computeLabelTransform(slBox, useHtmlLabels));
|
|
218
|
+
if (!terminalLabels.get(edge.id)) {
|
|
219
|
+
terminalLabels.set(edge.id, {});
|
|
220
|
+
}
|
|
221
|
+
terminalLabels.get(edge.id).startRight = startEdgeLabelRight;
|
|
222
|
+
setTerminalWidth(fo, edge.startLabelRight);
|
|
223
|
+
}
|
|
224
|
+
if (edge.endLabelLeft) {
|
|
225
|
+
const endEdgeLabelLeft = elem.insert("g").attr("class", "edgeTerminals");
|
|
226
|
+
const inner = endEdgeLabelLeft.insert("g").attr("class", "inner");
|
|
227
|
+
const endLabelElement = await createLabel_default(endEdgeLabelLeft, edge.endLabelLeft, getLabelStyles(edge.labelStyle) || "", false, false);
|
|
228
|
+
fo = endLabelElement;
|
|
229
|
+
let slBox = endLabelElement.getBBox();
|
|
230
|
+
if (useHtmlLabels) {
|
|
231
|
+
const div = endLabelElement.children[0];
|
|
232
|
+
const dv = select_default(endLabelElement);
|
|
233
|
+
slBox = div.getBoundingClientRect();
|
|
234
|
+
dv.attr("width", slBox.width);
|
|
235
|
+
dv.attr("height", slBox.height);
|
|
236
|
+
}
|
|
237
|
+
inner.attr("transform", computeLabelTransform(slBox, useHtmlLabels));
|
|
238
|
+
if (!terminalLabels.get(edge.id)) {
|
|
239
|
+
terminalLabels.set(edge.id, {});
|
|
240
|
+
}
|
|
241
|
+
terminalLabels.get(edge.id).endLeft = endEdgeLabelLeft;
|
|
242
|
+
setTerminalWidth(fo, edge.endLabelLeft);
|
|
243
|
+
}
|
|
244
|
+
if (edge.endLabelRight) {
|
|
245
|
+
const endEdgeLabelRight = elem.insert("g").attr("class", "edgeTerminals");
|
|
246
|
+
const inner = endEdgeLabelRight.insert("g").attr("class", "inner");
|
|
247
|
+
const endLabelElement = await createLabel_default(endEdgeLabelRight, edge.endLabelRight, getLabelStyles(edge.labelStyle) || "", false, false);
|
|
248
|
+
fo = endLabelElement;
|
|
249
|
+
let slBox = endLabelElement.getBBox();
|
|
250
|
+
if (useHtmlLabels) {
|
|
251
|
+
const div = endLabelElement.children[0];
|
|
252
|
+
const dv = select_default(endLabelElement);
|
|
253
|
+
slBox = div.getBoundingClientRect();
|
|
254
|
+
dv.attr("width", slBox.width);
|
|
255
|
+
dv.attr("height", slBox.height);
|
|
256
|
+
}
|
|
257
|
+
inner.attr("transform", computeLabelTransform(slBox, useHtmlLabels));
|
|
258
|
+
if (!terminalLabels.get(edge.id)) {
|
|
259
|
+
terminalLabels.set(edge.id, {});
|
|
260
|
+
}
|
|
261
|
+
terminalLabels.get(edge.id).endRight = endEdgeLabelRight;
|
|
262
|
+
setTerminalWidth(fo, edge.endLabelRight);
|
|
263
|
+
}
|
|
264
|
+
return labelElement;
|
|
265
|
+
}, "insertEdgeLabel");
|
|
266
|
+
function setTerminalWidth(fo, value) {
|
|
267
|
+
if (getEffectiveHtmlLabels(getConfig2()) && fo) {
|
|
268
|
+
fo.style.width = value.length * 9 + "px";
|
|
269
|
+
fo.style.height = "12px";
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
__name(setTerminalWidth, "setTerminalWidth");
|
|
273
|
+
var positionEdgeLabel = /* @__PURE__ */ __name((edge, paths) => {
|
|
274
|
+
log.debug("Moving label abc88 ", edge.id, edge.label, edgeLabels.get(edge.id), paths);
|
|
275
|
+
let path = paths.updatedPath ? paths.updatedPath : paths.originalPath;
|
|
276
|
+
const siteConfig = getConfig2();
|
|
277
|
+
const { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig);
|
|
278
|
+
if (edge.label) {
|
|
279
|
+
const el = edgeLabels.get(edge.id);
|
|
280
|
+
let x = edge.x;
|
|
281
|
+
let y = edge.y;
|
|
282
|
+
if (path) {
|
|
283
|
+
const pos = utils_default.calcLabelPosition(path);
|
|
284
|
+
log.debug("Moving label " + edge.label + " from (", x, ",", y, ") to (", pos.x, ",", pos.y, ") abc88");
|
|
285
|
+
if (paths.updatedPath) {
|
|
286
|
+
x = pos.x;
|
|
287
|
+
y = pos.y;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
el.attr("transform", `translate(${x}, ${y + subGraphTitleTotalMargin / 2})`);
|
|
291
|
+
}
|
|
292
|
+
if (edge.startLabelLeft) {
|
|
293
|
+
const el = terminalLabels.get(edge.id).startLeft;
|
|
294
|
+
let x = edge.x;
|
|
295
|
+
let y = edge.y;
|
|
296
|
+
if (path) {
|
|
297
|
+
const pos = utils_default.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_left", path);
|
|
298
|
+
x = pos.x;
|
|
299
|
+
y = pos.y;
|
|
300
|
+
}
|
|
301
|
+
el.attr("transform", `translate(${x}, ${y})`);
|
|
302
|
+
}
|
|
303
|
+
if (edge.startLabelRight) {
|
|
304
|
+
const el = terminalLabels.get(edge.id).startRight;
|
|
305
|
+
let x = edge.x;
|
|
306
|
+
let y = edge.y;
|
|
307
|
+
if (path) {
|
|
308
|
+
const pos = utils_default.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, "start_right", path);
|
|
309
|
+
x = pos.x;
|
|
310
|
+
y = pos.y;
|
|
311
|
+
}
|
|
312
|
+
el.attr("transform", `translate(${x}, ${y})`);
|
|
313
|
+
}
|
|
314
|
+
if (edge.endLabelLeft) {
|
|
315
|
+
const el = terminalLabels.get(edge.id).endLeft;
|
|
316
|
+
let x = edge.x;
|
|
317
|
+
let y = edge.y;
|
|
318
|
+
if (path) {
|
|
319
|
+
const pos = utils_default.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_left", path);
|
|
320
|
+
x = pos.x;
|
|
321
|
+
y = pos.y;
|
|
322
|
+
}
|
|
323
|
+
el.attr("transform", `translate(${x}, ${y})`);
|
|
324
|
+
}
|
|
325
|
+
if (edge.endLabelRight) {
|
|
326
|
+
const el = terminalLabels.get(edge.id).endRight;
|
|
327
|
+
let x = edge.x;
|
|
328
|
+
let y = edge.y;
|
|
329
|
+
if (path) {
|
|
330
|
+
const pos = utils_default.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, "end_right", path);
|
|
331
|
+
x = pos.x;
|
|
332
|
+
y = pos.y;
|
|
333
|
+
}
|
|
334
|
+
el.attr("transform", `translate(${x}, ${y})`);
|
|
335
|
+
}
|
|
336
|
+
}, "positionEdgeLabel");
|
|
337
|
+
var orthogonalizeToLabelClippedPoints = /* @__PURE__ */ __name((edge, points) => {
|
|
338
|
+
if (!edge?.isLabelEdge || !edge?.id?.endsWith("-to-label") || !Array.isArray(points)) {
|
|
339
|
+
return points;
|
|
340
|
+
}
|
|
341
|
+
if (points.length !== 2) {
|
|
342
|
+
return points;
|
|
343
|
+
}
|
|
344
|
+
const [start, end] = points;
|
|
345
|
+
const dx = Math.abs(end.x - start.x);
|
|
346
|
+
const dy = Math.abs(end.y - start.y);
|
|
347
|
+
if (dx < 0.001 || dy < 0.001) {
|
|
348
|
+
return points;
|
|
349
|
+
}
|
|
350
|
+
if (dy >= dx) {
|
|
351
|
+
return [start, { x: start.x, y: end.y }, end];
|
|
352
|
+
}
|
|
353
|
+
return [start, { x: end.x, y: start.y }, end];
|
|
354
|
+
}, "orthogonalizeToLabelClippedPoints");
|
|
355
|
+
var outsideNode = /* @__PURE__ */ __name((node, point2) => {
|
|
356
|
+
const x = node.x;
|
|
357
|
+
const y = node.y;
|
|
358
|
+
const dx = Math.abs(point2.x - x);
|
|
359
|
+
const dy = Math.abs(point2.y - y);
|
|
360
|
+
const w = node.width / 2;
|
|
361
|
+
const h = node.height / 2;
|
|
362
|
+
return dx >= w || dy >= h;
|
|
363
|
+
}, "outsideNode");
|
|
364
|
+
var intersection = /* @__PURE__ */ __name((node, outsidePoint, insidePoint) => {
|
|
365
|
+
log.debug(`intersection calc abc89:
|
|
366
|
+
outsidePoint: ${JSON.stringify(outsidePoint)}
|
|
367
|
+
insidePoint : ${JSON.stringify(insidePoint)}
|
|
368
|
+
node : x:${node.x} y:${node.y} w:${node.width} h:${node.height}`);
|
|
369
|
+
const x = node.x;
|
|
370
|
+
const y = node.y;
|
|
371
|
+
const dx = Math.abs(x - insidePoint.x);
|
|
372
|
+
const w = node.width / 2;
|
|
373
|
+
let r = insidePoint.x < outsidePoint.x ? w - dx : w + dx;
|
|
374
|
+
const h = node.height / 2;
|
|
375
|
+
const Q = Math.abs(outsidePoint.y - insidePoint.y);
|
|
376
|
+
const R = Math.abs(outsidePoint.x - insidePoint.x);
|
|
377
|
+
if (Math.abs(y - outsidePoint.y) * w > Math.abs(x - outsidePoint.x) * h) {
|
|
378
|
+
let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y;
|
|
379
|
+
r = R * q / Q;
|
|
380
|
+
const res = {
|
|
381
|
+
x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r,
|
|
382
|
+
y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q
|
|
383
|
+
};
|
|
384
|
+
if (r === 0) {
|
|
385
|
+
res.x = outsidePoint.x;
|
|
386
|
+
res.y = outsidePoint.y;
|
|
387
|
+
}
|
|
388
|
+
if (R === 0) {
|
|
389
|
+
res.x = outsidePoint.x;
|
|
390
|
+
}
|
|
391
|
+
if (Q === 0) {
|
|
392
|
+
res.y = outsidePoint.y;
|
|
393
|
+
}
|
|
394
|
+
log.debug(`abc89 top/bottom calc, Q ${Q}, q ${q}, R ${R}, r ${r}`, res);
|
|
395
|
+
return res;
|
|
396
|
+
} else {
|
|
397
|
+
if (insidePoint.x < outsidePoint.x) {
|
|
398
|
+
r = outsidePoint.x - w - x;
|
|
399
|
+
} else {
|
|
400
|
+
r = x - w - outsidePoint.x;
|
|
401
|
+
}
|
|
402
|
+
let q = Q * r / R;
|
|
403
|
+
let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - R + r;
|
|
404
|
+
let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q : insidePoint.y - q;
|
|
405
|
+
log.debug(`sides calc abc89, Q ${Q}, q ${q}, R ${R}, r ${r}`, { _x, _y });
|
|
406
|
+
if (r === 0) {
|
|
407
|
+
_x = outsidePoint.x;
|
|
408
|
+
_y = outsidePoint.y;
|
|
409
|
+
}
|
|
410
|
+
if (R === 0) {
|
|
411
|
+
_x = outsidePoint.x;
|
|
412
|
+
}
|
|
413
|
+
if (Q === 0) {
|
|
414
|
+
_y = outsidePoint.y;
|
|
415
|
+
}
|
|
416
|
+
return { x: _x, y: _y };
|
|
417
|
+
}
|
|
418
|
+
}, "intersection");
|
|
419
|
+
var cutPathAtIntersect = /* @__PURE__ */ __name((_points, boundaryNode) => {
|
|
420
|
+
log.warn("abc88 cutPathAtIntersect", _points, boundaryNode);
|
|
421
|
+
let points = [];
|
|
422
|
+
let lastPointOutside = _points[0];
|
|
423
|
+
let isInside = false;
|
|
424
|
+
_points.forEach((point2) => {
|
|
425
|
+
log.info("abc88 checking point", point2, boundaryNode);
|
|
426
|
+
if (!outsideNode(boundaryNode, point2) && !isInside) {
|
|
427
|
+
const inter = intersection(boundaryNode, lastPointOutside, point2);
|
|
428
|
+
log.debug("abc88 inside", point2, lastPointOutside, inter);
|
|
429
|
+
log.debug("abc88 intersection", inter, boundaryNode);
|
|
430
|
+
let pointPresent = false;
|
|
431
|
+
points.forEach((p) => {
|
|
432
|
+
pointPresent = pointPresent || p.x === inter.x && p.y === inter.y;
|
|
433
|
+
});
|
|
434
|
+
if (!points.some((e) => e.x === inter.x && e.y === inter.y)) {
|
|
435
|
+
points.push(inter);
|
|
436
|
+
} else {
|
|
437
|
+
log.warn("abc88 no intersect", inter, points);
|
|
438
|
+
}
|
|
439
|
+
isInside = true;
|
|
440
|
+
} else {
|
|
441
|
+
log.warn("abc88 outside", point2, lastPointOutside);
|
|
442
|
+
lastPointOutside = point2;
|
|
443
|
+
if (!isInside) {
|
|
444
|
+
points.push(point2);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
log.debug("returning points", points);
|
|
449
|
+
return points;
|
|
450
|
+
}, "cutPathAtIntersect");
|
|
451
|
+
function extractCornerPoints(points) {
|
|
452
|
+
const cornerPoints = [];
|
|
453
|
+
const cornerPointPositions = [];
|
|
454
|
+
for (let i = 1;i < points.length - 1; i++) {
|
|
455
|
+
const prev = points[i - 1];
|
|
456
|
+
const curr = points[i];
|
|
457
|
+
const next = points[i + 1];
|
|
458
|
+
if (prev.x === curr.x && curr.y === next.y && Math.abs(curr.x - next.x) > 5 && Math.abs(curr.y - prev.y) > 5) {
|
|
459
|
+
cornerPoints.push(curr);
|
|
460
|
+
cornerPointPositions.push(i);
|
|
461
|
+
} else if (prev.y === curr.y && curr.x === next.x && Math.abs(curr.x - prev.x) > 5 && Math.abs(curr.y - next.y) > 5) {
|
|
462
|
+
cornerPoints.push(curr);
|
|
463
|
+
cornerPointPositions.push(i);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
return { cornerPoints, cornerPointPositions };
|
|
467
|
+
}
|
|
468
|
+
__name(extractCornerPoints, "extractCornerPoints");
|
|
469
|
+
var findAdjacentPoint = /* @__PURE__ */ __name(function(pointA, pointB, distance) {
|
|
470
|
+
const xDiff = pointB.x - pointA.x;
|
|
471
|
+
const yDiff = pointB.y - pointA.y;
|
|
472
|
+
const length = Math.sqrt(xDiff * xDiff + yDiff * yDiff);
|
|
473
|
+
const ratio = distance / length;
|
|
474
|
+
return { x: pointB.x - ratio * xDiff, y: pointB.y - ratio * yDiff };
|
|
475
|
+
}, "findAdjacentPoint");
|
|
476
|
+
var fixCorners = /* @__PURE__ */ __name(function(lineData) {
|
|
477
|
+
const { cornerPointPositions } = extractCornerPoints(lineData);
|
|
478
|
+
const newLineData = [];
|
|
479
|
+
for (let i = 0;i < lineData.length; i++) {
|
|
480
|
+
if (cornerPointPositions.includes(i)) {
|
|
481
|
+
const prevPoint = lineData[i - 1];
|
|
482
|
+
const nextPoint = lineData[i + 1];
|
|
483
|
+
const cornerPoint = lineData[i];
|
|
484
|
+
const newPrevPoint = findAdjacentPoint(prevPoint, cornerPoint, 5);
|
|
485
|
+
const newNextPoint = findAdjacentPoint(nextPoint, cornerPoint, 5);
|
|
486
|
+
const xDiff = newNextPoint.x - newPrevPoint.x;
|
|
487
|
+
const yDiff = newNextPoint.y - newPrevPoint.y;
|
|
488
|
+
newLineData.push(newPrevPoint);
|
|
489
|
+
const a = Math.sqrt(2) * 2;
|
|
490
|
+
let newCornerPoint = { x: cornerPoint.x, y: cornerPoint.y };
|
|
491
|
+
if (Math.abs(nextPoint.x - prevPoint.x) > 10 && Math.abs(nextPoint.y - prevPoint.y) >= 10) {
|
|
492
|
+
log.debug("Corner point fixing", Math.abs(nextPoint.x - prevPoint.x), Math.abs(nextPoint.y - prevPoint.y));
|
|
493
|
+
const r = 5;
|
|
494
|
+
if (cornerPoint.x === newPrevPoint.x) {
|
|
495
|
+
newCornerPoint = {
|
|
496
|
+
x: xDiff < 0 ? newPrevPoint.x - r + a : newPrevPoint.x + r - a,
|
|
497
|
+
y: yDiff < 0 ? newPrevPoint.y - a : newPrevPoint.y + a
|
|
498
|
+
};
|
|
499
|
+
} else {
|
|
500
|
+
newCornerPoint = {
|
|
501
|
+
x: xDiff < 0 ? newPrevPoint.x - a : newPrevPoint.x + a,
|
|
502
|
+
y: yDiff < 0 ? newPrevPoint.y - r + a : newPrevPoint.y + r - a
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
} else {
|
|
506
|
+
log.debug("Corner point skipping fixing", Math.abs(nextPoint.x - prevPoint.x), Math.abs(nextPoint.y - prevPoint.y));
|
|
507
|
+
}
|
|
508
|
+
newLineData.push(newCornerPoint, newNextPoint);
|
|
509
|
+
} else {
|
|
510
|
+
newLineData.push(lineData[i]);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
return newLineData;
|
|
514
|
+
}, "fixCorners");
|
|
515
|
+
var generateDashArray = /* @__PURE__ */ __name((len, oValueS, oValueE) => {
|
|
516
|
+
const middleLength = len - oValueS - oValueE;
|
|
517
|
+
const dashLength = 2;
|
|
518
|
+
const gapLength = 2;
|
|
519
|
+
const dashGapPairLength = dashLength + gapLength;
|
|
520
|
+
const numberOfPairs = Math.floor(middleLength / dashGapPairLength);
|
|
521
|
+
const middlePattern = Array(numberOfPairs).fill(`${dashLength} ${gapLength}`).join(" ");
|
|
522
|
+
const dashArray = `0 ${oValueS} ${middlePattern} ${oValueE}`;
|
|
523
|
+
return dashArray;
|
|
524
|
+
}, "generateDashArray");
|
|
525
|
+
var insertEdge = /* @__PURE__ */ __name(function(elem, edge, clusterDb, diagramType, startNode, endNode, diagramId, skipIntersect = false) {
|
|
526
|
+
if (!diagramId) {
|
|
527
|
+
throw new Error(`insertEdge: missing diagramId for edge "${edge.id}" — edge IDs require a diagram prefix for uniqueness`);
|
|
528
|
+
}
|
|
529
|
+
const { handDrawnSeed, layout } = getConfig2();
|
|
530
|
+
let points = edge.points;
|
|
531
|
+
let pointsHasChanged = false;
|
|
532
|
+
const tail = startNode;
|
|
533
|
+
var head = endNode;
|
|
534
|
+
const edgeClassStyles = [];
|
|
535
|
+
for (const key in edge.cssCompiledStyles) {
|
|
536
|
+
if (isLabelStyle(key)) {
|
|
537
|
+
continue;
|
|
538
|
+
}
|
|
539
|
+
edgeClassStyles.push(edge.cssCompiledStyles[key]);
|
|
540
|
+
}
|
|
541
|
+
if (layout === "swimlane") {
|
|
542
|
+
if (head.intersect && tail.intersect && Array.isArray(points) && points.length >= 2) {
|
|
543
|
+
if (points.length === 2) {
|
|
544
|
+
points = [tail.intersect(points[0]), head.intersect(points[1])];
|
|
545
|
+
} else {
|
|
546
|
+
const innerPoints = points.slice(1, -1);
|
|
547
|
+
const firstInner = innerPoints[0];
|
|
548
|
+
const lastInner = innerPoints[innerPoints.length - 1];
|
|
549
|
+
const TOLERANCE = 0.5;
|
|
550
|
+
const lastIsPinned = Math.abs(points[points.length - 1].x - lastInner.x) < TOLERANCE && Math.abs(points[points.length - 1].y - lastInner.y) < TOLERANCE;
|
|
551
|
+
const newFirst = tail.intersect(firstInner);
|
|
552
|
+
const newLast = lastIsPinned ? lastInner : head.intersect(lastInner);
|
|
553
|
+
const lastIsDuplicate = Math.abs(newLast.x - lastInner.x) < TOLERANCE && Math.abs(newLast.y - lastInner.y) < TOLERANCE;
|
|
554
|
+
const firstIsDuplicate = Math.abs(newFirst.x - firstInner.x) < TOLERANCE && Math.abs(newFirst.y - firstInner.y) < TOLERANCE;
|
|
555
|
+
const startPoints = firstIsDuplicate ? [] : [newFirst];
|
|
556
|
+
const endPoints = lastIsDuplicate ? [] : [newLast];
|
|
557
|
+
points = [...startPoints, ...innerPoints, ...endPoints];
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
points = orthogonalizeToLabelClippedPoints(edge, points);
|
|
561
|
+
} else if (head.intersect && tail.intersect && !skipIntersect) {
|
|
562
|
+
points = points.slice(1, edge.points.length - 1);
|
|
563
|
+
points.unshift(tail.intersect(points[0]));
|
|
564
|
+
points.push(head.intersect(points[points.length - 1]));
|
|
565
|
+
}
|
|
566
|
+
const pointsStr = btoa(JSON.stringify(points));
|
|
567
|
+
if (edge.toCluster) {
|
|
568
|
+
log.info("to cluster abc88", clusterDb.get(edge.toCluster));
|
|
569
|
+
points = cutPathAtIntersect(edge.points, clusterDb.get(edge.toCluster).node);
|
|
570
|
+
pointsHasChanged = true;
|
|
571
|
+
}
|
|
572
|
+
if (edge.fromCluster) {
|
|
573
|
+
log.debug("from cluster abc88", clusterDb.get(edge.fromCluster), JSON.stringify(points, null, 2));
|
|
574
|
+
points = cutPathAtIntersect(points.reverse(), clusterDb.get(edge.fromCluster).node).reverse();
|
|
575
|
+
pointsHasChanged = true;
|
|
576
|
+
}
|
|
577
|
+
let lineData = points.filter((p) => !Number.isNaN(p.y));
|
|
578
|
+
const edgeCurveType = resolveEdgeCurveType(edge.curve);
|
|
579
|
+
if (edgeCurveType !== "rounded") {
|
|
580
|
+
lineData = fixCorners(lineData);
|
|
581
|
+
}
|
|
582
|
+
let curve = linear_default;
|
|
583
|
+
switch (edgeCurveType) {
|
|
584
|
+
case "linear":
|
|
585
|
+
curve = linear_default;
|
|
586
|
+
break;
|
|
587
|
+
case "basis":
|
|
588
|
+
curve = basis_default;
|
|
589
|
+
break;
|
|
590
|
+
case "cardinal":
|
|
591
|
+
curve = cardinal_default;
|
|
592
|
+
break;
|
|
593
|
+
case "bumpX":
|
|
594
|
+
curve = bumpX;
|
|
595
|
+
break;
|
|
596
|
+
case "bumpY":
|
|
597
|
+
curve = bumpY;
|
|
598
|
+
break;
|
|
599
|
+
case "catmullRom":
|
|
600
|
+
curve = catmullRom_default;
|
|
601
|
+
break;
|
|
602
|
+
case "monotoneX":
|
|
603
|
+
curve = monotoneX;
|
|
604
|
+
break;
|
|
605
|
+
case "monotoneY":
|
|
606
|
+
curve = monotoneY;
|
|
607
|
+
break;
|
|
608
|
+
case "natural":
|
|
609
|
+
curve = natural_default;
|
|
610
|
+
break;
|
|
611
|
+
case "step":
|
|
612
|
+
curve = step_default;
|
|
613
|
+
break;
|
|
614
|
+
case "stepAfter":
|
|
615
|
+
curve = stepAfter;
|
|
616
|
+
break;
|
|
617
|
+
case "stepBefore":
|
|
618
|
+
curve = stepBefore;
|
|
619
|
+
break;
|
|
620
|
+
case "rounded":
|
|
621
|
+
curve = linear_default;
|
|
622
|
+
break;
|
|
623
|
+
default:
|
|
624
|
+
curve = basis_default;
|
|
625
|
+
}
|
|
626
|
+
const { x, y } = getLineFunctionsWithOffset(edge);
|
|
627
|
+
const lineFunction = line_default().x(x).y(y).curve(curve);
|
|
628
|
+
let strokeClasses;
|
|
629
|
+
switch (edge.thickness) {
|
|
630
|
+
case "normal":
|
|
631
|
+
strokeClasses = "edge-thickness-normal";
|
|
632
|
+
break;
|
|
633
|
+
case "thick":
|
|
634
|
+
strokeClasses = "edge-thickness-thick";
|
|
635
|
+
break;
|
|
636
|
+
case "invisible":
|
|
637
|
+
strokeClasses = "edge-thickness-invisible";
|
|
638
|
+
break;
|
|
639
|
+
default:
|
|
640
|
+
strokeClasses = "edge-thickness-normal";
|
|
641
|
+
}
|
|
642
|
+
switch (edge.pattern) {
|
|
643
|
+
case "solid":
|
|
644
|
+
strokeClasses += " edge-pattern-solid";
|
|
645
|
+
break;
|
|
646
|
+
case "dotted":
|
|
647
|
+
strokeClasses += " edge-pattern-dotted";
|
|
648
|
+
break;
|
|
649
|
+
case "dashed":
|
|
650
|
+
strokeClasses += " edge-pattern-dashed";
|
|
651
|
+
break;
|
|
652
|
+
default:
|
|
653
|
+
strokeClasses += " edge-pattern-solid";
|
|
654
|
+
}
|
|
655
|
+
let svgPath;
|
|
656
|
+
let linePath = edgeCurveType === "rounded" ? generateRoundedPath(applyMarkerOffsetsToPoints(lineData, edge), 5) : lineFunction(lineData);
|
|
657
|
+
const edgeStyles = Array.isArray(edge.style) ? edge.style : [edge.style];
|
|
658
|
+
let strokeColor = edgeStyles.find((style) => style?.startsWith("stroke:"));
|
|
659
|
+
let animationClass = "";
|
|
660
|
+
if (edge.animate) {
|
|
661
|
+
animationClass = "edge-animation-fast";
|
|
662
|
+
}
|
|
663
|
+
if (edge.animation) {
|
|
664
|
+
animationClass = "edge-animation-" + edge.animation;
|
|
665
|
+
}
|
|
666
|
+
let animatedEdge = false;
|
|
667
|
+
if (edge.look === "handDrawn") {
|
|
668
|
+
const rc = at.svg(elem);
|
|
669
|
+
Object.assign([], lineData);
|
|
670
|
+
const svgPathNode = rc.path(linePath, {
|
|
671
|
+
roughness: 0.3,
|
|
672
|
+
seed: handDrawnSeed
|
|
673
|
+
});
|
|
674
|
+
strokeClasses += " transition";
|
|
675
|
+
svgPath = select_default(svgPathNode).select("path").attr("id", `${diagramId}-${edge.id}`).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "") + (animationClass ? " " + animationClass : "")).attr("style", edgeStyles ? edgeStyles.reduce((acc, style) => acc + ";" + style, "") : "");
|
|
676
|
+
let d = svgPath.attr("d");
|
|
677
|
+
svgPath.attr("d", d);
|
|
678
|
+
elem.node().appendChild(svgPath.node());
|
|
679
|
+
} else {
|
|
680
|
+
const stylesFromClasses = edgeClassStyles.join(";");
|
|
681
|
+
const styles = edgeStyles ? edgeStyles.reduce((acc, style) => acc + style + ";", "") : "";
|
|
682
|
+
const pathStyle = (stylesFromClasses ? stylesFromClasses + ";" + styles + ";" : styles) + ";" + (edgeStyles ? edgeStyles.reduce((acc, style) => acc + ";" + style, "") : "");
|
|
683
|
+
svgPath = elem.append("path").attr("d", linePath).attr("id", `${diagramId}-${edge.id}`).attr("class", " " + strokeClasses + (edge.classes ? " " + edge.classes : "") + (animationClass ? " " + animationClass : "")).attr("style", pathStyle);
|
|
684
|
+
strokeColor = pathStyle.match(/stroke:([^;]+)/)?.[1];
|
|
685
|
+
animatedEdge = edge.animate === true || !!edge.animation || stylesFromClasses.includes("animation");
|
|
686
|
+
const pathNode = svgPath.node();
|
|
687
|
+
const len = typeof pathNode.getTotalLength === "function" ? pathNode.getTotalLength() : 0;
|
|
688
|
+
const oValueS = markerOffsets2[edge.arrowTypeStart] || 0;
|
|
689
|
+
const oValueE = markerOffsets2[edge.arrowTypeEnd] || 0;
|
|
690
|
+
if (edge.look === "neo" && !animatedEdge) {
|
|
691
|
+
const dashArray = edge.pattern === "dotted" || edge.pattern === "dashed" ? generateDashArray(len, oValueS, oValueE) : `0 ${oValueS} ${len - oValueS - oValueE} ${oValueE}`;
|
|
692
|
+
const mOffset = `stroke-dasharray: ${dashArray}; stroke-dashoffset: 0;`;
|
|
693
|
+
svgPath.attr("style", mOffset + svgPath.attr("style"));
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
svgPath.attr("data-edge", true);
|
|
697
|
+
svgPath.attr("data-et", "edge");
|
|
698
|
+
svgPath.attr("data-id", edge.id);
|
|
699
|
+
svgPath.attr("data-points", pointsStr);
|
|
700
|
+
svgPath.attr("data-look", handleUndefinedAttr(edge.look));
|
|
701
|
+
if (edge.showPoints) {
|
|
702
|
+
lineData.forEach((point3) => {
|
|
703
|
+
elem.append("circle").style("stroke", "red").style("fill", "red").attr("r", 1).attr("cx", point3.x).attr("cy", point3.y);
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
let url = "";
|
|
707
|
+
if (getConfig2().flowchart.arrowMarkerAbsolute || getConfig2().state.arrowMarkerAbsolute) {
|
|
708
|
+
url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
|
|
709
|
+
url = url.replace(/\(/g, "\\(").replace(/\)/g, "\\)");
|
|
710
|
+
}
|
|
711
|
+
log.info("arrowTypeStart", edge.arrowTypeStart);
|
|
712
|
+
log.info("arrowTypeEnd", edge.arrowTypeEnd);
|
|
713
|
+
const useMargin = !animatedEdge && edge?.look === "neo";
|
|
714
|
+
addEdgeMarkers(svgPath, edge, url, diagramId, diagramType, useMargin, strokeColor);
|
|
715
|
+
const midIndex = Math.floor(points.length / 2);
|
|
716
|
+
const point2 = points[midIndex];
|
|
717
|
+
if (!utils_default.isLabelCoordinateInPath(point2, svgPath.attr("d"))) {
|
|
718
|
+
pointsHasChanged = true;
|
|
719
|
+
}
|
|
720
|
+
let paths = {};
|
|
721
|
+
if (pointsHasChanged) {
|
|
722
|
+
paths.updatedPath = points;
|
|
723
|
+
}
|
|
724
|
+
paths.originalPath = edge.points;
|
|
725
|
+
return paths;
|
|
726
|
+
}, "insertEdge");
|
|
727
|
+
function generateRoundedPath(points, radius) {
|
|
728
|
+
if (points.length < 2) {
|
|
729
|
+
return "";
|
|
730
|
+
}
|
|
731
|
+
let path = "";
|
|
732
|
+
const size = points.length;
|
|
733
|
+
const epsilon = 0.00001;
|
|
734
|
+
for (let i = 0;i < size; i++) {
|
|
735
|
+
const currPoint = points[i];
|
|
736
|
+
const prevPoint = points[i - 1];
|
|
737
|
+
const nextPoint = points[i + 1];
|
|
738
|
+
if (i === 0) {
|
|
739
|
+
path += `M${currPoint.x},${currPoint.y}`;
|
|
740
|
+
} else if (i === size - 1) {
|
|
741
|
+
path += `L${currPoint.x},${currPoint.y}`;
|
|
742
|
+
} else {
|
|
743
|
+
const dx1 = currPoint.x - prevPoint.x;
|
|
744
|
+
const dy1 = currPoint.y - prevPoint.y;
|
|
745
|
+
const dx2 = nextPoint.x - currPoint.x;
|
|
746
|
+
const dy2 = nextPoint.y - currPoint.y;
|
|
747
|
+
const len1 = Math.hypot(dx1, dy1);
|
|
748
|
+
const len2 = Math.hypot(dx2, dy2);
|
|
749
|
+
if (len1 < epsilon || len2 < epsilon) {
|
|
750
|
+
path += `L${currPoint.x},${currPoint.y}`;
|
|
751
|
+
continue;
|
|
752
|
+
}
|
|
753
|
+
const nx1 = dx1 / len1;
|
|
754
|
+
const ny1 = dy1 / len1;
|
|
755
|
+
const nx2 = dx2 / len2;
|
|
756
|
+
const ny2 = dy2 / len2;
|
|
757
|
+
const dot = nx1 * nx2 + ny1 * ny2;
|
|
758
|
+
const clampedDot = Math.max(-1, Math.min(1, dot));
|
|
759
|
+
const angle = Math.acos(clampedDot);
|
|
760
|
+
if (angle < epsilon || Math.abs(Math.PI - angle) < epsilon) {
|
|
761
|
+
path += `L${currPoint.x},${currPoint.y}`;
|
|
762
|
+
continue;
|
|
763
|
+
}
|
|
764
|
+
const cutLen = Math.min(radius / Math.sin(angle / 2), len1 / 2, len2 / 2);
|
|
765
|
+
const startX = currPoint.x - nx1 * cutLen;
|
|
766
|
+
const startY = currPoint.y - ny1 * cutLen;
|
|
767
|
+
const endX = currPoint.x + nx2 * cutLen;
|
|
768
|
+
const endY = currPoint.y + ny2 * cutLen;
|
|
769
|
+
path += `L${startX},${startY}`;
|
|
770
|
+
path += `Q${currPoint.x},${currPoint.y} ${endX},${endY}`;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
return path;
|
|
774
|
+
}
|
|
775
|
+
__name(generateRoundedPath, "generateRoundedPath");
|
|
776
|
+
function calculateDeltaAndAngle(point1, point2) {
|
|
777
|
+
if (!point1 || !point2) {
|
|
778
|
+
return { angle: 0, deltaX: 0, deltaY: 0 };
|
|
779
|
+
}
|
|
780
|
+
const deltaX = point2.x - point1.x;
|
|
781
|
+
const deltaY = point2.y - point1.y;
|
|
782
|
+
const angle = Math.atan2(deltaY, deltaX);
|
|
783
|
+
return { angle, deltaX, deltaY };
|
|
784
|
+
}
|
|
785
|
+
__name(calculateDeltaAndAngle, "calculateDeltaAndAngle");
|
|
786
|
+
function applyMarkerOffsetsToPoints(points, edge) {
|
|
787
|
+
const newPoints = points.map((point2) => ({ ...point2 }));
|
|
788
|
+
if (points.length >= 2 && markerOffsets[edge.arrowTypeStart]) {
|
|
789
|
+
const offsetValue = markerOffsets[edge.arrowTypeStart];
|
|
790
|
+
const point1 = points[0];
|
|
791
|
+
const point2 = points[1];
|
|
792
|
+
const { angle } = calculateDeltaAndAngle(point1, point2);
|
|
793
|
+
const offsetX = offsetValue * Math.cos(angle);
|
|
794
|
+
const offsetY = offsetValue * Math.sin(angle);
|
|
795
|
+
newPoints[0].x = point1.x + offsetX;
|
|
796
|
+
newPoints[0].y = point1.y + offsetY;
|
|
797
|
+
}
|
|
798
|
+
const n = points.length;
|
|
799
|
+
if (n >= 2 && markerOffsets[edge.arrowTypeEnd]) {
|
|
800
|
+
const offsetValue = markerOffsets[edge.arrowTypeEnd];
|
|
801
|
+
const point1 = points[n - 1];
|
|
802
|
+
const point2 = points[n - 2];
|
|
803
|
+
const { angle } = calculateDeltaAndAngle(point2, point1);
|
|
804
|
+
const offsetX = offsetValue * Math.cos(angle);
|
|
805
|
+
const offsetY = offsetValue * Math.sin(angle);
|
|
806
|
+
newPoints[n - 1].x = point1.x - offsetX;
|
|
807
|
+
newPoints[n - 1].y = point1.y - offsetY;
|
|
808
|
+
}
|
|
809
|
+
return newPoints;
|
|
810
|
+
}
|
|
811
|
+
__name(applyMarkerOffsetsToPoints, "applyMarkerOffsetsToPoints");
|
|
812
|
+
var insertMarkers = /* @__PURE__ */ __name((elem, markerArray, type, id) => {
|
|
813
|
+
markerArray.forEach((markerName) => {
|
|
814
|
+
markers[markerName](elem, type, id);
|
|
815
|
+
});
|
|
816
|
+
}, "insertMarkers");
|
|
817
|
+
var extension = /* @__PURE__ */ __name((elem, type, id) => {
|
|
818
|
+
log.trace("Making markers for ", id);
|
|
819
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-extensionStart").attr("class", "marker extension " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M 1,7 L18,13 V 1 Z");
|
|
820
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-extensionEnd").attr("class", "marker extension " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
|
|
821
|
+
elem.append("marker").attr("id", id + "_" + type + "-extensionStart-margin").attr("class", "marker extension " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").attr("viewBox", "0 0 20 14").append("polygon").attr("points", "10,7 18,13 18,1").style("stroke-width", 2).style("stroke-dasharray", "0");
|
|
822
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-extensionEnd-margin").attr("class", "marker extension " + type).attr("refX", 9).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").attr("viewBox", "0 0 20 14").append("polygon").attr("points", "10,1 10,13 18,7").style("stroke-width", 2).style("stroke-dasharray", "0");
|
|
823
|
+
}, "extension");
|
|
824
|
+
var composition = /* @__PURE__ */ __name((elem, type, id) => {
|
|
825
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionStart").attr("class", "marker composition " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
826
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionEnd").attr("class", "marker composition " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
827
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionStart-margin").attr("class", "marker composition " + type).attr("refX", 15).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 0).attr("viewBox", "0 0 15 15").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
828
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-compositionEnd-margin").attr("class", "marker composition " + type).attr("refX", 3.5).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 0).attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
829
|
+
}, "composition");
|
|
830
|
+
var aggregation = /* @__PURE__ */ __name((elem, type, id) => {
|
|
831
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationStart").attr("class", "marker aggregation " + type).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
832
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationEnd").attr("class", "marker aggregation " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
833
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationStart-margin").attr("class", "marker aggregation " + type).attr("refX", 15).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 2).attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
834
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-aggregationEnd-margin").attr("class", "marker aggregation " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 2).attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
835
|
+
}, "aggregation");
|
|
836
|
+
var dependency = /* @__PURE__ */ __name((elem, type, id) => {
|
|
837
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyStart").attr("class", "marker dependency " + type).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z");
|
|
838
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyEnd").attr("class", "marker dependency " + type).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
839
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyStart-margin").attr("class", "marker dependency " + type).attr("refX", 4).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 0).attr("d", "M 5,7 L9,13 L1,7 L9,1 Z");
|
|
840
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-dependencyEnd-margin").attr("class", "marker dependency " + type).attr("refX", 16).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").style("stroke-width", 0).attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
841
|
+
}, "dependency");
|
|
842
|
+
var lollipop = /* @__PURE__ */ __name((elem, type, id) => {
|
|
843
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopStart").attr("class", "marker lollipop " + type).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
|
|
844
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopEnd").attr("class", "marker lollipop " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
|
|
845
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopStart-margin").attr("class", "marker lollipop " + type).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("circle").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6).attr("stroke-width", 2);
|
|
846
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-lollipopEnd-margin").attr("class", "marker lollipop " + type).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("circle").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6).attr("stroke-width", 2);
|
|
847
|
+
}, "lollipop");
|
|
848
|
+
var point = /* @__PURE__ */ __name((elem, type, id) => {
|
|
849
|
+
elem.append("marker").attr("id", id + "_" + type + "-pointEnd").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
850
|
+
elem.append("marker").attr("id", id + "_" + type + "-pointStart").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
851
|
+
elem.append("marker").attr("id", id + "_" + type + "-pointEnd-margin").attr("class", "marker " + type).attr("viewBox", "0 0 11.5 14").attr("refX", 11.5).attr("refY", 7).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 10.5).attr("markerHeight", 14).attr("orient", "auto").append("path").attr("d", "M 0 0 L 11.5 7 L 0 14 z").attr("class", "arrowMarkerPath").style("stroke-width", 0).style("stroke-dasharray", "1,0");
|
|
852
|
+
elem.append("marker").attr("id", id + "_" + type + "-pointStart-margin").attr("class", "marker " + type).attr("viewBox", "0 0 11.5 14").attr("refX", 1).attr("refY", 7).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11.5).attr("markerHeight", 14).attr("orient", "auto").append("polygon").attr("points", "0,7 11.5,14 11.5,0").attr("class", "arrowMarkerPath").style("stroke-width", 0).style("stroke-dasharray", "1,0");
|
|
853
|
+
}, "point");
|
|
854
|
+
var circle = /* @__PURE__ */ __name((elem, type, id) => {
|
|
855
|
+
elem.append("marker").attr("id", id + "_" + type + "-circleEnd").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
856
|
+
elem.append("marker").attr("id", id + "_" + type + "-circleStart").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
|
|
857
|
+
elem.append("marker").attr("id", id + "_" + type + "-circleEnd-margin").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refY", 5).attr("refX", 12.25).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 14).attr("markerHeight", 14).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 0).style("stroke-dasharray", "1,0");
|
|
858
|
+
elem.append("marker").attr("id", id + "_" + type + "-circleStart-margin").attr("class", "marker " + type).attr("viewBox", "0 0 10 10").attr("refX", -2).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 14).attr("markerHeight", 14).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 0).style("stroke-dasharray", "1,0");
|
|
859
|
+
}, "circle");
|
|
860
|
+
var cross = /* @__PURE__ */ __name((elem, type, id) => {
|
|
861
|
+
elem.append("marker").attr("id", id + "_" + type + "-crossEnd").attr("class", "marker cross " + type).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
|
|
862
|
+
elem.append("marker").attr("id", id + "_" + type + "-crossStart").attr("class", "marker cross " + type).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
|
|
863
|
+
elem.append("marker").attr("id", id + "_" + type + "-crossEnd-margin").attr("class", "marker cross " + type).attr("viewBox", "0 0 15 15").attr("refX", 17.7).attr("refY", 7.5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 1,1 L 14,14 M 1,14 L 14,1").attr("class", "arrowMarkerPath").style("stroke-width", 2.5);
|
|
864
|
+
elem.append("marker").attr("id", id + "_" + type + "-crossStart-margin").attr("class", "marker cross " + type).attr("viewBox", "0 0 15 15").attr("refX", -3.5).attr("refY", 7.5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 1,1 L 14,14 M 1,14 L 14,1").attr("class", "arrowMarkerPath").style("stroke-width", 2.5).style("stroke-dasharray", "1,0");
|
|
865
|
+
}, "cross");
|
|
866
|
+
var barb = /* @__PURE__ */ __name((elem, type, id) => {
|
|
867
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
|
|
868
|
+
}, "barb");
|
|
869
|
+
var barbNeo = /* @__PURE__ */ __name((elem, type, id) => {
|
|
870
|
+
const config = getConfig();
|
|
871
|
+
const { themeVariables } = config;
|
|
872
|
+
const { transitionColor } = themeVariables;
|
|
873
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L11,14 L13,7 L11,0 Z");
|
|
874
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-barbEnd-margin").attr("refX", 17).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L11,14 L13,7 L11,0 Z").attr("fill", `${transitionColor}`);
|
|
875
|
+
}, "barbNeo");
|
|
876
|
+
var only_one = /* @__PURE__ */ __name((elem, type, id) => {
|
|
877
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-onlyOneStart").attr("class", "marker onlyOne " + type).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M9,0 L9,18 M15,0 L15,18");
|
|
878
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-onlyOneEnd").attr("class", "marker onlyOne " + type).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M3,0 L3,18 M9,0 L9,18");
|
|
879
|
+
}, "only_one");
|
|
880
|
+
var zero_or_one = /* @__PURE__ */ __name((elem, type, id) => {
|
|
881
|
+
const startMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrOneStart").attr("class", "marker zeroOrOne " + type).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
|
|
882
|
+
startMarker.append("circle").attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6);
|
|
883
|
+
startMarker.append("path").attr("d", "M9,0 L9,18");
|
|
884
|
+
const endMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrOneEnd").attr("class", "marker zeroOrOne " + type).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
|
|
885
|
+
endMarker.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6);
|
|
886
|
+
endMarker.append("path").attr("d", "M21,0 L21,18");
|
|
887
|
+
}, "zero_or_one");
|
|
888
|
+
var one_or_more = /* @__PURE__ */ __name((elem, type, id) => {
|
|
889
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-oneOrMoreStart").attr("class", "marker oneOrMore " + type).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27");
|
|
890
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-oneOrMoreEnd").attr("class", "marker oneOrMore " + type).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18");
|
|
891
|
+
}, "one_or_more");
|
|
892
|
+
var zero_or_more = /* @__PURE__ */ __name((elem, type, id) => {
|
|
893
|
+
const startMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrMoreStart").attr("class", "marker zeroOrMore " + type).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
|
|
894
|
+
startMarker.append("circle").attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6);
|
|
895
|
+
startMarker.append("path").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18");
|
|
896
|
+
const endMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrMoreEnd").attr("class", "marker zeroOrMore " + type).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
|
|
897
|
+
endMarker.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6);
|
|
898
|
+
endMarker.append("path").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18");
|
|
899
|
+
}, "zero_or_more");
|
|
900
|
+
var only_one_neo = /* @__PURE__ */ __name((elem, type, id) => {
|
|
901
|
+
const config = getConfig();
|
|
902
|
+
const { themeVariables } = config;
|
|
903
|
+
const { strokeWidth } = themeVariables;
|
|
904
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-onlyOneStart").attr("class", "marker onlyOne " + type).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M9,0 L9,18 M15,0 L15,18").attr("stroke-width", `${strokeWidth}`);
|
|
905
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-onlyOneEnd").attr("class", "marker onlyOne " + type).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M3,0 L3,18 M9,0 L9,18").attr("stroke-width", `${strokeWidth}`);
|
|
906
|
+
}, "only_one_neo");
|
|
907
|
+
var zero_or_one_neo = /* @__PURE__ */ __name((elem, type, id) => {
|
|
908
|
+
const config = getConfig();
|
|
909
|
+
const { themeVariables } = config;
|
|
910
|
+
const { strokeWidth, mainBkg } = themeVariables;
|
|
911
|
+
const startMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrOneStart").attr("class", "marker zeroOrOne " + type).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse");
|
|
912
|
+
startMarker.append("circle").attr("fill", mainBkg ?? "white").attr("cx", 21).attr("cy", 9).attr("stroke-width", `${strokeWidth}`).attr("r", 6);
|
|
913
|
+
startMarker.append("path").attr("d", "M9,0 L9,18").attr("stroke-width", `${strokeWidth}`);
|
|
914
|
+
const endMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrOneEnd").attr("class", "marker zeroOrOne " + type).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto");
|
|
915
|
+
endMarker.append("circle").attr("fill", mainBkg ?? "white").attr("cx", 9).attr("cy", 9).attr("stroke-width", `${strokeWidth}`).attr("r", 6);
|
|
916
|
+
endMarker.append("path").attr("d", "M21,0 L21,18").attr("stroke-width", `${strokeWidth}`);
|
|
917
|
+
}, "zero_or_one_neo");
|
|
918
|
+
var one_or_more_neo = /* @__PURE__ */ __name((elem, type, id) => {
|
|
919
|
+
const config = getConfig();
|
|
920
|
+
const { themeVariables } = config;
|
|
921
|
+
const { strokeWidth } = themeVariables;
|
|
922
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-oneOrMoreStart").attr("class", "marker oneOrMore " + type).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("path").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width", `${strokeWidth}`);
|
|
923
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-oneOrMoreEnd").attr("class", "marker oneOrMore " + type).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width", `${strokeWidth}`);
|
|
924
|
+
}, "one_or_more_neo");
|
|
925
|
+
var zero_or_more_neo = /* @__PURE__ */ __name((elem, type, id) => {
|
|
926
|
+
const config = getConfig();
|
|
927
|
+
const { themeVariables } = config;
|
|
928
|
+
const { strokeWidth, mainBkg } = themeVariables;
|
|
929
|
+
const startMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrMoreStart").attr("class", "marker zeroOrMore " + type).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto");
|
|
930
|
+
startMarker.append("circle").attr("fill", mainBkg ?? "white").attr("cx", 45.5).attr("cy", 18).attr("r", 6).attr("stroke-width", `${strokeWidth}`);
|
|
931
|
+
startMarker.append("path").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width", `${strokeWidth}`);
|
|
932
|
+
const endMarker = elem.append("defs").append("marker").attr("id", id + "_" + type + "-zeroOrMoreEnd").attr("class", "marker zeroOrMore " + type).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse");
|
|
933
|
+
endMarker.append("circle").attr("fill", mainBkg ?? "white").attr("cx", 11).attr("cy", 18).attr("r", 6).attr("stroke-width", `${strokeWidth}`);
|
|
934
|
+
endMarker.append("path").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width", `${strokeWidth}`);
|
|
935
|
+
}, "zero_or_more_neo");
|
|
936
|
+
var requirement_arrow = /* @__PURE__ */ __name((elem, type, id) => {
|
|
937
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-requirement_arrowEnd").attr("refX", 20).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("path").attr("d", `M0,0
|
|
938
|
+
L20,10
|
|
939
|
+
M20,10
|
|
940
|
+
L0,20`);
|
|
941
|
+
}, "requirement_arrow");
|
|
942
|
+
var requirement_arrow_neo = /* @__PURE__ */ __name((elem, type, id) => {
|
|
943
|
+
const config = getConfig();
|
|
944
|
+
const { themeVariables } = config;
|
|
945
|
+
const { strokeWidth } = themeVariables;
|
|
946
|
+
elem.append("defs").append("marker").attr("id", id + "_" + type + "-requirement_arrowEnd").attr("refX", 20).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").attr("stroke-width", `${strokeWidth}`).attr("viewBox", "0 0 25 20").append("path").attr("d", `M0,0
|
|
947
|
+
L20,10
|
|
948
|
+
M20,10
|
|
949
|
+
L0,20`).attr("stroke-linejoin", "miter");
|
|
950
|
+
}, "requirement_arrow_neo");
|
|
951
|
+
var requirement_contains = /* @__PURE__ */ __name((elem, type, id) => {
|
|
952
|
+
const containsNode = elem.append("defs").append("marker").attr("id", id + "_" + type + "-requirement_containsStart").attr("refX", 0).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("g");
|
|
953
|
+
containsNode.append("circle").attr("cx", 10).attr("cy", 10).attr("r", 9).attr("fill", "none");
|
|
954
|
+
containsNode.append("line").attr("x1", 1).attr("x2", 19).attr("y1", 10).attr("y2", 10);
|
|
955
|
+
containsNode.append("line").attr("y1", 1).attr("y2", 19).attr("x1", 10).attr("x2", 10);
|
|
956
|
+
}, "requirement_contains");
|
|
957
|
+
var requirement_contains_neo = /* @__PURE__ */ __name((elem, type, id) => {
|
|
958
|
+
const config = getConfig();
|
|
959
|
+
const { themeVariables } = config;
|
|
960
|
+
const { strokeWidth } = themeVariables;
|
|
961
|
+
const containsNode = elem.append("defs").append("marker").attr("id", id + "_" + type + "-requirement_containsStart").attr("refX", 0).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").attr("markerUnits", "userSpaceOnUse").append("g");
|
|
962
|
+
containsNode.append("circle").attr("cx", 10).attr("cy", 10).attr("r", 9).attr("fill", "none");
|
|
963
|
+
containsNode.append("line").attr("x1", 1).attr("x2", 19).attr("y1", 10).attr("y2", 10);
|
|
964
|
+
containsNode.append("line").attr("y1", 1).attr("y2", 19).attr("x1", 10).attr("x2", 10);
|
|
965
|
+
containsNode.selectAll("*").attr("stroke-width", `${strokeWidth}`);
|
|
966
|
+
}, "requirement_contains_neo");
|
|
967
|
+
var markers = {
|
|
968
|
+
extension,
|
|
969
|
+
composition,
|
|
970
|
+
aggregation,
|
|
971
|
+
dependency,
|
|
972
|
+
lollipop,
|
|
973
|
+
point,
|
|
974
|
+
circle,
|
|
975
|
+
cross,
|
|
976
|
+
barb,
|
|
977
|
+
barbNeo,
|
|
978
|
+
only_one,
|
|
979
|
+
zero_or_one,
|
|
980
|
+
one_or_more,
|
|
981
|
+
zero_or_more,
|
|
982
|
+
only_one_neo,
|
|
983
|
+
zero_or_one_neo,
|
|
984
|
+
one_or_more_neo,
|
|
985
|
+
zero_or_more_neo,
|
|
986
|
+
requirement_arrow,
|
|
987
|
+
requirement_contains,
|
|
988
|
+
requirement_arrow_neo,
|
|
989
|
+
requirement_contains_neo
|
|
990
|
+
};
|
|
991
|
+
var markers_default = insertMarkers;
|
|
992
|
+
|
|
993
|
+
export { edgeLabels, terminalLabels, clear, insertEdgeLabel, positionEdgeLabel, insertEdge, markers_default };
|