@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,500 @@
|
|
|
1
|
+
import {
|
|
2
|
+
populateCommonDb
|
|
3
|
+
} from "./markdown-b4s7ntq2.js";
|
|
4
|
+
import {
|
|
5
|
+
parse
|
|
6
|
+
} from "./markdown-ceefymn8.js";
|
|
7
|
+
import"./markdown-gx1p0ew0.js";
|
|
8
|
+
import"./markdown-pxfeh231.js";
|
|
9
|
+
import"./markdown-y18mve73.js";
|
|
10
|
+
import"./markdown-2x113yh8.js";
|
|
11
|
+
import"./markdown-56enrf2r.js";
|
|
12
|
+
import"./markdown-ag2sssf8.js";
|
|
13
|
+
import"./markdown-tnmabqvz.js";
|
|
14
|
+
import"./markdown-hab789t9.js";
|
|
15
|
+
import"./markdown-gxye5frz.js";
|
|
16
|
+
import"./markdown-k8xkn8mw.js";
|
|
17
|
+
import"./markdown-p740v4qm.js";
|
|
18
|
+
import"./markdown-ffg06nfz.js";
|
|
19
|
+
import"./markdown-w6sgd54z.js";
|
|
20
|
+
import"./markdown-rawhfvvc.js";
|
|
21
|
+
import"./markdown-v14td68x.js";
|
|
22
|
+
import"./markdown-dz3z5w30.js";
|
|
23
|
+
import {
|
|
24
|
+
selectSvgElement
|
|
25
|
+
} from "./markdown-6zz8efx2.js";
|
|
26
|
+
import {
|
|
27
|
+
cleanAndMerge
|
|
28
|
+
} from "./markdown-ff5wvb43.js";
|
|
29
|
+
import"./markdown-pzgd8z3s.js";
|
|
30
|
+
import {
|
|
31
|
+
clear,
|
|
32
|
+
configureSvgSize,
|
|
33
|
+
defaultConfig_default,
|
|
34
|
+
getAccDescription,
|
|
35
|
+
getAccTitle,
|
|
36
|
+
getConfig,
|
|
37
|
+
getDiagramTitle,
|
|
38
|
+
getThemeVariables3,
|
|
39
|
+
setAccDescription,
|
|
40
|
+
setAccTitle,
|
|
41
|
+
setDiagramTitle
|
|
42
|
+
} from "./markdown-92n37gd4.js";
|
|
43
|
+
import {
|
|
44
|
+
log
|
|
45
|
+
} from "./markdown-xw8dsk8b.js";
|
|
46
|
+
import {
|
|
47
|
+
__name
|
|
48
|
+
} from "./markdown-1s5vwkf2.js";
|
|
49
|
+
import"./markdown-dy5sgjhc.js";
|
|
50
|
+
import"./markdown-809k7q41.js";
|
|
51
|
+
|
|
52
|
+
// node_modules/mermaid/dist/chunks/mermaid.core/cynefinDiagram-MW4NZA55.mjs
|
|
53
|
+
var createDefaultData = /* @__PURE__ */ __name(() => ({
|
|
54
|
+
domains: /* @__PURE__ */ new Map,
|
|
55
|
+
transitions: []
|
|
56
|
+
}), "createDefaultData");
|
|
57
|
+
var data = createDefaultData();
|
|
58
|
+
var getDomains = /* @__PURE__ */ __name(() => data.domains, "getDomains");
|
|
59
|
+
var getTransitions = /* @__PURE__ */ __name(() => data.transitions, "getTransitions");
|
|
60
|
+
var setDomains = /* @__PURE__ */ __name((blocks) => {
|
|
61
|
+
if (!blocks) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
for (const block of blocks) {
|
|
65
|
+
const domainName = block.domain;
|
|
66
|
+
const items = (block.items ?? []).map((item) => ({
|
|
67
|
+
label: item.label
|
|
68
|
+
}));
|
|
69
|
+
data.domains.set(domainName, {
|
|
70
|
+
name: domainName,
|
|
71
|
+
items
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}, "setDomains");
|
|
75
|
+
var setTransitions = /* @__PURE__ */ __name((transitions) => {
|
|
76
|
+
if (!transitions) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
data.transitions = transitions.filter((t) => {
|
|
80
|
+
if (t.from === t.to) {
|
|
81
|
+
log.warn(`Cynefin: self-loop transition on domain "${t.from}" is not meaningful and will be skipped.`);
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return true;
|
|
85
|
+
}).map((t) => ({
|
|
86
|
+
from: t.from,
|
|
87
|
+
to: t.to,
|
|
88
|
+
label: t.label || undefined
|
|
89
|
+
}));
|
|
90
|
+
}, "setTransitions");
|
|
91
|
+
var getConfig2 = /* @__PURE__ */ __name(() => {
|
|
92
|
+
return cleanAndMerge({
|
|
93
|
+
...defaultConfig_default.cynefin,
|
|
94
|
+
...getConfig().cynefin
|
|
95
|
+
});
|
|
96
|
+
}, "getConfig");
|
|
97
|
+
var clear2 = /* @__PURE__ */ __name(() => {
|
|
98
|
+
clear();
|
|
99
|
+
data = createDefaultData();
|
|
100
|
+
}, "clear");
|
|
101
|
+
var db = {
|
|
102
|
+
getDomains,
|
|
103
|
+
getTransitions,
|
|
104
|
+
setDomains,
|
|
105
|
+
setTransitions,
|
|
106
|
+
getConfig: getConfig2,
|
|
107
|
+
clear: clear2,
|
|
108
|
+
setAccTitle,
|
|
109
|
+
getAccTitle,
|
|
110
|
+
setDiagramTitle,
|
|
111
|
+
getDiagramTitle,
|
|
112
|
+
getAccDescription,
|
|
113
|
+
setAccDescription
|
|
114
|
+
};
|
|
115
|
+
var populate = /* @__PURE__ */ __name((ast) => {
|
|
116
|
+
populateCommonDb(ast, db);
|
|
117
|
+
db.setDomains(ast.domains);
|
|
118
|
+
db.setTransitions(ast.transitions);
|
|
119
|
+
}, "populate");
|
|
120
|
+
var parser = {
|
|
121
|
+
parse: /* @__PURE__ */ __name(async (input) => {
|
|
122
|
+
const ast = await parse("cynefin", input);
|
|
123
|
+
log.debug(ast);
|
|
124
|
+
populate(ast);
|
|
125
|
+
}, "parse")
|
|
126
|
+
};
|
|
127
|
+
function seededRandom(seed) {
|
|
128
|
+
let t = seed + 1831565813 | 0;
|
|
129
|
+
t = Math.imul(t ^ t >>> 15, t | 1);
|
|
130
|
+
t ^= t + Math.imul(t ^ t >>> 7, t | 61);
|
|
131
|
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
132
|
+
}
|
|
133
|
+
__name(seededRandom, "seededRandom");
|
|
134
|
+
function hashString(str) {
|
|
135
|
+
let hash = 0;
|
|
136
|
+
for (let i = 0;i < str.length; i++) {
|
|
137
|
+
const ch = str.charCodeAt(i);
|
|
138
|
+
hash = (hash << 5) - hash + ch;
|
|
139
|
+
hash |= 0;
|
|
140
|
+
}
|
|
141
|
+
return hash;
|
|
142
|
+
}
|
|
143
|
+
__name(hashString, "hashString");
|
|
144
|
+
function resolveSeed(configuredSeed, id) {
|
|
145
|
+
if (typeof configuredSeed === "number" && Number.isFinite(configuredSeed) && configuredSeed !== 0) {
|
|
146
|
+
return configuredSeed;
|
|
147
|
+
}
|
|
148
|
+
return hashString(id);
|
|
149
|
+
}
|
|
150
|
+
__name(resolveSeed, "resolveSeed");
|
|
151
|
+
function generateFoldPath(width, height, seed, amplitudeOverride) {
|
|
152
|
+
const cx = width / 2;
|
|
153
|
+
const amplitude = amplitudeOverride ?? width * 0.015;
|
|
154
|
+
const segments = 7;
|
|
155
|
+
const segHeight = height / segments;
|
|
156
|
+
const points = [];
|
|
157
|
+
for (let i = 0;i <= segments; i++) {
|
|
158
|
+
const jitter = seededRandom(seed + i * 17) * amplitude * 2 - amplitude;
|
|
159
|
+
points.push({ x: cx + jitter, y: i * segHeight });
|
|
160
|
+
}
|
|
161
|
+
let d = `M${points[0].x},${points[0].y}`;
|
|
162
|
+
for (let i = 0;i < points.length - 1; i++) {
|
|
163
|
+
const p0 = points[i];
|
|
164
|
+
const p1 = points[i + 1];
|
|
165
|
+
const midY = (p0.y + p1.y) / 2;
|
|
166
|
+
const dir = i % 2 === 0 ? 1 : -1;
|
|
167
|
+
const offset = amplitude * 1.5 * dir * seededRandom(seed + i * 31 + 7);
|
|
168
|
+
const cp1x = p0.x + offset;
|
|
169
|
+
const cp1y = midY;
|
|
170
|
+
const cp2x = p1.x - offset;
|
|
171
|
+
const cp2y = midY;
|
|
172
|
+
d += ` C${cp1x},${cp1y} ${cp2x},${cp2y} ${p1.x},${p1.y}`;
|
|
173
|
+
}
|
|
174
|
+
return d;
|
|
175
|
+
}
|
|
176
|
+
__name(generateFoldPath, "generateFoldPath");
|
|
177
|
+
function generateHorizontalBoundary(width, height, seed, amplitudeOverride) {
|
|
178
|
+
const cy = height / 2;
|
|
179
|
+
const amplitude = amplitudeOverride ?? height * 0.015;
|
|
180
|
+
const segments = 7;
|
|
181
|
+
const segWidth = width / segments;
|
|
182
|
+
const points = [];
|
|
183
|
+
for (let i = 0;i <= segments; i++) {
|
|
184
|
+
const jitter = seededRandom(seed + i * 23) * amplitude * 2 - amplitude;
|
|
185
|
+
points.push({ x: i * segWidth, y: cy + jitter });
|
|
186
|
+
}
|
|
187
|
+
let d = `M${points[0].x},${points[0].y}`;
|
|
188
|
+
for (let i = 0;i < points.length - 1; i++) {
|
|
189
|
+
const p0 = points[i];
|
|
190
|
+
const p1 = points[i + 1];
|
|
191
|
+
const midX = (p0.x + p1.x) / 2;
|
|
192
|
+
const dir = i % 2 === 0 ? 1 : -1;
|
|
193
|
+
const offset = amplitude * 1.5 * dir * seededRandom(seed + i * 37 + 11);
|
|
194
|
+
const cp1x = midX;
|
|
195
|
+
const cp1y = p0.y + offset;
|
|
196
|
+
const cp2x = midX;
|
|
197
|
+
const cp2y = p1.y - offset;
|
|
198
|
+
d += ` C${cp1x},${cp1y} ${cp2x},${cp2y} ${p1.x},${p1.y}`;
|
|
199
|
+
}
|
|
200
|
+
return d;
|
|
201
|
+
}
|
|
202
|
+
__name(generateHorizontalBoundary, "generateHorizontalBoundary");
|
|
203
|
+
function generateCliffPath(width, height) {
|
|
204
|
+
const cx = width / 2;
|
|
205
|
+
const topY = height * 0.5;
|
|
206
|
+
const bottomY = height;
|
|
207
|
+
const amplitude = width * 0.03;
|
|
208
|
+
return [
|
|
209
|
+
`M${cx},${topY}`,
|
|
210
|
+
`C${cx + amplitude},${topY + (bottomY - topY) * 0.2}`,
|
|
211
|
+
`${cx - amplitude * 1.5},${topY + (bottomY - topY) * 0.55}`,
|
|
212
|
+
`${cx + amplitude * 0.5},${topY + (bottomY - topY) * 0.75}`,
|
|
213
|
+
`C${cx - amplitude},${topY + (bottomY - topY) * 0.85}`,
|
|
214
|
+
`${cx + amplitude * 0.3},${topY + (bottomY - topY) * 0.95}`,
|
|
215
|
+
`${cx},${bottomY}`
|
|
216
|
+
].join(" ");
|
|
217
|
+
}
|
|
218
|
+
__name(generateCliffPath, "generateCliffPath");
|
|
219
|
+
function generateConfusionPath(cx, cy, rx, ry) {
|
|
220
|
+
return [
|
|
221
|
+
`M${cx - rx},${cy}`,
|
|
222
|
+
`A${rx},${ry} 0 1,1 ${cx + rx},${cy}`,
|
|
223
|
+
`A${rx},${ry} 0 1,1 ${cx - rx},${cy}`,
|
|
224
|
+
"Z"
|
|
225
|
+
].join(" ");
|
|
226
|
+
}
|
|
227
|
+
__name(generateConfusionPath, "generateConfusionPath");
|
|
228
|
+
var DOMAIN_META = {
|
|
229
|
+
complex: { model: "Probe → Sense → Respond", practice: "Emergent Practices" },
|
|
230
|
+
complicated: { model: "Sense → Analyse → Respond", practice: "Good Practices" },
|
|
231
|
+
clear: { model: "Sense → Categorise → Respond", practice: "Best Practices" },
|
|
232
|
+
chaotic: { model: "Act → Sense → Respond", practice: "Novel Practices" },
|
|
233
|
+
confusion: { model: "", practice: "Disorder" }
|
|
234
|
+
};
|
|
235
|
+
var getDomainLayouts = /* @__PURE__ */ __name((width, height) => {
|
|
236
|
+
const hw = width / 2;
|
|
237
|
+
const hh = height / 2;
|
|
238
|
+
return {
|
|
239
|
+
complex: { cx: hw / 2, cy: hh / 2, x: 0, y: 0, w: hw, h: hh },
|
|
240
|
+
complicated: { cx: hw + hw / 2, cy: hh / 2, x: hw, y: 0, w: hw, h: hh },
|
|
241
|
+
chaotic: { cx: hw / 2, cy: hh + hh / 2, x: 0, y: hh, w: hw, h: hh },
|
|
242
|
+
clear: { cx: hw + hw / 2, cy: hh + hh / 2, x: hw, y: hh, w: hw, h: hh },
|
|
243
|
+
confusion: { cx: hw, cy: hh, x: hw * 0.7, y: hh * 0.7, w: hw * 0.6, h: hh * 0.6 }
|
|
244
|
+
};
|
|
245
|
+
}, "getDomainLayouts");
|
|
246
|
+
var getCynefinDomainColors = /* @__PURE__ */ __name(() => {
|
|
247
|
+
const defaultThemeVariables = getThemeVariables3();
|
|
248
|
+
const currentConfig = getConfig();
|
|
249
|
+
const themeVariables = cleanAndMerge(defaultThemeVariables, currentConfig.themeVariables);
|
|
250
|
+
return themeVariables.cynefin;
|
|
251
|
+
}, "getCynefinDomainColors");
|
|
252
|
+
var MAX_CONFUSION_ITEMS = 3;
|
|
253
|
+
var draw = /* @__PURE__ */ __name((_text, id, _version, diagram2) => {
|
|
254
|
+
const db2 = diagram2.db;
|
|
255
|
+
const domains = db2.getDomains();
|
|
256
|
+
const transitions = db2.getTransitions();
|
|
257
|
+
const title = db2.getDiagramTitle();
|
|
258
|
+
const accTitle = db2.getAccTitle();
|
|
259
|
+
const accDescription = db2.getAccDescription();
|
|
260
|
+
const config = db2.getConfig();
|
|
261
|
+
const domainColors = getCynefinDomainColors();
|
|
262
|
+
log.debug("Rendering Cynefin diagram");
|
|
263
|
+
const width = config.width;
|
|
264
|
+
const height = config.height;
|
|
265
|
+
const padding = config.padding;
|
|
266
|
+
const showDomainDescriptions = config.showDomainDescriptions;
|
|
267
|
+
const boundaryAmplitude = config.boundaryAmplitude;
|
|
268
|
+
const totalWidth = width + padding * 2;
|
|
269
|
+
const totalHeight = height + padding * 2;
|
|
270
|
+
const domainBg = {
|
|
271
|
+
complex: domainColors.complexBg,
|
|
272
|
+
complicated: domainColors.complicatedBg,
|
|
273
|
+
clear: domainColors.clearBg,
|
|
274
|
+
chaotic: domainColors.chaoticBg,
|
|
275
|
+
confusion: domainColors.confusionBg
|
|
276
|
+
};
|
|
277
|
+
const svg = selectSvgElement(id);
|
|
278
|
+
configureSvgSize(svg, totalHeight, totalWidth, config.useMaxWidth ?? true);
|
|
279
|
+
svg.attr("viewBox", `0 0 ${totalWidth} ${totalHeight}`);
|
|
280
|
+
if (accTitle) {
|
|
281
|
+
svg.append("title").text(accTitle);
|
|
282
|
+
}
|
|
283
|
+
if (accDescription) {
|
|
284
|
+
svg.append("desc").text(accDescription);
|
|
285
|
+
}
|
|
286
|
+
const root = svg.append("g").attr("transform", `translate(${padding}, ${padding})`);
|
|
287
|
+
const layouts = getDomainLayouts(width, height);
|
|
288
|
+
const seed = resolveSeed(config.seed, id);
|
|
289
|
+
const bgGroup = root.append("g").attr("class", "cynefin-backgrounds");
|
|
290
|
+
const quadrantDomains = ["complex", "complicated", "chaotic", "clear"];
|
|
291
|
+
for (const domainName of quadrantDomains) {
|
|
292
|
+
const layout = layouts[domainName];
|
|
293
|
+
bgGroup.append("rect").attr("class", "cynefinDomain").attr("x", layout.x).attr("y", layout.y).attr("width", layout.w).attr("height", layout.h).attr("fill", domainBg[domainName]).attr("fill-opacity", 0.4).attr("stroke", "none");
|
|
294
|
+
}
|
|
295
|
+
const boundaryGroup = root.append("g").attr("class", "cynefin-boundaries");
|
|
296
|
+
boundaryGroup.append("path").attr("class", "cynefinBoundary").attr("d", generateFoldPath(width, height, seed, boundaryAmplitude)).attr("fill", "none");
|
|
297
|
+
boundaryGroup.append("path").attr("class", "cynefinBoundary").attr("d", generateHorizontalBoundary(width, height, seed + 100, boundaryAmplitude)).attr("fill", "none");
|
|
298
|
+
boundaryGroup.append("path").attr("class", "cynefinCliff").attr("d", generateCliffPath(width, height)).attr("fill", "none");
|
|
299
|
+
const confusionRx = width * 0.15;
|
|
300
|
+
const confusionRy = height * 0.15;
|
|
301
|
+
root.append("path").attr("class", "cynefinConfusion").attr("d", generateConfusionPath(width / 2, height / 2, confusionRx, confusionRy)).attr("fill", domainBg.confusion).attr("fill-opacity", 0.5);
|
|
302
|
+
const labelGroup = root.append("g").attr("class", "cynefin-labels");
|
|
303
|
+
for (const domainName of quadrantDomains) {
|
|
304
|
+
const layout = layouts[domainName];
|
|
305
|
+
labelGroup.append("text").attr("class", "cynefinDomainLabel").attr("x", layout.cx).attr("y", showDomainDescriptions ? layout.cy - 30 : layout.cy).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(domainName.charAt(0).toUpperCase() + domainName.slice(1));
|
|
306
|
+
}
|
|
307
|
+
labelGroup.append("text").attr("class", "cynefinDomainLabel").attr("x", width / 2).attr("y", showDomainDescriptions ? height / 2 - 10 : height / 2).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text("Confusion");
|
|
308
|
+
if (showDomainDescriptions) {
|
|
309
|
+
const subtitleGroup = root.append("g").attr("class", "cynefin-subtitles");
|
|
310
|
+
for (const domainName of quadrantDomains) {
|
|
311
|
+
const layout = layouts[domainName];
|
|
312
|
+
const meta = DOMAIN_META[domainName];
|
|
313
|
+
subtitleGroup.append("text").attr("class", "cynefinSubtitle").attr("x", layout.cx).attr("y", layout.cy - 10).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(meta.model);
|
|
314
|
+
subtitleGroup.append("text").attr("class", "cynefinSubtitle").attr("x", layout.cx).attr("y", layout.cy + 5).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(meta.practice);
|
|
315
|
+
}
|
|
316
|
+
subtitleGroup.append("text").attr("class", "cynefinSubtitle").attr("x", width / 2).attr("y", height / 2 + 8).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(DOMAIN_META.confusion.practice);
|
|
317
|
+
}
|
|
318
|
+
const itemGroup = root.append("g").attr("class", "cynefin-items");
|
|
319
|
+
const itemHeight = 26;
|
|
320
|
+
const itemPaddingX = 10;
|
|
321
|
+
const allDomains = ["complex", "complicated", "chaotic", "clear", "confusion"];
|
|
322
|
+
for (const domainName of allDomains) {
|
|
323
|
+
const domain = domains.get(domainName);
|
|
324
|
+
if (!domain || domain.items.length === 0) {
|
|
325
|
+
continue;
|
|
326
|
+
}
|
|
327
|
+
const layout = layouts[domainName];
|
|
328
|
+
const isConfusion = domainName === "confusion";
|
|
329
|
+
let itemsToRender = domain.items;
|
|
330
|
+
let overflowCount = 0;
|
|
331
|
+
if (isConfusion && domain.items.length > MAX_CONFUSION_ITEMS) {
|
|
332
|
+
overflowCount = domain.items.length - MAX_CONFUSION_ITEMS;
|
|
333
|
+
itemsToRender = domain.items.slice(0, MAX_CONFUSION_ITEMS);
|
|
334
|
+
}
|
|
335
|
+
let startY;
|
|
336
|
+
if (isConfusion) {
|
|
337
|
+
const labelOffset = showDomainDescriptions ? 22 : 14;
|
|
338
|
+
startY = layout.cy + labelOffset;
|
|
339
|
+
} else {
|
|
340
|
+
startY = layout.cy + (showDomainDescriptions ? 25 : 15);
|
|
341
|
+
}
|
|
342
|
+
[...itemsToRender].forEach((item, idx) => {
|
|
343
|
+
const itemY = startY + idx * (itemHeight + 4);
|
|
344
|
+
const g = itemGroup.append("g");
|
|
345
|
+
const textEl = g.append("text").attr("class", "cynefinItemText").attr("x", 0).attr("y", itemHeight / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").text(item.label);
|
|
346
|
+
let measuredWidth = item.label.length * 7;
|
|
347
|
+
const textNode = textEl.node();
|
|
348
|
+
if (textNode && typeof textNode.getBBox === "function") {
|
|
349
|
+
const bbox = textNode.getBBox();
|
|
350
|
+
if (bbox.width > 0) {
|
|
351
|
+
measuredWidth = bbox.width;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
const badgeWidth = measuredWidth + itemPaddingX * 2;
|
|
355
|
+
const itemX = layout.cx - badgeWidth / 2;
|
|
356
|
+
g.attr("transform", `translate(${itemX}, ${itemY})`);
|
|
357
|
+
g.insert("rect", "text").attr("class", "cynefinItem").attr("x", 0).attr("y", 0).attr("width", badgeWidth).attr("height", itemHeight).attr("rx", 4).attr("ry", 4).attr("fill", domainBg[domainName]).attr("fill-opacity", 0.95);
|
|
358
|
+
textEl.attr("x", badgeWidth / 2).attr("y", itemHeight / 2);
|
|
359
|
+
});
|
|
360
|
+
if (overflowCount > 0) {
|
|
361
|
+
const overflowY = startY + itemsToRender.length * (itemHeight + 4);
|
|
362
|
+
const overflowLabel = `+${overflowCount} more`;
|
|
363
|
+
const g = itemGroup.append("g");
|
|
364
|
+
const textEl = g.append("text").attr("class", "cynefinItemText").attr("x", 0).attr("y", itemHeight / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").text(overflowLabel);
|
|
365
|
+
let measuredWidth = overflowLabel.length * 7;
|
|
366
|
+
const textNode = textEl.node();
|
|
367
|
+
if (textNode && typeof textNode.getBBox === "function") {
|
|
368
|
+
const bbox = textNode.getBBox();
|
|
369
|
+
if (bbox.width > 0) {
|
|
370
|
+
measuredWidth = bbox.width;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
const badgeWidth = measuredWidth + itemPaddingX * 2;
|
|
374
|
+
const itemX = layout.cx - badgeWidth / 2;
|
|
375
|
+
g.attr("transform", `translate(${itemX}, ${overflowY})`);
|
|
376
|
+
g.insert("rect", "text").attr("class", "cynefinItemOverflow").attr("x", 0).attr("y", 0).attr("width", badgeWidth).attr("height", itemHeight).attr("rx", 4).attr("ry", 4).attr("fill", domainBg[domainName]).attr("fill-opacity", 0.6);
|
|
377
|
+
textEl.attr("x", badgeWidth / 2).attr("y", itemHeight / 2);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
if (transitions.length > 0) {
|
|
381
|
+
const defs = svg.select("defs").empty() ? svg.append("defs") : svg.select("defs");
|
|
382
|
+
const markerId = `cynefin-arrow-${id}`;
|
|
383
|
+
defs.append("marker").attr("id", markerId).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerWidth", 6).attr("markerHeight", 6).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "cynefinArrowHead");
|
|
384
|
+
const arrowGroup = root.append("g").attr("class", "cynefin-arrows");
|
|
385
|
+
transitions.forEach((transition) => {
|
|
386
|
+
const fromLayout = layouts[transition.from];
|
|
387
|
+
const toLayout = layouts[transition.to];
|
|
388
|
+
if (!fromLayout || !toLayout) {
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
if (transition.from === transition.to) {
|
|
392
|
+
log.warn(`Cynefin renderer: skipping self-loop on domain "${transition.from}"`);
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
const x1 = fromLayout.cx;
|
|
396
|
+
const y1 = fromLayout.cy;
|
|
397
|
+
const x2 = toLayout.cx;
|
|
398
|
+
const y2 = toLayout.cy;
|
|
399
|
+
const mx = (x1 + x2) / 2;
|
|
400
|
+
const my = (y1 + y2) / 2;
|
|
401
|
+
const dx = x2 - x1;
|
|
402
|
+
const dy = y2 - y1;
|
|
403
|
+
const len = Math.sqrt(dx * dx + dy * dy);
|
|
404
|
+
const offsetAmount = len * 0.15;
|
|
405
|
+
const nx = -dy / len;
|
|
406
|
+
const ny = dx / len;
|
|
407
|
+
const cpx = mx + nx * offsetAmount;
|
|
408
|
+
const cpy = my + ny * offsetAmount;
|
|
409
|
+
arrowGroup.append("path").attr("class", "cynefinArrowLine").attr("d", `M${x1},${y1} Q${cpx},${cpy} ${x2},${y2}`).attr("fill", "none").attr("marker-end", `url(#${markerId})`);
|
|
410
|
+
if (transition.label) {
|
|
411
|
+
arrowGroup.append("text").attr("class", "cynefinArrowLabel").attr("x", cpx).attr("y", cpy - 6).attr("text-anchor", "middle").attr("dominant-baseline", "auto").text(transition.label);
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
if (title) {
|
|
416
|
+
root.append("text").attr("class", "cynefinTitle").attr("x", width / 2).attr("y", -padding / 2).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(title);
|
|
417
|
+
}
|
|
418
|
+
}, "draw");
|
|
419
|
+
var renderer = { draw };
|
|
420
|
+
var getCynefinTheme = /* @__PURE__ */ __name(() => {
|
|
421
|
+
const defaultThemeVariables = getThemeVariables3();
|
|
422
|
+
const currentConfig = getConfig();
|
|
423
|
+
const themeVariables = cleanAndMerge(defaultThemeVariables, currentConfig.themeVariables);
|
|
424
|
+
return themeVariables.cynefin;
|
|
425
|
+
}, "getCynefinTheme");
|
|
426
|
+
var styles = /* @__PURE__ */ __name(() => {
|
|
427
|
+
const t = getCynefinTheme();
|
|
428
|
+
return `
|
|
429
|
+
.cynefinDomain {
|
|
430
|
+
stroke: none;
|
|
431
|
+
}
|
|
432
|
+
.cynefinDomainLabel {
|
|
433
|
+
font-size: ${t.domainFontSize}px;
|
|
434
|
+
font-weight: bold;
|
|
435
|
+
fill: ${t.labelColor};
|
|
436
|
+
}
|
|
437
|
+
.cynefinSubtitle {
|
|
438
|
+
font-size: ${t.itemFontSize - 1}px;
|
|
439
|
+
fill: ${t.textColor};
|
|
440
|
+
font-style: italic;
|
|
441
|
+
}
|
|
442
|
+
.cynefinItem {
|
|
443
|
+
fill-opacity: 0.95;
|
|
444
|
+
stroke: ${t.boundaryColor};
|
|
445
|
+
stroke-width: 1;
|
|
446
|
+
}
|
|
447
|
+
.cynefinItemText {
|
|
448
|
+
font-size: ${t.itemFontSize}px;
|
|
449
|
+
fill: ${t.textColor};
|
|
450
|
+
}
|
|
451
|
+
.cynefinItemOverflow {
|
|
452
|
+
fill-opacity: 0.6;
|
|
453
|
+
stroke: ${t.boundaryColor};
|
|
454
|
+
stroke-width: 1;
|
|
455
|
+
stroke-dasharray: 3 2;
|
|
456
|
+
}
|
|
457
|
+
.cynefinBoundary {
|
|
458
|
+
stroke: ${t.boundaryColor};
|
|
459
|
+
stroke-width: ${t.boundaryWidth};
|
|
460
|
+
stroke-dasharray: 6 3;
|
|
461
|
+
}
|
|
462
|
+
.cynefinCliff {
|
|
463
|
+
stroke: ${t.cliffColor};
|
|
464
|
+
stroke-width: ${t.cliffWidth};
|
|
465
|
+
}
|
|
466
|
+
.cynefinConfusion {
|
|
467
|
+
stroke: ${t.boundaryColor};
|
|
468
|
+
stroke-width: 1.5;
|
|
469
|
+
stroke-dasharray: 4 2;
|
|
470
|
+
}
|
|
471
|
+
.cynefinArrowLine {
|
|
472
|
+
stroke: ${t.arrowColor};
|
|
473
|
+
stroke-width: ${t.arrowWidth};
|
|
474
|
+
fill: none;
|
|
475
|
+
}
|
|
476
|
+
.cynefinArrowHead {
|
|
477
|
+
fill: ${t.arrowColor};
|
|
478
|
+
stroke: none;
|
|
479
|
+
}
|
|
480
|
+
.cynefinArrowLabel {
|
|
481
|
+
font-size: ${t.itemFontSize - 1}px;
|
|
482
|
+
fill: ${t.textColor};
|
|
483
|
+
}
|
|
484
|
+
.cynefinTitle {
|
|
485
|
+
font-size: ${t.domainFontSize + 2}px;
|
|
486
|
+
font-weight: bold;
|
|
487
|
+
fill: ${t.labelColor};
|
|
488
|
+
}
|
|
489
|
+
`;
|
|
490
|
+
}, "styles");
|
|
491
|
+
var styles_default = styles;
|
|
492
|
+
var diagram = {
|
|
493
|
+
parser,
|
|
494
|
+
db,
|
|
495
|
+
renderer,
|
|
496
|
+
styles: styles_default
|
|
497
|
+
};
|
|
498
|
+
export {
|
|
499
|
+
diagram
|
|
500
|
+
};
|