schematex 0.9.1 → 0.9.3
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/README.md +21 -0
- package/dist/ai/ai-sdk.cjs +24 -24
- package/dist/ai/ai-sdk.d.cts +3 -3
- package/dist/ai/ai-sdk.d.ts +3 -3
- package/dist/ai/ai-sdk.js +19 -19
- package/dist/ai/index.cjs +33 -33
- package/dist/ai/index.d.cts +4 -4
- package/dist/ai/index.d.ts +4 -4
- package/dist/ai/index.js +20 -20
- package/dist/{api-OED2jUVj.d.ts → api-B7C7qGiG.d.cts} +2 -2
- package/dist/{api-BDMaX1cT.d.cts → api-DXOhuK3e.d.ts} +2 -2
- package/dist/browser.cjs +25 -25
- package/dist/browser.d.cts +3 -3
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +19 -19
- package/dist/{chunk-JN6FHUC6.js → chunk-4CLAD7VZ.js} +3 -3
- package/dist/{chunk-JN6FHUC6.js.map → chunk-4CLAD7VZ.js.map} +1 -1
- package/dist/{chunk-YTGOLTLJ.js → chunk-6GHXO3WQ.js} +4 -4
- package/dist/{chunk-YTGOLTLJ.js.map → chunk-6GHXO3WQ.js.map} +1 -1
- package/dist/{chunk-T5KHNJ67.cjs → chunk-6W6RFZND.cjs} +6 -6
- package/dist/{chunk-T5KHNJ67.cjs.map → chunk-6W6RFZND.cjs.map} +1 -1
- package/dist/{chunk-KF3DFASA.js → chunk-7P4C5DMD.js} +3 -3
- package/dist/chunk-7P4C5DMD.js.map +1 -0
- package/dist/{chunk-KGOZBABH.cjs → chunk-AEZVCGH4.cjs} +12 -12
- package/dist/{chunk-KGOZBABH.cjs.map → chunk-AEZVCGH4.cjs.map} +1 -1
- package/dist/{chunk-QYC6WZEM.cjs → chunk-AHSSFGDJ.cjs} +3064 -511
- package/dist/chunk-AHSSFGDJ.cjs.map +1 -0
- package/dist/{chunk-FJVQGBPU.cjs → chunk-ATE7LD6I.cjs} +5 -5
- package/dist/{chunk-FJVQGBPU.cjs.map → chunk-ATE7LD6I.cjs.map} +1 -1
- package/dist/{chunk-VOJGLBE5.js → chunk-BP6MLXJU.js} +2890 -338
- package/dist/chunk-BP6MLXJU.js.map +1 -0
- package/dist/{chunk-YMFYPB5Y.cjs → chunk-BXS53MLV.cjs} +4 -4
- package/dist/{chunk-YMFYPB5Y.cjs.map → chunk-BXS53MLV.cjs.map} +1 -1
- package/dist/{chunk-B5AQ3CG3.cjs → chunk-C2BNO3CI.cjs} +16 -13
- package/dist/chunk-C2BNO3CI.cjs.map +1 -0
- package/dist/{chunk-NZT5P2XZ.cjs → chunk-CAAMBDEN.cjs} +347 -2
- package/dist/chunk-CAAMBDEN.cjs.map +1 -0
- package/dist/{chunk-UK6HF6PE.js → chunk-D4QZ6UDO.js} +342 -3
- package/dist/chunk-D4QZ6UDO.js.map +1 -0
- package/dist/{chunk-DHI7YAQJ.cjs → chunk-FFAJQ36U.cjs} +15 -15
- package/dist/{chunk-DHI7YAQJ.cjs.map → chunk-FFAJQ36U.cjs.map} +1 -1
- package/dist/{chunk-LENRV7ZJ.cjs → chunk-IOD2EFMX.cjs} +5 -5
- package/dist/chunk-IOD2EFMX.cjs.map +1 -0
- package/dist/{chunk-JIUC4DRS.cjs → chunk-IU26USXA.cjs} +6 -6
- package/dist/chunk-IU26USXA.cjs.map +1 -0
- package/dist/{chunk-Z5ML4QYG.js → chunk-JCJWSW5Y.js} +406 -4
- package/dist/chunk-JCJWSW5Y.js.map +1 -0
- package/dist/{chunk-DX44TBFZ.js → chunk-JEQGWH5N.js} +20 -28
- package/dist/chunk-JEQGWH5N.js.map +1 -0
- package/dist/{chunk-NXU4XKLY.cjs → chunk-JHJJT5H5.cjs} +9 -7
- package/dist/chunk-JHJJT5H5.cjs.map +1 -0
- package/dist/{chunk-AJJYWXZB.cjs → chunk-JYAL26WQ.cjs} +4 -4
- package/dist/chunk-JYAL26WQ.cjs.map +1 -0
- package/dist/{chunk-2R4UXKCT.cjs → chunk-LFJE64RD.cjs} +408 -6
- package/dist/chunk-LFJE64RD.cjs.map +1 -0
- package/dist/{chunk-IXRPRMHI.js → chunk-MTIZIHWE.js} +9 -7
- package/dist/chunk-MTIZIHWE.js.map +1 -0
- package/dist/{chunk-NFZMNKOR.cjs → chunk-MZWVJFTV.cjs} +15 -15
- package/dist/{chunk-NFZMNKOR.cjs.map → chunk-MZWVJFTV.cjs.map} +1 -1
- package/dist/{chunk-6L46VIXI.cjs → chunk-O6A2GJLI.cjs} +20 -28
- package/dist/chunk-O6A2GJLI.cjs.map +1 -0
- package/dist/{chunk-K2D6VFLP.js → chunk-OND4N5ZZ.js} +78 -22
- package/dist/chunk-OND4N5ZZ.js.map +1 -0
- package/dist/{chunk-J34HDRFY.js → chunk-PUD7PIY5.js} +4 -4
- package/dist/{chunk-J34HDRFY.js.map → chunk-PUD7PIY5.js.map} +1 -1
- package/dist/{chunk-6NUAGU6O.js → chunk-PZCYFT2A.js} +3 -3
- package/dist/{chunk-6NUAGU6O.js.map → chunk-PZCYFT2A.js.map} +1 -1
- package/dist/{chunk-EBX4KCYW.js → chunk-QHZEGWE7.js} +4 -4
- package/dist/{chunk-EBX4KCYW.js.map → chunk-QHZEGWE7.js.map} +1 -1
- package/dist/{chunk-ABCMTAOZ.js → chunk-TDSGQT7R.js} +7 -4
- package/dist/chunk-TDSGQT7R.js.map +1 -0
- package/dist/{chunk-47SGK5R6.cjs → chunk-TFNH2NLJ.cjs} +5 -5
- package/dist/{chunk-47SGK5R6.cjs.map → chunk-TFNH2NLJ.cjs.map} +1 -1
- package/dist/{chunk-CDK7KDIW.js → chunk-U4AJLMHC.js} +4 -4
- package/dist/{chunk-CDK7KDIW.js.map → chunk-U4AJLMHC.js.map} +1 -1
- package/dist/{chunk-UOM3EDE6.js → chunk-UNLLWCQK.js} +3 -3
- package/dist/{chunk-UOM3EDE6.js.map → chunk-UNLLWCQK.js.map} +1 -1
- package/dist/{chunk-D34VGLSE.cjs → chunk-VG5LP5A4.cjs} +5 -5
- package/dist/{chunk-D34VGLSE.cjs.map → chunk-VG5LP5A4.cjs.map} +1 -1
- package/dist/{chunk-Q2YRJHFB.cjs → chunk-VOFND6ZQ.cjs} +7 -7
- package/dist/chunk-VOFND6ZQ.cjs.map +1 -0
- package/dist/{chunk-JGCKW5RS.js → chunk-X3GEGVW2.js} +5 -5
- package/dist/chunk-X3GEGVW2.js.map +1 -0
- package/dist/{chunk-GDZNTILD.js → chunk-XAYD5NVJ.js} +4 -4
- package/dist/chunk-XAYD5NVJ.js.map +1 -0
- package/dist/{chunk-2SZJQVPN.cjs → chunk-Y4OBXYGW.cjs} +87 -30
- package/dist/chunk-Y4OBXYGW.cjs.map +1 -0
- package/dist/{chunk-E7LXMEKX.js → chunk-ZQECHIBI.js} +3 -3
- package/dist/{chunk-E7LXMEKX.js.map → chunk-ZQECHIBI.js.map} +1 -1
- package/dist/{chunk-E3CAJGJM.js → chunk-ZUK4BY55.js} +6 -6
- package/dist/chunk-ZUK4BY55.js.map +1 -0
- package/dist/{diagnostics-hObcaaFC.d.ts → diagnostics-fyjWjeDa.d.cts} +1 -1
- package/dist/{diagnostics-hObcaaFC.d.cts → diagnostics-fyjWjeDa.d.ts} +1 -1
- package/dist/diagrams/blockdiagram/index.cjs +6 -5
- package/dist/diagrams/blockdiagram/index.d.cts +2 -2
- package/dist/diagrams/blockdiagram/index.d.ts +2 -2
- package/dist/diagrams/blockdiagram/index.js +2 -1
- package/dist/diagrams/circuit/index.cjs +9 -9
- package/dist/diagrams/circuit/index.d.cts +1 -1
- package/dist/diagrams/circuit/index.d.ts +1 -1
- package/dist/diagrams/circuit/index.js +2 -2
- package/dist/diagrams/ecomap/index.cjs +7 -7
- package/dist/diagrams/ecomap/index.d.cts +1 -1
- package/dist/diagrams/ecomap/index.d.ts +1 -1
- package/dist/diagrams/ecomap/index.js +2 -2
- package/dist/diagrams/entity/index.cjs +6 -6
- package/dist/diagrams/entity/index.d.cts +1 -1
- package/dist/diagrams/entity/index.d.ts +1 -1
- package/dist/diagrams/entity/index.js +2 -2
- package/dist/diagrams/fishbone/index.cjs +8 -8
- package/dist/diagrams/fishbone/index.d.cts +1 -1
- package/dist/diagrams/fishbone/index.d.ts +1 -1
- package/dist/diagrams/fishbone/index.js +2 -2
- package/dist/diagrams/flowchart/index.cjs +8 -8
- package/dist/diagrams/flowchart/index.d.cts +2 -2
- package/dist/diagrams/flowchart/index.d.ts +2 -2
- package/dist/diagrams/flowchart/index.js +2 -2
- package/dist/diagrams/genogram/index.cjs +9 -9
- package/dist/diagrams/genogram/index.d.cts +1 -1
- package/dist/diagrams/genogram/index.d.ts +1 -1
- package/dist/diagrams/genogram/index.js +2 -2
- package/dist/diagrams/ladder/index.cjs +6 -6
- package/dist/diagrams/ladder/index.d.cts +1 -1
- package/dist/diagrams/ladder/index.d.ts +1 -1
- package/dist/diagrams/ladder/index.js +2 -2
- package/dist/diagrams/logic/index.cjs +8 -8
- package/dist/diagrams/logic/index.d.cts +1 -1
- package/dist/diagrams/logic/index.d.ts +1 -1
- package/dist/diagrams/logic/index.js +2 -2
- package/dist/diagrams/orgchart/index.cjs +8 -8
- package/dist/diagrams/orgchart/index.d.cts +1 -1
- package/dist/diagrams/orgchart/index.d.ts +1 -1
- package/dist/diagrams/orgchart/index.js +2 -2
- package/dist/diagrams/pedigree/index.cjs +7 -7
- package/dist/diagrams/pedigree/index.d.cts +1 -1
- package/dist/diagrams/pedigree/index.d.ts +1 -1
- package/dist/diagrams/pedigree/index.js +2 -2
- package/dist/diagrams/phylo/index.cjs +7 -7
- package/dist/diagrams/phylo/index.d.cts +1 -1
- package/dist/diagrams/phylo/index.d.ts +1 -1
- package/dist/diagrams/phylo/index.js +2 -2
- package/dist/diagrams/sld/index.cjs +8 -8
- package/dist/diagrams/sld/index.d.cts +1 -1
- package/dist/diagrams/sld/index.d.ts +1 -1
- package/dist/diagrams/sld/index.js +2 -2
- package/dist/diagrams/sociogram/index.cjs +6 -6
- package/dist/diagrams/sociogram/index.d.cts +1 -1
- package/dist/diagrams/sociogram/index.d.ts +1 -1
- package/dist/diagrams/sociogram/index.js +2 -2
- package/dist/diagrams/timing/index.cjs +4 -4
- package/dist/diagrams/timing/index.d.cts +1 -1
- package/dist/diagrams/timing/index.d.ts +1 -1
- package/dist/diagrams/timing/index.js +1 -1
- package/dist/diagrams/venn/index.cjs +9 -9
- package/dist/diagrams/venn/index.d.cts +1 -1
- package/dist/diagrams/venn/index.d.ts +1 -1
- package/dist/diagrams/venn/index.js +2 -2
- package/dist/{index-Cq8y1aaa.d.ts → index-CFaKjWPy.d.ts} +1 -1
- package/dist/{index-BiXWjQht.d.cts → index-DZNmJWGg.d.cts} +1 -1
- package/dist/index.cjs +113 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +49 -23
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +19 -19
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +18 -18
- package/dist/{tools-D5dkAqNy.d.cts → tools-BDNih0Mb.d.ts} +3 -3
- package/dist/{tools-BbTuTWs_.d.ts → tools-C23t_WeN.d.cts} +3 -3
- package/package.json +1 -1
- package/dist/chunk-2R4UXKCT.cjs.map +0 -1
- package/dist/chunk-2SZJQVPN.cjs.map +0 -1
- package/dist/chunk-6L46VIXI.cjs.map +0 -1
- package/dist/chunk-ABCMTAOZ.js.map +0 -1
- package/dist/chunk-AJJYWXZB.cjs.map +0 -1
- package/dist/chunk-B5AQ3CG3.cjs.map +0 -1
- package/dist/chunk-DX44TBFZ.js.map +0 -1
- package/dist/chunk-E3CAJGJM.js.map +0 -1
- package/dist/chunk-GDZNTILD.js.map +0 -1
- package/dist/chunk-IXRPRMHI.js.map +0 -1
- package/dist/chunk-JGCKW5RS.js.map +0 -1
- package/dist/chunk-JIUC4DRS.cjs.map +0 -1
- package/dist/chunk-K2D6VFLP.js.map +0 -1
- package/dist/chunk-KF3DFASA.js.map +0 -1
- package/dist/chunk-LENRV7ZJ.cjs.map +0 -1
- package/dist/chunk-NXU4XKLY.cjs.map +0 -1
- package/dist/chunk-NZT5P2XZ.cjs.map +0 -1
- package/dist/chunk-Q2YRJHFB.cjs.map +0 -1
- package/dist/chunk-QYC6WZEM.cjs.map +0 -1
- package/dist/chunk-UK6HF6PE.js.map +0 -1
- package/dist/chunk-VOJGLBE5.js.map +0 -1
- package/dist/chunk-Z5ML4QYG.js.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
3
|
+
var chunkVOFND6ZQ_cjs = require('./chunk-VOFND6ZQ.cjs');
|
|
4
|
+
var chunkATE7LD6I_cjs = require('./chunk-ATE7LD6I.cjs');
|
|
5
|
+
var chunkO6A2GJLI_cjs = require('./chunk-O6A2GJLI.cjs');
|
|
6
|
+
var chunkIU26USXA_cjs = require('./chunk-IU26USXA.cjs');
|
|
7
|
+
var chunkJYAL26WQ_cjs = require('./chunk-JYAL26WQ.cjs');
|
|
8
|
+
var chunkIOD2EFMX_cjs = require('./chunk-IOD2EFMX.cjs');
|
|
9
|
+
var chunk6W6RFZND_cjs = require('./chunk-6W6RFZND.cjs');
|
|
10
|
+
var chunkBXS53MLV_cjs = require('./chunk-BXS53MLV.cjs');
|
|
11
|
+
var chunkTFNH2NLJ_cjs = require('./chunk-TFNH2NLJ.cjs');
|
|
12
|
+
var chunkMZWVJFTV_cjs = require('./chunk-MZWVJFTV.cjs');
|
|
13
|
+
var chunkY4OBXYGW_cjs = require('./chunk-Y4OBXYGW.cjs');
|
|
14
|
+
var chunkAEZVCGH4_cjs = require('./chunk-AEZVCGH4.cjs');
|
|
15
15
|
var chunk3KRL2EGN_cjs = require('./chunk-3KRL2EGN.cjs');
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
16
|
+
var chunkFFAJQ36U_cjs = require('./chunk-FFAJQ36U.cjs');
|
|
17
|
+
var chunkC2BNO3CI_cjs = require('./chunk-C2BNO3CI.cjs');
|
|
18
|
+
var chunkJHJJT5H5_cjs = require('./chunk-JHJJT5H5.cjs');
|
|
19
|
+
var chunkVG5LP5A4_cjs = require('./chunk-VG5LP5A4.cjs');
|
|
20
|
+
var chunkCAAMBDEN_cjs = require('./chunk-CAAMBDEN.cjs');
|
|
21
21
|
var chunkVHDSPI6A_cjs = require('./chunk-VHDSPI6A.cjs');
|
|
22
22
|
var chunk3WNW5Y7P_cjs = require('./chunk-3WNW5Y7P.cjs');
|
|
23
23
|
|
|
@@ -1211,7 +1211,7 @@ function round2(n) {
|
|
|
1211
1211
|
return Math.round(n * 100) / 100;
|
|
1212
1212
|
}
|
|
1213
1213
|
function renderInfluence(ast, config) {
|
|
1214
|
-
const t =
|
|
1214
|
+
const t = chunkCAAMBDEN_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
1215
1215
|
const layout = layoutInfluence(ast);
|
|
1216
1216
|
const titleOffset = ast.title ? 36 : 10;
|
|
1217
1217
|
const width = Math.ceil(layout.width);
|
|
@@ -1255,7 +1255,7 @@ var CLASS_PALETTE = [
|
|
|
1255
1255
|
function buildCss2(t) {
|
|
1256
1256
|
return `
|
|
1257
1257
|
.lt-dtree { font-family: system-ui, -apple-system, sans-serif; }
|
|
1258
|
-
.lt-dtree-title { font:
|
|
1258
|
+
.lt-dtree-title { font: 700 16px sans-serif; fill: ${t.text}; }
|
|
1259
1259
|
.lt-dtree-edge { fill: none; stroke: ${t.stroke}; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
|
|
1260
1260
|
.lt-dtree-edge-optimal { fill: none; stroke: ${t.positive}; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
|
|
1261
1261
|
.lt-dtree-edge-leader { fill: none; stroke: ${t.stroke}; stroke-width: 1; stroke-dasharray: 2 2; opacity: 0.55; }
|
|
@@ -1577,7 +1577,7 @@ function wrapText(text2, maxChars) {
|
|
|
1577
1577
|
}
|
|
1578
1578
|
function renderDecisionTree(ast, config) {
|
|
1579
1579
|
if ("arcs" in ast) return renderInfluence(ast, config);
|
|
1580
|
-
const t =
|
|
1580
|
+
const t = chunkCAAMBDEN_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
1581
1581
|
const layout = layoutDecisionTree(ast);
|
|
1582
1582
|
const titleOffset = ast.title ? 36 : 10;
|
|
1583
1583
|
const width = Math.ceil(layout.width);
|
|
@@ -1587,7 +1587,7 @@ function renderDecisionTree(ast, config) {
|
|
|
1587
1587
|
children.push(chunk3WNW5Y7P_cjs.desc(`Decision tree (${ast.mode} mode) with ${layout.nodes.length} nodes and ${layout.edges.length} edges`));
|
|
1588
1588
|
children.push(chunk3WNW5Y7P_cjs.el("style", {}, buildCss2(t)));
|
|
1589
1589
|
if (ast.title) {
|
|
1590
|
-
children.push(chunk3WNW5Y7P_cjs.text({ x:
|
|
1590
|
+
children.push(chunk3WNW5Y7P_cjs.text({ x: width / 2, y: 24, class: "lt-dtree-title", "text-anchor": "middle" }, ast.title));
|
|
1591
1591
|
}
|
|
1592
1592
|
const inner = [];
|
|
1593
1593
|
for (const e of layout.edges) {
|
|
@@ -2285,11 +2285,11 @@ function layoutSwimlane(ast) {
|
|
|
2285
2285
|
];
|
|
2286
2286
|
let labelY = candidates[0];
|
|
2287
2287
|
for (const y of candidates) {
|
|
2288
|
-
const
|
|
2289
|
-
const collide = labelBoxes.some((b) => Math.abs(b.y -
|
|
2288
|
+
const box2 = { x1: x - labelW / 2, x2: x + labelW / 2, y };
|
|
2289
|
+
const collide = labelBoxes.some((b) => Math.abs(b.y - box2.y) < 13 && b.x1 < box2.x2 && b.x2 > box2.x1);
|
|
2290
2290
|
if (!collide) {
|
|
2291
2291
|
labelY = y;
|
|
2292
|
-
labelBoxes.push(
|
|
2292
|
+
labelBoxes.push(box2);
|
|
2293
2293
|
break;
|
|
2294
2294
|
}
|
|
2295
2295
|
}
|
|
@@ -2450,10 +2450,10 @@ function layoutGantt(ast) {
|
|
|
2450
2450
|
let labelY = pinZoneTop + 12;
|
|
2451
2451
|
let step = 0;
|
|
2452
2452
|
while (step < 4) {
|
|
2453
|
-
const
|
|
2454
|
-
const collide = pinBoxes.some((b) => Math.abs(b.y -
|
|
2453
|
+
const box2 = { x1: x - labelW / 2, x2: x + labelW / 2, y: labelY };
|
|
2454
|
+
const collide = pinBoxes.some((b) => Math.abs(b.y - box2.y) < 14 && b.x1 < box2.x2 && b.x2 > box2.x1);
|
|
2455
2455
|
if (!collide) {
|
|
2456
|
-
pinBoxes.push(
|
|
2456
|
+
pinBoxes.push(box2);
|
|
2457
2457
|
break;
|
|
2458
2458
|
}
|
|
2459
2459
|
labelY += 16;
|
|
@@ -2650,7 +2650,7 @@ var ERA_ROW_GAP = 2;
|
|
|
2650
2650
|
function renderTimeline(src, config) {
|
|
2651
2651
|
const ast = parseTimeline(src);
|
|
2652
2652
|
const layout = layoutTimeline(ast);
|
|
2653
|
-
const theme =
|
|
2653
|
+
const theme = chunkCAAMBDEN_cjs.resolveTimelineTheme(config?.theme ?? "default");
|
|
2654
2654
|
const styleBlock = styleForTheme(theme, config?.fontFamily);
|
|
2655
2655
|
const children = [
|
|
2656
2656
|
chunk3WNW5Y7P_cjs.title(ast.title ? `Timeline \u2014 ${ast.title}` : "Timeline"),
|
|
@@ -2695,7 +2695,7 @@ function renderTimeline(src, config) {
|
|
|
2695
2695
|
function styleForTheme(theme, fontFamily) {
|
|
2696
2696
|
const font = fontFamily ?? "system-ui, -apple-system, sans-serif";
|
|
2697
2697
|
return `
|
|
2698
|
-
.st-timeline { ${
|
|
2698
|
+
.st-timeline { ${chunkCAAMBDEN_cjs.cssCustomProperties(theme)}
|
|
2699
2699
|
--st-axis: ${theme.axis};
|
|
2700
2700
|
--st-axis-label: ${theme.axisLabel};
|
|
2701
2701
|
--st-era-label: ${theme.eraLabel};
|
|
@@ -3831,7 +3831,7 @@ function layoutStateDiagram(ast) {
|
|
|
3831
3831
|
}
|
|
3832
3832
|
return true;
|
|
3833
3833
|
});
|
|
3834
|
-
const fcResult =
|
|
3834
|
+
const fcResult = chunkTFNH2NLJ_cjs.layoutFlowchart(fcAst);
|
|
3835
3835
|
const stateById = /* @__PURE__ */ new Map();
|
|
3836
3836
|
const collectStates = (s) => {
|
|
3837
3837
|
stateById.set(s.id, s);
|
|
@@ -4126,40 +4126,42 @@ function shiftPathY(d, dy) {
|
|
|
4126
4126
|
|
|
4127
4127
|
// src/diagrams/state/renderer.ts
|
|
4128
4128
|
var ARROW_MARKER_ID = "lt-state-arrow";
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
.lt-state-
|
|
4132
|
-
.lt-state-
|
|
4133
|
-
.lt-state-
|
|
4129
|
+
function buildStyle(t) {
|
|
4130
|
+
return `
|
|
4131
|
+
.lt-state-body { fill: ${t.stateFill}; stroke: ${t.stateStroke}; stroke-width: 1.6; }
|
|
4132
|
+
.lt-state-name { font: 600 12px system-ui, sans-serif; fill: ${t.stateText}; }
|
|
4133
|
+
.lt-state-div { stroke: ${t.stateStroke}; stroke-width: 1; }
|
|
4134
|
+
.lt-state-activity { font: 11px ui-monospace, monospace; fill: ${t.activityText}; }
|
|
4134
4135
|
|
|
4135
|
-
.lt-composite-body { fill:
|
|
4136
|
-
.lt-composite-title { font: 600 12px system-ui, sans-serif; fill:
|
|
4137
|
-
.lt-composite-titlebar { fill:
|
|
4138
|
-
.lt-region-div { stroke:
|
|
4136
|
+
.lt-composite-body { fill: ${t.compositeFill}; stroke: ${t.stateStroke}; stroke-width: 1.6; }
|
|
4137
|
+
.lt-composite-title { font: 600 12px system-ui, sans-serif; fill: ${t.stateText}; }
|
|
4138
|
+
.lt-composite-titlebar { fill: ${t.compositeTitlebar}; stroke: ${t.stateStroke}; stroke-width: 1; }
|
|
4139
|
+
.lt-region-div { stroke: ${t.regionDiv}; stroke-width: 1; stroke-dasharray: 6 4; }
|
|
4139
4140
|
|
|
4140
|
-
.lt-ps-initial { fill:
|
|
4141
|
-
.lt-ps-final-outer { fill:
|
|
4142
|
-
.lt-ps-final-inner { fill:
|
|
4143
|
-
.lt-ps-choice { fill:
|
|
4144
|
-
.lt-ps-junction { fill:
|
|
4145
|
-
.lt-ps-bar { fill:
|
|
4146
|
-
.lt-ps-history-body { fill:
|
|
4147
|
-
.lt-ps-history-text { font: 600 11px serif; fill:
|
|
4148
|
-
.lt-ps-terminate { stroke:
|
|
4149
|
-
.lt-ps-entrypoint { fill:
|
|
4150
|
-
.lt-ps-exitpoint { fill:
|
|
4141
|
+
.lt-ps-initial { fill: ${t.psInk}; }
|
|
4142
|
+
.lt-ps-final-outer { fill: ${t.stateFill}; stroke: ${t.psInk}; stroke-width: 1.6; }
|
|
4143
|
+
.lt-ps-final-inner { fill: ${t.psInk}; }
|
|
4144
|
+
.lt-ps-choice { fill: ${t.stateFill}; stroke: ${t.psInk}; stroke-width: 1.6; }
|
|
4145
|
+
.lt-ps-junction { fill: ${t.psInk}; }
|
|
4146
|
+
.lt-ps-bar { fill: ${t.psInk}; }
|
|
4147
|
+
.lt-ps-history-body { fill: ${t.stateFill}; stroke: ${t.psInk}; stroke-width: 1.6; }
|
|
4148
|
+
.lt-ps-history-text { font: 600 11px serif; fill: ${t.psInk}; }
|
|
4149
|
+
.lt-ps-terminate { stroke: ${t.psInk}; stroke-width: 2; }
|
|
4150
|
+
.lt-ps-entrypoint { fill: ${t.stateFill}; stroke: ${t.psInk}; stroke-width: 1.6; }
|
|
4151
|
+
.lt-ps-exitpoint { fill: ${t.stateFill}; stroke: ${t.psInk}; stroke-width: 1.6; }
|
|
4151
4152
|
|
|
4152
|
-
.lt-transition { stroke:
|
|
4153
|
-
.lt-transition-label { font: 11px system-ui, sans-serif; fill:
|
|
4154
|
-
.lt-transition-label-bg { fill:
|
|
4153
|
+
.lt-transition { stroke: ${t.transitionStroke}; stroke-width: 1.4; fill: none; }
|
|
4154
|
+
.lt-transition-label { font: 11px system-ui, sans-serif; fill: ${t.transitionLabel}; }
|
|
4155
|
+
.lt-transition-label-bg { fill: ${t.labelBg}; opacity: 0.92; }
|
|
4155
4156
|
|
|
4156
|
-
.lt-note-body { fill:
|
|
4157
|
-
.lt-note-text { font: 11px system-ui, sans-serif; fill:
|
|
4158
|
-
.lt-note-leader { stroke:
|
|
4157
|
+
.lt-note-body { fill: ${t.noteFill}; stroke: ${t.noteStroke}; stroke-width: 1; }
|
|
4158
|
+
.lt-note-text { font: 11px system-ui, sans-serif; fill: ${t.noteText}; }
|
|
4159
|
+
.lt-note-leader { stroke: ${t.noteStroke}; stroke-width: 1; stroke-dasharray: 3 3; fill: none; }
|
|
4159
4160
|
|
|
4160
|
-
.lt-title { font:
|
|
4161
|
+
.lt-title { font: 700 16px system-ui, sans-serif; fill: ${t.stateText}; }
|
|
4161
4162
|
`;
|
|
4162
|
-
|
|
4163
|
+
}
|
|
4164
|
+
function renderArrowMarker(t) {
|
|
4163
4165
|
return chunk3WNW5Y7P_cjs.el(
|
|
4164
4166
|
"marker",
|
|
4165
4167
|
{
|
|
@@ -4171,7 +4173,7 @@ function renderArrowMarker() {
|
|
|
4171
4173
|
orient: "auto",
|
|
4172
4174
|
markerUnits: "strokeWidth"
|
|
4173
4175
|
},
|
|
4174
|
-
[chunk3WNW5Y7P_cjs.polygon({ points: "0,0 10,3 0,6", fill:
|
|
4176
|
+
[chunk3WNW5Y7P_cjs.polygon({ points: "0,0 10,3 0,6", fill: t.transitionStroke })]
|
|
4175
4177
|
);
|
|
4176
4178
|
}
|
|
4177
4179
|
function activityText2(a) {
|
|
@@ -4402,12 +4404,12 @@ function renderNote(n) {
|
|
|
4402
4404
|
}
|
|
4403
4405
|
return chunk3WNW5Y7P_cjs.group({ class: "lt-note", "data-target": n.note.target }, parts);
|
|
4404
4406
|
}
|
|
4405
|
-
function renderStateDiagram(ast,
|
|
4407
|
+
function renderStateDiagram(ast, config) {
|
|
4406
4408
|
const layout = layoutStateDiagram(ast);
|
|
4407
|
-
return renderLayout(layout);
|
|
4409
|
+
return renderLayout(layout, chunkCAAMBDEN_cjs.resolveStateTheme(config?.theme ?? "default"));
|
|
4408
4410
|
}
|
|
4409
|
-
function renderLayout(layout) {
|
|
4410
|
-
const titleNode = layout.title ? chunk3WNW5Y7P_cjs.text({ x:
|
|
4411
|
+
function renderLayout(layout, t) {
|
|
4412
|
+
const titleNode = layout.title ? chunk3WNW5Y7P_cjs.text({ x: layout.width / 2, y: 22, class: "lt-title", "text-anchor": "middle" }, layout.title) : "";
|
|
4411
4413
|
return chunk3WNW5Y7P_cjs.svgRoot(
|
|
4412
4414
|
{
|
|
4413
4415
|
width: layout.width,
|
|
@@ -4419,7 +4421,7 @@ function renderLayout(layout) {
|
|
|
4419
4421
|
[
|
|
4420
4422
|
chunk3WNW5Y7P_cjs.el("title", {}, chunk3WNW5Y7P_cjs.escapeXml(`State Diagram${layout.title ? " \u2014 " + layout.title : ""}`)),
|
|
4421
4423
|
chunk3WNW5Y7P_cjs.el("desc", {}, "UML 2.5 / Harel statechart rendered by Schematex"),
|
|
4422
|
-
chunk3WNW5Y7P_cjs.defs([renderArrowMarker(), chunk3WNW5Y7P_cjs.el("style", {},
|
|
4424
|
+
chunk3WNW5Y7P_cjs.defs([renderArrowMarker(t), chunk3WNW5Y7P_cjs.el("style", {}, buildStyle(t))]),
|
|
4423
4425
|
titleNode,
|
|
4424
4426
|
// Composite clusters first so simple-state bodies sit on top.
|
|
4425
4427
|
chunk3WNW5Y7P_cjs.group({ class: "lt-clusters" }, layout.clusters.map(renderComposite)),
|
|
@@ -4439,7 +4441,7 @@ var state = {
|
|
|
4439
4441
|
parse: parseStateDiagram,
|
|
4440
4442
|
render(text2, config) {
|
|
4441
4443
|
const ast = parseStateDiagram(text2);
|
|
4442
|
-
return renderStateDiagram(ast);
|
|
4444
|
+
return renderStateDiagram(ast, config);
|
|
4443
4445
|
}
|
|
4444
4446
|
};
|
|
4445
4447
|
|
|
@@ -5789,7 +5791,7 @@ function resolveAnchor(id, port, fallback, equipById, instById) {
|
|
|
5789
5791
|
}
|
|
5790
5792
|
|
|
5791
5793
|
// src/diagrams/pid/renderer.ts
|
|
5792
|
-
var
|
|
5794
|
+
var STYLE = `
|
|
5793
5795
|
.lt-pid-equip { fill: #ffffff; stroke: #1d1d1d; stroke-width: 1.6; }
|
|
5794
5796
|
.lt-pid-equip-tag { font: 600 11px system-ui, sans-serif; fill: #1d1d1d; }
|
|
5795
5797
|
.lt-pid-tray-line { stroke: #555; stroke-width: 1; fill: none; }
|
|
@@ -5815,7 +5817,7 @@ var STYLE2 = `
|
|
|
5815
5817
|
.lt-pid-line-tag-bg { fill: #ffffff; stroke: #1d1d1d; stroke-width: 0.6; }
|
|
5816
5818
|
.lt-pid-line-tag-text { font: 9px ui-monospace, monospace; fill: #1d1d1d; }
|
|
5817
5819
|
|
|
5818
|
-
.lt-pid-title { font:
|
|
5820
|
+
.lt-pid-title { font: 700 16px system-ui, sans-serif; fill: #1d1d1d; }
|
|
5819
5821
|
|
|
5820
5822
|
.lt-pid-unknown-box { fill: none; stroke: #c0392b; stroke-width: 1.6; stroke-dasharray: 5 3; }
|
|
5821
5823
|
.lt-pid-unknown-mark { font: 700 18px system-ui, sans-serif; fill: #c0392b; }
|
|
@@ -5990,7 +5992,7 @@ function renderLayout2(layout) {
|
|
|
5990
5992
|
}
|
|
5991
5993
|
}
|
|
5992
5994
|
}
|
|
5993
|
-
const titleNode = layout.title ? chunk3WNW5Y7P_cjs.text({ x:
|
|
5995
|
+
const titleNode = layout.title ? chunk3WNW5Y7P_cjs.text({ x: layout.width / 2, y: 22, class: "lt-pid-title", "text-anchor": "middle" }, layout.title) : "";
|
|
5994
5996
|
return chunk3WNW5Y7P_cjs.svgRoot(
|
|
5995
5997
|
{
|
|
5996
5998
|
width: layout.width,
|
|
@@ -6016,7 +6018,7 @@ function renderLayout2(layout) {
|
|
|
6016
6018
|
},
|
|
6017
6019
|
[chunk3WNW5Y7P_cjs.polygon({ points: "0,0 10,3 0,6", fill: "#1d1d1d" })]
|
|
6018
6020
|
),
|
|
6019
|
-
chunk3WNW5Y7P_cjs.el("style", {},
|
|
6021
|
+
chunk3WNW5Y7P_cjs.el("style", {}, STYLE)
|
|
6020
6022
|
]),
|
|
6021
6023
|
titleNode,
|
|
6022
6024
|
// Z-order: process pipes behind equipment; signal lines + instruments above.
|
|
@@ -7388,7 +7390,7 @@ function headerHeightFor(lineCount) {
|
|
|
7388
7390
|
function buildCss3(t) {
|
|
7389
7391
|
return `
|
|
7390
7392
|
.prisma { font-family: system-ui, -apple-system, sans-serif; }
|
|
7391
|
-
.prisma-title { font:
|
|
7393
|
+
.prisma-title { font: 700 16px sans-serif; fill: ${t.text}; }
|
|
7392
7394
|
.prisma-subtitle { font: 400 12px sans-serif; fill: ${t.textMuted}; }
|
|
7393
7395
|
|
|
7394
7396
|
.prisma-stage { stroke-width: 1.1; stroke: #90a4ae; }
|
|
@@ -7453,10 +7455,10 @@ function arrowMarker(t) {
|
|
|
7453
7455
|
)
|
|
7454
7456
|
]);
|
|
7455
7457
|
}
|
|
7456
|
-
function classForBox(
|
|
7457
|
-
if (
|
|
7458
|
-
const base =
|
|
7459
|
-
return `${base} prisma-stage-${
|
|
7458
|
+
function classForBox(box2) {
|
|
7459
|
+
if (box2.variant === "previous") return "prisma-stage-previous";
|
|
7460
|
+
const base = box2.variant === "exclusion" ? "prisma-exclusion" : "prisma-stage";
|
|
7461
|
+
return `${base} prisma-stage-${box2.stage}`;
|
|
7460
7462
|
}
|
|
7461
7463
|
function classForLine(style) {
|
|
7462
7464
|
switch (style) {
|
|
@@ -7540,22 +7542,22 @@ function renderHeader(h) {
|
|
|
7540
7542
|
);
|
|
7541
7543
|
return chunk3WNW5Y7P_cjs.group({ "data-header": h.column }, [r6, ...lines]);
|
|
7542
7544
|
}
|
|
7543
|
-
function renderBox(
|
|
7545
|
+
function renderBox(box2) {
|
|
7544
7546
|
const r6 = chunk3WNW5Y7P_cjs.rect({
|
|
7545
|
-
x:
|
|
7546
|
-
y:
|
|
7547
|
-
width:
|
|
7548
|
-
height:
|
|
7547
|
+
x: box2.x,
|
|
7548
|
+
y: box2.y,
|
|
7549
|
+
width: box2.width,
|
|
7550
|
+
height: box2.height,
|
|
7549
7551
|
rx: PRISMA_CONST.BOX_RADIUS,
|
|
7550
7552
|
ry: PRISMA_CONST.BOX_RADIUS,
|
|
7551
|
-
class: classForBox(
|
|
7552
|
-
"data-role":
|
|
7553
|
+
class: classForBox(box2),
|
|
7554
|
+
"data-role": box2.role
|
|
7553
7555
|
});
|
|
7554
|
-
const innerLeft =
|
|
7555
|
-
const innerRight =
|
|
7556
|
-
const centerX =
|
|
7556
|
+
const innerLeft = box2.x + PRISMA_CONST.BOX_PAD_X;
|
|
7557
|
+
const innerRight = box2.x + box2.width - PRISMA_CONST.BOX_PAD_X;
|
|
7558
|
+
const centerX = box2.x + box2.width / 2;
|
|
7557
7559
|
let widestIndented = 0;
|
|
7558
|
-
for (const line2 of
|
|
7560
|
+
for (const line2 of box2.lines) {
|
|
7559
7561
|
if ((line2.indent ?? 0) > 0) {
|
|
7560
7562
|
const w = approxLineWidth(line2);
|
|
7561
7563
|
if (w > widestIndented) widestIndented = w;
|
|
@@ -7565,9 +7567,9 @@ function renderBox(box) {
|
|
|
7565
7567
|
innerLeft,
|
|
7566
7568
|
Math.min(centerX - widestIndented / 2, innerRight - widestIndented)
|
|
7567
7569
|
);
|
|
7568
|
-
let textY =
|
|
7570
|
+
let textY = box2.y + PRISMA_CONST.BOX_PAD_Y;
|
|
7569
7571
|
const textEls = [];
|
|
7570
|
-
for (const line2 of
|
|
7572
|
+
for (const line2 of box2.lines) {
|
|
7571
7573
|
const lh = lineHeightForLine(line2.style);
|
|
7572
7574
|
const baseline = textY + Math.round(lh * 0.75);
|
|
7573
7575
|
const indented = (line2.indent ?? 0) > 0;
|
|
@@ -7595,9 +7597,9 @@ function renderBox(box) {
|
|
|
7595
7597
|
}
|
|
7596
7598
|
return chunk3WNW5Y7P_cjs.group(
|
|
7597
7599
|
{
|
|
7598
|
-
"data-prisma-role":
|
|
7599
|
-
"data-prisma-variant":
|
|
7600
|
-
"data-prisma-stage":
|
|
7600
|
+
"data-prisma-role": box2.role,
|
|
7601
|
+
"data-prisma-variant": box2.variant,
|
|
7602
|
+
"data-prisma-stage": box2.stage
|
|
7601
7603
|
},
|
|
7602
7604
|
[r6, ...textEls]
|
|
7603
7605
|
);
|
|
@@ -7607,7 +7609,7 @@ function approxLineWidth(line2) {
|
|
|
7607
7609
|
return line2.text.length * charW;
|
|
7608
7610
|
}
|
|
7609
7611
|
function renderPrismaLayout(layout, config) {
|
|
7610
|
-
const t =
|
|
7612
|
+
const t = chunkCAAMBDEN_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
7611
7613
|
const children = [];
|
|
7612
7614
|
children.push(chunk3WNW5Y7P_cjs.title(layout.title ?? "PRISMA 2020 flow diagram"));
|
|
7613
7615
|
children.push(
|
|
@@ -8271,7 +8273,7 @@ function ellipsePerimeterPoint(cx, cy, rx, ry, tx, ty) {
|
|
|
8271
8273
|
function isWideGlyph(cp) {
|
|
8272
8274
|
return cp >= 12288 && cp <= 40959 || cp >= 44032 && cp <= 55203 || cp >= 65280 && cp <= 65519;
|
|
8273
8275
|
}
|
|
8274
|
-
function
|
|
8276
|
+
function estimateTextWidth2(s, charW) {
|
|
8275
8277
|
let w = 0;
|
|
8276
8278
|
for (const ch of s) {
|
|
8277
8279
|
w += isWideGlyph(ch.codePointAt(0) ?? 0) ? charW * 1.7 : charW;
|
|
@@ -8280,10 +8282,10 @@ function estimateTextWidth(s, charW) {
|
|
|
8280
8282
|
}
|
|
8281
8283
|
function sizeEllipse(uc) {
|
|
8282
8284
|
const C2 = USECASE_CONST;
|
|
8283
|
-
const nameW =
|
|
8285
|
+
const nameW = estimateTextWidth2(uc.name, C2.CHAR_W_NAME);
|
|
8284
8286
|
let widest = nameW;
|
|
8285
8287
|
if (uc.stereotype) {
|
|
8286
|
-
widest = Math.max(widest,
|
|
8288
|
+
widest = Math.max(widest, estimateTextWidth2(`\xAB${uc.stereotype}\xBB`, C2.CHAR_W_EXT));
|
|
8287
8289
|
}
|
|
8288
8290
|
let stack = 0;
|
|
8289
8291
|
if (uc.stereotype) stack += C2.STEREO_LH;
|
|
@@ -8293,9 +8295,9 @@ function sizeEllipse(uc) {
|
|
|
8293
8295
|
stack += 8;
|
|
8294
8296
|
stack += C2.EXTPOINT_LH;
|
|
8295
8297
|
stack += uc.extensionPoints.length * C2.EXTPOINT_LH;
|
|
8296
|
-
widest = Math.max(widest,
|
|
8298
|
+
widest = Math.max(widest, estimateTextWidth2(C2.EXT_HEADER, C2.CHAR_W_EXT));
|
|
8297
8299
|
for (const ep of uc.extensionPoints) {
|
|
8298
|
-
widest = Math.max(widest,
|
|
8300
|
+
widest = Math.max(widest, estimateTextWidth2(ep, C2.CHAR_W_EXT) + 16);
|
|
8299
8301
|
}
|
|
8300
8302
|
}
|
|
8301
8303
|
const rx = Math.max(C2.MIN_RX, widest / 2 * Math.SQRT2 + C2.ELLIPSE_PAD_X);
|
|
@@ -8528,7 +8530,7 @@ function layoutUsecase(ast) {
|
|
|
8528
8530
|
const y = cy - h / 2;
|
|
8529
8531
|
const anchorX = side === "left" ? x + w : x;
|
|
8530
8532
|
const anchorY = isRect ? cy : cy - 6;
|
|
8531
|
-
const
|
|
8533
|
+
const box2 = {
|
|
8532
8534
|
actor: a,
|
|
8533
8535
|
x,
|
|
8534
8536
|
y,
|
|
@@ -8538,8 +8540,8 @@ function layoutUsecase(ast) {
|
|
|
8538
8540
|
anchorX,
|
|
8539
8541
|
anchorY
|
|
8540
8542
|
};
|
|
8541
|
-
actorBoxes.push(
|
|
8542
|
-
actorById2.set(a.id,
|
|
8543
|
+
actorBoxes.push(box2);
|
|
8544
|
+
actorById2.set(a.id, box2);
|
|
8543
8545
|
cy += C2.ACTOR_PITCH;
|
|
8544
8546
|
}
|
|
8545
8547
|
}
|
|
@@ -8551,7 +8553,7 @@ function layoutUsecase(ast) {
|
|
|
8551
8553
|
let right = b.x + b.width;
|
|
8552
8554
|
const isRect = b.actor.kind === "external" || b.actor.kind === "system";
|
|
8553
8555
|
if (!isRect) {
|
|
8554
|
-
const labelW =
|
|
8556
|
+
const labelW = estimateTextWidth2(b.actor.name, 6.4);
|
|
8555
8557
|
const cx = b.x + b.width / 2;
|
|
8556
8558
|
left = Math.min(left, cx - labelW / 2);
|
|
8557
8559
|
right = Math.max(right, cx + labelW / 2);
|
|
@@ -9078,7 +9080,7 @@ function renderTree(tr) {
|
|
|
9078
9080
|
);
|
|
9079
9081
|
}
|
|
9080
9082
|
function renderUsecaseLayout(layout, config) {
|
|
9081
|
-
const t =
|
|
9083
|
+
const t = chunkCAAMBDEN_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
9082
9084
|
const children = [];
|
|
9083
9085
|
const nInclude = layout.ast.relations.filter((r6) => r6.kind === "include").length;
|
|
9084
9086
|
const nExtend = layout.ast.relations.filter((r6) => r6.kind === "extend").length;
|
|
@@ -10126,7 +10128,7 @@ function layoutNetwork(ast, schedule) {
|
|
|
10126
10128
|
y = cursor;
|
|
10127
10129
|
cursor += C2.BOX_H + C2.V_GAP;
|
|
10128
10130
|
}
|
|
10129
|
-
const
|
|
10131
|
+
const box2 = {
|
|
10130
10132
|
id,
|
|
10131
10133
|
task: t,
|
|
10132
10134
|
computed,
|
|
@@ -10137,8 +10139,8 @@ function layoutNetwork(ast, schedule) {
|
|
|
10137
10139
|
milestone: t.milestone,
|
|
10138
10140
|
rank: r6
|
|
10139
10141
|
};
|
|
10140
|
-
boxes.push(
|
|
10141
|
-
boxById.set(id,
|
|
10142
|
+
boxes.push(box2);
|
|
10143
|
+
boxById.set(id, box2);
|
|
10142
10144
|
}
|
|
10143
10145
|
}
|
|
10144
10146
|
const edges = [];
|
|
@@ -10345,7 +10347,7 @@ function layoutSwimlane2(ast, schedule) {
|
|
|
10345
10347
|
const w = t.milestone ? C2.MS_W : C2.BOX_W;
|
|
10346
10348
|
const x = colX(r6) + (C2.BOX_W - w) / 2;
|
|
10347
10349
|
const y = y0 + idx * (C2.BOX_H + C2.V_GAP);
|
|
10348
|
-
const
|
|
10350
|
+
const box2 = {
|
|
10349
10351
|
id,
|
|
10350
10352
|
task: t,
|
|
10351
10353
|
computed: schedule.computed.get(id),
|
|
@@ -10356,8 +10358,8 @@ function layoutSwimlane2(ast, schedule) {
|
|
|
10356
10358
|
milestone: t.milestone,
|
|
10357
10359
|
rank: r6
|
|
10358
10360
|
};
|
|
10359
|
-
boxes.push(
|
|
10360
|
-
boxById.set(id,
|
|
10361
|
+
boxes.push(box2);
|
|
10362
|
+
boxById.set(id, box2);
|
|
10361
10363
|
});
|
|
10362
10364
|
}
|
|
10363
10365
|
}
|
|
@@ -10427,7 +10429,7 @@ function layoutTimescaled(ast, schedule) {
|
|
|
10427
10429
|
const iv = intervalById.get(t.id);
|
|
10428
10430
|
const lane = laneOf.get(t.id);
|
|
10429
10431
|
const y = topPad + lane * (C2.TS_BOX_H + C2.TS_LANE_GAP);
|
|
10430
|
-
const
|
|
10432
|
+
const box2 = {
|
|
10431
10433
|
id: t.id,
|
|
10432
10434
|
task: t,
|
|
10433
10435
|
computed: schedule.computed.get(t.id),
|
|
@@ -10438,8 +10440,8 @@ function layoutTimescaled(ast, schedule) {
|
|
|
10438
10440
|
milestone: t.milestone,
|
|
10439
10441
|
rank: 0
|
|
10440
10442
|
};
|
|
10441
|
-
boxes.push(
|
|
10442
|
-
boxById.set(t.id,
|
|
10443
|
+
boxes.push(box2);
|
|
10444
|
+
boxById.set(t.id, box2);
|
|
10443
10445
|
}
|
|
10444
10446
|
const edges = [];
|
|
10445
10447
|
for (const t of ast.tasks) {
|
|
@@ -10867,7 +10869,7 @@ function summaryText(summary) {
|
|
|
10867
10869
|
return { plain, critPath };
|
|
10868
10870
|
}
|
|
10869
10871
|
function renderPertLayout(layout, config) {
|
|
10870
|
-
const t =
|
|
10872
|
+
const t = chunkCAAMBDEN_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
10871
10873
|
const children = [];
|
|
10872
10874
|
const cp = layout.summary.criticalPath;
|
|
10873
10875
|
children.push(chunk3WNW5Y7P_cjs.title(`PERT network${layout.title ? " \u2014 " + layout.title : ""}`));
|
|
@@ -12076,7 +12078,7 @@ function renderDestroy(d) {
|
|
|
12076
12078
|
]);
|
|
12077
12079
|
}
|
|
12078
12080
|
function renderSequenceLayout(layout, config) {
|
|
12079
|
-
const t =
|
|
12081
|
+
const t = chunkCAAMBDEN_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
12080
12082
|
const children = [];
|
|
12081
12083
|
const nMsg = layout.messages.length;
|
|
12082
12084
|
const nFrag = layout.fragments.length;
|
|
@@ -12931,7 +12933,7 @@ function renderArc2(ag) {
|
|
|
12931
12933
|
);
|
|
12932
12934
|
}
|
|
12933
12935
|
function renderPetriLayout(layout, config) {
|
|
12934
|
-
const t =
|
|
12936
|
+
const t = chunkCAAMBDEN_cjs.resolvePetriTheme(config?.theme ?? "default");
|
|
12935
12937
|
const children = [];
|
|
12936
12938
|
const marking = layout.places.filter((p) => p.tokens > 0).map((p) => `${p.place.id}:${p.tokens}`).join(", ");
|
|
12937
12939
|
const descParts = [
|
|
@@ -13516,6 +13518,7 @@ var DET = "sx-net-detail";
|
|
|
13516
13518
|
var GLY = "sx-net-glyph";
|
|
13517
13519
|
var GLYL = "sx-net-glyph-line";
|
|
13518
13520
|
var ITX = "sx-net-icontext";
|
|
13521
|
+
var ITAG = "sx-net-icontag";
|
|
13519
13522
|
var CLOUD = "sx-net-cloud-body";
|
|
13520
13523
|
var CTX = "sx-net-cloudtext";
|
|
13521
13524
|
var r2 = (n) => Math.round(n * 100) / 100;
|
|
@@ -13559,7 +13562,7 @@ function switchBox(b, glyph) {
|
|
|
13559
13562
|
}
|
|
13560
13563
|
function poeSwitch(b) {
|
|
13561
13564
|
const cx = b.x + b.w / 2;
|
|
13562
|
-
return chunk3WNW5Y7P_cjs.group({}, [switchBox(b, "straight"), chunk3WNW5Y7P_cjs.text({ class:
|
|
13565
|
+
return chunk3WNW5Y7P_cjs.group({}, [switchBox(b, "straight"), chunk3WNW5Y7P_cjs.text({ class: ITAG, x: r2(cx), y: r2(b.y + b.h * 0.78 + 8), "text-anchor": "middle" }, "PoE")]);
|
|
13563
13566
|
}
|
|
13564
13567
|
function firewall(b) {
|
|
13565
13568
|
const cx = b.x + b.w / 2, cy = b.y + b.h / 2;
|
|
@@ -13614,7 +13617,7 @@ function serverFarm(b, d) {
|
|
|
13614
13617
|
for (let i = 2; i >= 0; i--) {
|
|
13615
13618
|
parts.push(server({ x: b.x + i * off, y: b.y - i * off * 0.5, w: b.w - 2 * off, h: b.h - off }));
|
|
13616
13619
|
}
|
|
13617
|
-
if (d.count) parts.push(chunk3WNW5Y7P_cjs.text({ class:
|
|
13620
|
+
if (d.count) parts.push(chunk3WNW5Y7P_cjs.text({ class: ITAG, x: r2(b.x + b.w - 6), y: r2(b.y + b.h - 2), "text-anchor": "end" }, `\xD7${d.count}`));
|
|
13618
13621
|
return chunk3WNW5Y7P_cjs.group({}, parts);
|
|
13619
13622
|
}
|
|
13620
13623
|
function pc(b) {
|
|
@@ -13752,9 +13755,9 @@ function drawDeviceIcon(d, b) {
|
|
|
13752
13755
|
case "router":
|
|
13753
13756
|
return router(b);
|
|
13754
13757
|
case "gateway":
|
|
13755
|
-
return chunk3WNW5Y7P_cjs.group({}, [router(b), chunk3WNW5Y7P_cjs.text({ class:
|
|
13758
|
+
return chunk3WNW5Y7P_cjs.group({}, [router(b), chunk3WNW5Y7P_cjs.text({ class: ITAG, x: r2(b.x + b.w / 2), y: r2(b.y + b.h - 1), "text-anchor": "middle" }, "GW")]);
|
|
13756
13759
|
case "vpngw":
|
|
13757
|
-
return chunk3WNW5Y7P_cjs.group({}, [router(b), chunk3WNW5Y7P_cjs.text({ class:
|
|
13760
|
+
return chunk3WNW5Y7P_cjs.group({}, [router(b), chunk3WNW5Y7P_cjs.text({ class: ITAG, x: r2(b.x + b.w / 2), y: r2(b.y + b.h - 1), "text-anchor": "middle" }, "VPN")]);
|
|
13758
13761
|
case "switch":
|
|
13759
13762
|
return switchBox(b, "straight");
|
|
13760
13763
|
case "l3switch":
|
|
@@ -13863,26 +13866,26 @@ function labelText(d) {
|
|
|
13863
13866
|
function deviceFootprint(d) {
|
|
13864
13867
|
return iconSize(d.kind);
|
|
13865
13868
|
}
|
|
13866
|
-
function effBox(
|
|
13867
|
-
const labelW = Math.max(
|
|
13869
|
+
function effBox(box2) {
|
|
13870
|
+
const labelW = Math.max(box2.w, labelText(box2.device).length * NET_CONST.CHAR_W + 6);
|
|
13868
13871
|
const half = labelW / 2;
|
|
13869
13872
|
return {
|
|
13870
|
-
left:
|
|
13871
|
-
top:
|
|
13872
|
-
right:
|
|
13873
|
-
bottom:
|
|
13874
|
-
};
|
|
13875
|
-
}
|
|
13876
|
-
function edgePoint(
|
|
13877
|
-
const dx = tx -
|
|
13878
|
-
const dy = ty -
|
|
13879
|
-
if (dx === 0 && dy === 0) return { x:
|
|
13880
|
-
const hw =
|
|
13881
|
-
const hh =
|
|
13873
|
+
left: box2.cx - half,
|
|
13874
|
+
top: box2.y,
|
|
13875
|
+
right: box2.cx + half,
|
|
13876
|
+
bottom: box2.y + box2.h + labelExtra(box2.device)
|
|
13877
|
+
};
|
|
13878
|
+
}
|
|
13879
|
+
function edgePoint(box2, tx, ty) {
|
|
13880
|
+
const dx = tx - box2.cx;
|
|
13881
|
+
const dy = ty - box2.cy;
|
|
13882
|
+
if (dx === 0 && dy === 0) return { x: box2.cx, y: box2.cy };
|
|
13883
|
+
const hw = box2.w / 2;
|
|
13884
|
+
const hh = box2.h / 2;
|
|
13882
13885
|
const sx = dx !== 0 ? hw / Math.abs(dx) : Infinity;
|
|
13883
13886
|
const sy = dy !== 0 ? hh / Math.abs(dy) : Infinity;
|
|
13884
13887
|
const s = Math.min(sx, sy);
|
|
13885
|
-
return { x:
|
|
13888
|
+
return { x: box2.cx + dx * s, y: box2.cy + dy * s };
|
|
13886
13889
|
}
|
|
13887
13890
|
function placeBanded(ast, ranks) {
|
|
13888
13891
|
const lr = ast.direction === "lr";
|
|
@@ -14234,16 +14237,54 @@ function layoutNetwork2(ast) {
|
|
|
14234
14237
|
depth: gb.depth
|
|
14235
14238
|
});
|
|
14236
14239
|
}
|
|
14240
|
+
const labelClearsDevices = (x, y, halfW) => {
|
|
14241
|
+
const margin = 6;
|
|
14242
|
+
for (const b of boxes) {
|
|
14243
|
+
const e = effBox(b);
|
|
14244
|
+
if (x + halfW >= e.left - margin && x - halfW <= e.right + margin && y + 5 >= e.top - margin && y - 5 <= e.bottom + margin) {
|
|
14245
|
+
return false;
|
|
14246
|
+
}
|
|
14247
|
+
}
|
|
14248
|
+
return true;
|
|
14249
|
+
};
|
|
14250
|
+
const placedLabels = [];
|
|
14251
|
+
const labelClearsPlaced = (x, y) => placedLabels.every((p) => Math.abs(p.x - x) > 90 || Math.abs(p.y - y) > 16);
|
|
14237
14252
|
const linkGeoms = links.map((link) => {
|
|
14238
14253
|
const a = boxById.get(link.from);
|
|
14239
14254
|
const b = boxById.get(link.to);
|
|
14240
14255
|
const p1 = edgePoint(a, b.cx, b.cy);
|
|
14241
14256
|
const p2 = edgePoint(b, a.cx, a.cy);
|
|
14257
|
+
const hasAnnotation = Boolean(
|
|
14258
|
+
link.label || link.speed || link.mode || link.vlans && link.vlans.length
|
|
14259
|
+
);
|
|
14260
|
+
let labelT = 0.5;
|
|
14261
|
+
if (hasAnnotation) {
|
|
14262
|
+
const annLen = (link.mode ? link.mode.length + 3 : 0) + (link.vlans && link.vlans.length ? 6 + link.vlans.join(",").length + 3 : 0) + (link.speed ? link.speed.length + 3 : 0) + (link.label ? link.label.length : 0);
|
|
14263
|
+
const halfW = annLen * 5.4 / 2;
|
|
14264
|
+
const candidates = [0.5, 0.38, 0.62, 0.28, 0.72, 0.2, 0.8, 0.14, 0.86];
|
|
14265
|
+
const at = (t) => ({
|
|
14266
|
+
x: p1.x + (p2.x - p1.x) * t,
|
|
14267
|
+
y: p1.y + (p2.y - p1.y) * t
|
|
14268
|
+
});
|
|
14269
|
+
const strict = candidates.find((t) => {
|
|
14270
|
+
const p = at(t);
|
|
14271
|
+
return labelClearsDevices(p.x, p.y, halfW) && labelClearsPlaced(p.x, p.y);
|
|
14272
|
+
});
|
|
14273
|
+
const relaxed = strict ?? candidates.find((t) => {
|
|
14274
|
+
const p = at(t);
|
|
14275
|
+
return labelClearsDevices(p.x, p.y, halfW);
|
|
14276
|
+
});
|
|
14277
|
+
labelT = relaxed ?? 0.5;
|
|
14278
|
+
placedLabels.push({
|
|
14279
|
+
x: p1.x + (p2.x - p1.x) * labelT,
|
|
14280
|
+
y: p1.y + (p2.y - p1.y) * labelT
|
|
14281
|
+
});
|
|
14282
|
+
}
|
|
14242
14283
|
return {
|
|
14243
14284
|
link,
|
|
14244
14285
|
points: [p1, p2],
|
|
14245
|
-
labelX:
|
|
14246
|
-
labelY:
|
|
14286
|
+
labelX: p1.x + (p2.x - p1.x) * labelT,
|
|
14287
|
+
labelY: p1.y + (p2.y - p1.y) * labelT
|
|
14247
14288
|
};
|
|
14248
14289
|
});
|
|
14249
14290
|
const width = maxX - minX + 2 * NET_CONST.PAD;
|
|
@@ -14271,11 +14312,12 @@ function buildCss8(t) {
|
|
|
14271
14312
|
.sx-net-glyph { fill: ${t.deviceAccent}; stroke: none; }
|
|
14272
14313
|
.sx-net-glyph-line { fill: none; stroke: ${t.deviceAccent}; stroke-width: 1.4; }
|
|
14273
14314
|
.sx-net-icontext { font: 700 8px sans-serif; fill: ${t.deviceAccent}; }
|
|
14315
|
+
.sx-net-icontag { font: 700 8px sans-serif; fill: ${t.subLabel}; paint-order: stroke; stroke: ${t.bg}; stroke-width: 2.5px; stroke-linejoin: round; }
|
|
14274
14316
|
.sx-net-cloud-body { fill: ${t.cloudFill}; stroke: ${t.cloudStroke}; stroke-width: 2; }
|
|
14275
14317
|
.sx-net-cloudtext { font: 600 13px sans-serif; fill: ${t.text}; }
|
|
14276
14318
|
.sx-net-bus { stroke: ${t.deviceStroke}; stroke-width: 4; stroke-linecap: round; }
|
|
14277
|
-
.sx-net-label { font: 12px sans-serif; fill: ${t.label}; }
|
|
14278
|
-
.sx-net-sublabel { font: 10px sans-serif; fill: ${t.subLabel}; }
|
|
14319
|
+
.sx-net-label { font: 12px sans-serif; fill: ${t.label}; paint-order: stroke; stroke: ${t.bg}; stroke-width: 3px; stroke-linejoin: round; }
|
|
14320
|
+
.sx-net-sublabel { font: 10px sans-serif; fill: ${t.subLabel}; paint-order: stroke; stroke: ${t.bg}; stroke-width: 3px; stroke-linejoin: round; }
|
|
14279
14321
|
.sx-net-link { fill: none; stroke-width: 2; }
|
|
14280
14322
|
.sx-net-link-wireless, .sx-net-link-vpn { stroke-dasharray: 5 4; }
|
|
14281
14323
|
.sx-net-link-lag { stroke-width: 3; }
|
|
@@ -14408,7 +14450,7 @@ function renderDevice(b, t) {
|
|
|
14408
14450
|
return chunk3WNW5Y7P_cjs.group(attrs, parts);
|
|
14409
14451
|
}
|
|
14410
14452
|
function renderNetworkLayout(layout, config) {
|
|
14411
|
-
const t =
|
|
14453
|
+
const t = chunkCAAMBDEN_cjs.resolveNetworkTheme(config?.theme ?? "default");
|
|
14412
14454
|
const children = [];
|
|
14413
14455
|
const counts = /* @__PURE__ */ new Map();
|
|
14414
14456
|
for (const b of layout.devices) counts.set(b.device.kind, (counts.get(b.device.kind) ?? 0) + 1);
|
|
@@ -16178,8 +16220,8 @@ function renderUmlClass(text2, config) {
|
|
|
16178
16220
|
return renderUmlClassLayout(layout, config);
|
|
16179
16221
|
}
|
|
16180
16222
|
function renderUmlClassLayout(layout, config) {
|
|
16181
|
-
const theme =
|
|
16182
|
-
const fontFamily = config?.fontFamily ??
|
|
16223
|
+
const theme = chunkCAAMBDEN_cjs.resolveUmlClassTheme(config?.theme ?? "default");
|
|
16224
|
+
const fontFamily = config?.fontFamily ?? chunkCAAMBDEN_cjs.DEFAULT_FONT_FAMILY;
|
|
16183
16225
|
const pad = config?.padding ?? 0;
|
|
16184
16226
|
const width = layout.width + pad * 2;
|
|
16185
16227
|
const height = layout.height + pad * 2;
|
|
@@ -16194,25 +16236,25 @@ function renderUmlClassLayout(layout, config) {
|
|
|
16194
16236
|
.sx-umlclass-box-stroke { stroke: ${theme.classifierStroke}; stroke-width: ${BOX_STROKE_W}; fill: none; }
|
|
16195
16237
|
.sx-umlclass-header-fill { fill: ${theme.headerFill}; }
|
|
16196
16238
|
.sx-umlclass-divider { stroke: ${theme.classifierStroke}; stroke-width: ${DIVIDER_STROKE_W}; }
|
|
16197
|
-
.sx-umlclass-classname { fill: ${theme.nameText}; font-size: ${
|
|
16239
|
+
.sx-umlclass-classname { fill: ${theme.nameText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label + 1}px; font-weight: 700; letter-spacing: -0.01em; }
|
|
16198
16240
|
.sx-umlclass-classname[data-abstract="true"] { font-style: italic; }
|
|
16199
|
-
.sx-umlclass-stereotype { fill: ${theme.stereotypeText}; font-size: ${
|
|
16200
|
-
.sx-umlclass-member { fill: ${theme.memberText}; font-size: ${
|
|
16241
|
+
.sx-umlclass-stereotype { fill: ${theme.stereotypeText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small + 1}px; font-style: italic; }
|
|
16242
|
+
.sx-umlclass-member { fill: ${theme.memberText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label}px; font-weight: 500; }
|
|
16201
16243
|
.sx-umlclass-member[data-static] { text-decoration: underline; }
|
|
16202
16244
|
.sx-umlclass-member[data-abstract] { font-style: italic; }
|
|
16203
|
-
.sx-umlclass-visibility { fill: ${theme.visibilityText}; font-size: ${
|
|
16245
|
+
.sx-umlclass-visibility { fill: ${theme.visibilityText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label}px; font-weight: 500; }
|
|
16204
16246
|
.sx-umlclass-rel-line { stroke: ${theme.relationStroke}; stroke-width: ${REL_STROKE_W}; fill: none; }
|
|
16205
16247
|
.sx-umlclass-rel-line[data-dashed="true"] { stroke-dasharray: 5 4; }
|
|
16206
16248
|
.sx-umlclass-triangle { fill: ${theme.adornmentHollowFill}; stroke: ${theme.relationStroke}; stroke-width: ${REL_STROKE_W}; stroke-linejoin: miter; }
|
|
16207
16249
|
.sx-umlclass-diamond-hollow { fill: ${theme.adornmentHollowFill}; stroke: ${theme.relationStroke}; stroke-width: ${REL_STROKE_W}; stroke-linejoin: miter; }
|
|
16208
16250
|
.sx-umlclass-diamond-filled { fill: ${theme.adornmentFill}; stroke: ${theme.relationStroke}; stroke-width: ${REL_STROKE_W}; stroke-linejoin: miter; }
|
|
16209
16251
|
.sx-umlclass-arrowhead { fill: none; stroke: ${theme.relationStroke}; stroke-width: ${REL_STROKE_W}; stroke-linejoin: miter; }
|
|
16210
|
-
.sx-umlclass-edge-label { fill: ${theme.edgeLabel}; font-size: ${
|
|
16211
|
-
.sx-umlclass-edge-name { fill: ${theme.edgeLabel}; font-size: ${
|
|
16252
|
+
.sx-umlclass-edge-label { fill: ${theme.edgeLabel}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small + 1}px; font-weight: 500; }
|
|
16253
|
+
.sx-umlclass-edge-name { fill: ${theme.edgeLabel}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label}px; font-style: italic; }
|
|
16212
16254
|
.sx-umlclass-edge-name-halo { fill: ${theme.bg}; stroke: ${theme.bg}; stroke-width: ${UMLCLASS_CONST.EDGE_LABEL_HALO}; stroke-linejoin: round; }
|
|
16213
|
-
.sx-umlclass-title { fill: ${theme.nameText}; font-size: ${
|
|
16255
|
+
.sx-umlclass-title { fill: ${theme.nameText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
16214
16256
|
.sx-umlclass-package { fill: ${theme.packageFill}; stroke: ${theme.packageStroke}; stroke-width: 1; }
|
|
16215
|
-
.sx-umlclass-package-label { fill: ${theme.packageLabel}; font-size: ${
|
|
16257
|
+
.sx-umlclass-package-label { fill: ${theme.packageLabel}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label}px; font-weight: 600; }
|
|
16216
16258
|
`.trim()
|
|
16217
16259
|
);
|
|
16218
16260
|
const children = [
|
|
@@ -17518,7 +17560,7 @@ function layoutFaultTree(ast) {
|
|
|
17518
17560
|
bump(g.cx + g.width / 2, g.cy + g.height / 2);
|
|
17519
17561
|
if (g.cond) bump(g.cond.x + g.cond.w / 2, g.cond.y + g.cond.h / 2);
|
|
17520
17562
|
}
|
|
17521
|
-
for (const
|
|
17563
|
+
for (const box2 of cutSetBoxes) bump(box2.x + box2.width, box2.y + box2.height);
|
|
17522
17564
|
for (const t of transfers) bump(t.x + 22, t.y + 30);
|
|
17523
17565
|
if (ast.title) bump(C2.CANVAS_PAD + ast.title.length * 8.5, 0);
|
|
17524
17566
|
if (ast.analysis.probability) {
|
|
@@ -17548,8 +17590,8 @@ function renderFaultTree(text2, config) {
|
|
|
17548
17590
|
return renderFaultTreeLayout(layout, config);
|
|
17549
17591
|
}
|
|
17550
17592
|
function renderFaultTreeLayout(layout, config) {
|
|
17551
|
-
const theme =
|
|
17552
|
-
const fontFamily = config?.fontFamily ??
|
|
17593
|
+
const theme = chunkCAAMBDEN_cjs.resolveReliabilityTheme(config?.theme ?? "default");
|
|
17594
|
+
const fontFamily = config?.fontFamily ?? chunkCAAMBDEN_cjs.DEFAULT_FONT_FAMILY;
|
|
17553
17595
|
const pad = config?.padding ?? 0;
|
|
17554
17596
|
const { ast, analysis } = layout;
|
|
17555
17597
|
const showProb = ast.analysis.probability;
|
|
@@ -17561,27 +17603,27 @@ function renderFaultTreeLayout(layout, config) {
|
|
|
17561
17603
|
{},
|
|
17562
17604
|
`
|
|
17563
17605
|
.sx-ft-bg { fill: ${theme.bg}; }
|
|
17564
|
-
.sx-ft-event { fill: ${theme.eventFill}; stroke: ${theme.eventStroke}; stroke-width: ${
|
|
17606
|
+
.sx-ft-event { fill: ${theme.eventFill}; stroke: ${theme.eventStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
17565
17607
|
.sx-ft-event[data-role="top"] { stroke: ${theme.topEventStroke}; stroke-width: 2.25; }
|
|
17566
|
-
.sx-ft-basic { fill: ${theme.basicFill}; stroke: ${theme.basicStroke}; stroke-width: ${
|
|
17567
|
-
.sx-ft-undeveloped { fill: ${theme.undevelopedFill}; stroke: ${theme.basicStroke}; stroke-width: ${
|
|
17568
|
-
.sx-ft-house { fill: ${theme.houseFill}; stroke: ${theme.eventStroke}; stroke-width: ${
|
|
17569
|
-
.sx-ft-gate { fill: ${theme.gateFill}; stroke: ${theme.gateStroke}; stroke-width: ${
|
|
17570
|
-
.sx-ft-cond { fill: ${theme.conditionFill}; stroke: ${theme.eventStroke}; stroke-width: ${
|
|
17571
|
-
.sx-ft-pin, .sx-ft-edge { fill: none; stroke: ${theme.edgeStroke}; stroke-width: ${
|
|
17572
|
-
.sx-ft-shared-mark { fill: none; stroke: ${theme.basicStroke}; stroke-width: ${
|
|
17573
|
-
.sx-ft-label { fill: ${theme.eventStroke}; font-size: ${
|
|
17574
|
-
.sx-ft-id { fill: ${theme.eventStroke}; font-size: ${
|
|
17575
|
-
.sx-ft-cap { fill: ${theme.eventStroke}; font-size: ${
|
|
17576
|
-
.sx-ft-prob { fill: ${theme.probText}; font-size: ${
|
|
17577
|
-
.sx-ft-gate-label { fill: ${theme.gateStroke}; font-size: ${
|
|
17578
|
-
.sx-ft-cond-text { fill: ${theme.eventStroke}; font-size: ${
|
|
17579
|
-
.sx-ft-cutset { fill: ${theme.cutsetFill}; stroke: ${theme.cutsetStroke}; stroke-width: ${
|
|
17580
|
-
.sx-ft-cutset[data-spof="true"] { stroke: ${theme.spofStroke}; stroke-width: ${
|
|
17581
|
-
.sx-ft-ptop { fill: ${theme.probText}; font-size: ${
|
|
17582
|
-
.sx-ft-transfer { fill: ${theme.eventFill}; stroke: ${theme.eventStroke}; stroke-width: ${
|
|
17583
|
-
.sx-ft-transfer-label { fill: ${theme.eventStroke}; font-size: ${
|
|
17584
|
-
.sx-ft-title { fill: ${theme.eventStroke}; font-size: ${
|
|
17608
|
+
.sx-ft-basic { fill: ${theme.basicFill}; stroke: ${theme.basicStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
17609
|
+
.sx-ft-undeveloped { fill: ${theme.undevelopedFill}; stroke: ${theme.basicStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
17610
|
+
.sx-ft-house { fill: ${theme.houseFill}; stroke: ${theme.eventStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
17611
|
+
.sx-ft-gate { fill: ${theme.gateFill}; stroke: ${theme.gateStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; stroke-linejoin: round; }
|
|
17612
|
+
.sx-ft-cond { fill: ${theme.conditionFill}; stroke: ${theme.eventStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin}; }
|
|
17613
|
+
.sx-ft-pin, .sx-ft-edge { fill: none; stroke: ${theme.edgeStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
17614
|
+
.sx-ft-shared-mark { fill: none; stroke: ${theme.basicStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
17615
|
+
.sx-ft-label { fill: ${theme.eventStroke}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label}px; font-weight: 600; }
|
|
17616
|
+
.sx-ft-id { fill: ${theme.eventStroke}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small + 1}px; font-weight: 700; }
|
|
17617
|
+
.sx-ft-cap { fill: ${theme.eventStroke}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; }
|
|
17618
|
+
.sx-ft-prob { fill: ${theme.probText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; font-weight: 600; }
|
|
17619
|
+
.sx-ft-gate-label { fill: ${theme.gateStroke}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; font-weight: 700; }
|
|
17620
|
+
.sx-ft-cond-text { fill: ${theme.eventStroke}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; }
|
|
17621
|
+
.sx-ft-cutset { fill: ${theme.cutsetFill}; stroke: ${theme.cutsetStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
17622
|
+
.sx-ft-cutset[data-spof="true"] { stroke: ${theme.spofStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thick}; }
|
|
17623
|
+
.sx-ft-ptop { fill: ${theme.probText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label}px; font-weight: 700; }
|
|
17624
|
+
.sx-ft-transfer { fill: ${theme.eventFill}; stroke: ${theme.eventStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
17625
|
+
.sx-ft-transfer-label { fill: ${theme.eventStroke}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; font-weight: 600; }
|
|
17626
|
+
.sx-ft-title { fill: ${theme.eventStroke}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
17585
17627
|
`.trim()
|
|
17586
17628
|
);
|
|
17587
17629
|
const instById = new Map(layout.events.map((e) => [e.instanceId, e]));
|
|
@@ -17594,23 +17636,23 @@ function renderFaultTreeLayout(layout, config) {
|
|
|
17594
17636
|
const inner = [];
|
|
17595
17637
|
if (ast.title) {
|
|
17596
17638
|
inner.push(
|
|
17597
|
-
chunk3WNW5Y7P_cjs.text({ x:
|
|
17639
|
+
chunk3WNW5Y7P_cjs.text({ x: layout.width / 2, y: 22, class: "sx-ft-title", "font-family": fontFamily, "text-anchor": "middle" }, ast.title)
|
|
17598
17640
|
);
|
|
17599
17641
|
}
|
|
17600
|
-
for (const
|
|
17642
|
+
for (const box2 of layout.cutSetBoxes) {
|
|
17601
17643
|
inner.push(
|
|
17602
17644
|
chunk3WNW5Y7P_cjs.rect({
|
|
17603
|
-
x:
|
|
17604
|
-
y:
|
|
17605
|
-
width:
|
|
17606
|
-
height:
|
|
17645
|
+
x: box2.x,
|
|
17646
|
+
y: box2.y,
|
|
17647
|
+
width: box2.width,
|
|
17648
|
+
height: box2.height,
|
|
17607
17649
|
rx: 6,
|
|
17608
17650
|
class: "sx-ft-cutset",
|
|
17609
|
-
"data-cutset":
|
|
17610
|
-
"data-cutset-index": String(
|
|
17611
|
-
"data-order": String(
|
|
17612
|
-
...
|
|
17613
|
-
...
|
|
17651
|
+
"data-cutset": box2.cutSet.events.join(","),
|
|
17652
|
+
"data-cutset-index": String(box2.index),
|
|
17653
|
+
"data-order": String(box2.cutSet.order),
|
|
17654
|
+
...box2.cutSet.isSpof ? { "data-spof": "true" } : {},
|
|
17655
|
+
...box2.cutSet.prob !== void 0 ? { "data-cutset-prob": String(box2.cutSet.prob) } : {}
|
|
17614
17656
|
})
|
|
17615
17657
|
);
|
|
17616
17658
|
}
|
|
@@ -18252,8 +18294,8 @@ function renderBowtie(text2, config) {
|
|
|
18252
18294
|
}
|
|
18253
18295
|
function renderBowtieLayout(layout, config) {
|
|
18254
18296
|
const themeName = config?.theme ?? "default";
|
|
18255
|
-
const theme =
|
|
18256
|
-
const fontFamily = config?.fontFamily ??
|
|
18297
|
+
const theme = chunkCAAMBDEN_cjs.resolveBowtieTheme(themeName);
|
|
18298
|
+
const fontFamily = config?.fontFamily ?? chunkCAAMBDEN_cjs.DEFAULT_FONT_FAMILY;
|
|
18257
18299
|
const pad = config?.padding ?? 0;
|
|
18258
18300
|
const { ast, topEvent } = layout;
|
|
18259
18301
|
const mono = themeName === "monochrome";
|
|
@@ -18265,22 +18307,22 @@ function renderBowtieLayout(layout, config) {
|
|
|
18265
18307
|
{},
|
|
18266
18308
|
`
|
|
18267
18309
|
.sx-bowtie-bg { fill: ${theme.bg}; }
|
|
18268
|
-
.sx-bowtie-line { fill: none; stroke: ${theme.lineStroke}; stroke-width: ${
|
|
18310
|
+
.sx-bowtie-line { fill: none; stroke: ${theme.lineStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
18269
18311
|
.sx-bowtie-arrow { fill: ${theme.lineStroke}; stroke: none; }
|
|
18270
|
-
.sx-bowtie-escalation-line { fill: none; stroke: ${theme.escalationLineStroke}; stroke-width: ${
|
|
18271
|
-
.sx-bowtie-hazard { fill: ${theme.hazardFill}; stroke: ${theme.hazardStroke}; stroke-width: ${
|
|
18272
|
-
.sx-bowtie-topevent { fill: ${theme.topEventFill}; stroke: ${theme.topEventStroke}; stroke-width: ${
|
|
18273
|
-
.sx-bowtie-topevent-ring { fill: none; stroke: ${theme.topEventStroke}; stroke-width: ${
|
|
18274
|
-
.sx-bowtie-threat { fill: ${theme.threatFill}; stroke: ${theme.threatStroke}; stroke-width: ${
|
|
18275
|
-
.sx-bowtie-barrier { fill: ${theme.barrierFill}; stroke: ${theme.barrierStroke}; stroke-width: ${
|
|
18276
|
-
.sx-bowtie-consequence { fill: ${theme.consequenceFill}; stroke: ${theme.consequenceStroke}; stroke-width: ${
|
|
18277
|
-
.sx-bowtie-escalation { fill: ${theme.escalationFill}; stroke: ${theme.escalationStroke}; stroke-width: ${
|
|
18278
|
-
.sx-bowtie-ef-barrier { fill: ${theme.efBarrierFill}; stroke: ${theme.barrierStroke}; stroke-width: ${
|
|
18279
|
-
.sx-bowtie-label { fill: ${theme.labelText}; stroke: none; font-size: ${
|
|
18280
|
-
.sx-bowtie-elabel { fill: ${theme.labelText}; stroke: none; font-size: ${
|
|
18312
|
+
.sx-bowtie-escalation-line { fill: none; stroke: ${theme.escalationLineStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin};${mono ? " stroke-dasharray: 4 3;" : ""} }
|
|
18313
|
+
.sx-bowtie-hazard { fill: ${theme.hazardFill}; stroke: ${theme.hazardStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
18314
|
+
.sx-bowtie-topevent { fill: ${theme.topEventFill}; stroke: ${theme.topEventStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thick}; }
|
|
18315
|
+
.sx-bowtie-topevent-ring { fill: none; stroke: ${theme.topEventStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin}; }
|
|
18316
|
+
.sx-bowtie-threat { fill: ${theme.threatFill}; stroke: ${theme.threatStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
18317
|
+
.sx-bowtie-barrier { fill: ${theme.barrierFill}; stroke: ${theme.barrierStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
18318
|
+
.sx-bowtie-consequence { fill: ${theme.consequenceFill}; stroke: ${theme.consequenceStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
18319
|
+
.sx-bowtie-escalation { fill: ${theme.escalationFill}; stroke: ${theme.escalationStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal};${mono ? " stroke-dasharray: 5 3;" : ""} }
|
|
18320
|
+
.sx-bowtie-ef-barrier { fill: ${theme.efBarrierFill}; stroke: ${theme.barrierStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
18321
|
+
.sx-bowtie-label { fill: ${theme.labelText}; stroke: none; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label}px; }
|
|
18322
|
+
.sx-bowtie-elabel { fill: ${theme.labelText}; stroke: none; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; }
|
|
18281
18323
|
.sx-bowtie-topevent-label { fill: ${theme.labelText}; stroke: none; font-size: 11px; font-weight: 700; }
|
|
18282
|
-
.sx-bowtie-title { fill: ${theme.labelText}; stroke: none; font-size: ${
|
|
18283
|
-
.sx-bowtie-legend-label { fill: ${theme.labelText}; stroke: none; font-size: ${
|
|
18324
|
+
.sx-bowtie-title { fill: ${theme.labelText}; stroke: none; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
18325
|
+
.sx-bowtie-legend-label { fill: ${theme.labelText}; stroke: none; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; }
|
|
18284
18326
|
`.trim()
|
|
18285
18327
|
);
|
|
18286
18328
|
const children = [
|
|
@@ -18291,7 +18333,7 @@ function renderBowtieLayout(layout, config) {
|
|
|
18291
18333
|
];
|
|
18292
18334
|
const inner = [];
|
|
18293
18335
|
if (ast.title) {
|
|
18294
|
-
inner.push(chunk3WNW5Y7P_cjs.text({ x:
|
|
18336
|
+
inner.push(chunk3WNW5Y7P_cjs.text({ x: layout.width / 2, y: BOWTIE_CONST.PAGE_PAD + 6, class: "sx-bowtie-title", "font-family": fontFamily, "text-anchor": "middle" }, ast.title));
|
|
18295
18337
|
}
|
|
18296
18338
|
if (layout.hazardTie) {
|
|
18297
18339
|
inner.push(chunk3WNW5Y7P_cjs.line({ x1: layout.hazardTie.x, y1: layout.hazardTie.y1, x2: layout.hazardTie.x, y2: layout.hazardTie.y2, class: "sx-bowtie-line" }));
|
|
@@ -18878,8 +18920,8 @@ function renderEventTree(text2, config) {
|
|
|
18878
18920
|
return renderEventTreeLayout(layout, config);
|
|
18879
18921
|
}
|
|
18880
18922
|
function renderEventTreeLayout(layout, config) {
|
|
18881
|
-
const theme =
|
|
18882
|
-
const fontFamily = config?.fontFamily ??
|
|
18923
|
+
const theme = chunkCAAMBDEN_cjs.resolveReliabilityTheme(config?.theme ?? "default");
|
|
18924
|
+
const fontFamily = config?.fontFamily ?? chunkCAAMBDEN_cjs.DEFAULT_FONT_FAMILY;
|
|
18883
18925
|
const pad = config?.padding ?? 0;
|
|
18884
18926
|
const { ast } = layout;
|
|
18885
18927
|
const width = layout.width + pad * 2;
|
|
@@ -18890,22 +18932,22 @@ function renderEventTreeLayout(layout, config) {
|
|
|
18890
18932
|
{},
|
|
18891
18933
|
`
|
|
18892
18934
|
.sx-et-bg { fill: ${theme.bg}; }
|
|
18893
|
-
.sx-et-title { fill: ${theme.eventStroke}; font-size: ${
|
|
18894
|
-
.sx-et-header { fill: ${theme.eventStroke}; font-size: ${
|
|
18895
|
-
.sx-et-grid { fill: none; stroke: ${theme.edgeStroke}; stroke-width: ${
|
|
18896
|
-
.sx-et-headrule { fill: none; stroke: ${theme.eventStroke}; stroke-width: ${
|
|
18897
|
-
.sx-et-ie { fill: none; stroke: ${theme.topEventStroke}; stroke-width: ${
|
|
18898
|
-
.sx-et-ie-label { fill: ${theme.eventStroke}; font-size: ${
|
|
18899
|
-
.sx-et-ie-freq { fill: ${theme.probText}; font-size: ${
|
|
18900
|
-
.sx-et-edge { fill: none; stroke: ${theme.edgeStroke}; stroke-width: ${
|
|
18935
|
+
.sx-et-title { fill: ${theme.eventStroke}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
18936
|
+
.sx-et-header { fill: ${theme.eventStroke}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label}px; font-weight: 700; }
|
|
18937
|
+
.sx-et-grid { fill: none; stroke: ${theme.edgeStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin}; stroke-dasharray: 4 4; opacity: 0.5; }
|
|
18938
|
+
.sx-et-headrule { fill: none; stroke: ${theme.eventStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin}; }
|
|
18939
|
+
.sx-et-ie { fill: none; stroke: ${theme.topEventStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thick}; }
|
|
18940
|
+
.sx-et-ie-label { fill: ${theme.eventStroke}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small + 1}px; font-weight: 700; }
|
|
18941
|
+
.sx-et-ie-freq { fill: ${theme.probText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; font-weight: 600; }
|
|
18942
|
+
.sx-et-edge { fill: none; stroke: ${theme.edgeStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
18901
18943
|
.sx-et-edge[data-leg="s"] {}
|
|
18902
|
-
.sx-et-leg-label { fill: ${theme.eventStroke}; font-size: ${
|
|
18903
|
-
.sx-et-leg-prob { fill: ${theme.probText}; font-size: ${
|
|
18904
|
-
.sx-et-outcome { fill: ${theme.eventStroke}; font-size: ${
|
|
18905
|
-
.sx-et-freq { fill: ${theme.probText}; font-size: ${
|
|
18906
|
-
.sx-et-seqid { fill: ${theme.eventStroke}; font-size: ${
|
|
18944
|
+
.sx-et-leg-label { fill: ${theme.eventStroke}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; }
|
|
18945
|
+
.sx-et-leg-prob { fill: ${theme.probText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; }
|
|
18946
|
+
.sx-et-outcome { fill: ${theme.eventStroke}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label}px; font-weight: 600; }
|
|
18947
|
+
.sx-et-freq { fill: ${theme.probText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small + 1}px; font-weight: 600; }
|
|
18948
|
+
.sx-et-seqid { fill: ${theme.eventStroke}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; opacity: 0.7; }
|
|
18907
18949
|
.sx-et-dot { fill: ${theme.basicStroke}; stroke: none; }
|
|
18908
|
-
.sx-et-edge[data-dominant="true"] { stroke: ${theme.cutsetStroke}; stroke-width: ${
|
|
18950
|
+
.sx-et-edge[data-dominant="true"] { stroke: ${theme.cutsetStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thick}; }
|
|
18909
18951
|
.sx-et-outcome[data-dominant="true"] { fill: ${theme.spofStroke}; }
|
|
18910
18952
|
.sx-et-freq[data-dominant="true"] { fill: ${theme.spofStroke}; font-weight: 700; }
|
|
18911
18953
|
.sx-et-dot[data-dominant="true"] { fill: ${theme.spofStroke}; }
|
|
@@ -18919,7 +18961,7 @@ function renderEventTreeLayout(layout, config) {
|
|
|
18919
18961
|
];
|
|
18920
18962
|
const inner = [];
|
|
18921
18963
|
if (ast.title) {
|
|
18922
|
-
inner.push(chunk3WNW5Y7P_cjs.text({ x:
|
|
18964
|
+
inner.push(chunk3WNW5Y7P_cjs.text({ x: layout.width / 2, y: EVENTTREE_CONST.CANVAS_PAD + 4, class: "sx-et-title", "font-family": fontFamily, "text-anchor": "middle" }, ast.title));
|
|
18923
18965
|
}
|
|
18924
18966
|
for (const h of layout.headers) {
|
|
18925
18967
|
inner.push(
|
|
@@ -19982,7 +20024,7 @@ function renderFmea(text2, config) {
|
|
|
19982
20024
|
}
|
|
19983
20025
|
function renderFmeaLayout(layout, config) {
|
|
19984
20026
|
const p = resolvePalette(config?.theme ?? "default");
|
|
19985
|
-
const fontFamily = config?.fontFamily ??
|
|
20027
|
+
const fontFamily = config?.fontFamily ?? chunkCAAMBDEN_cjs.DEFAULT_FONT_FAMILY;
|
|
19986
20028
|
const pad = config?.padding ?? 0;
|
|
19987
20029
|
const { ast, analysis } = layout;
|
|
19988
20030
|
const width = layout.width + pad * 2;
|
|
@@ -20113,7 +20155,7 @@ function renderHeaderBlock(layout) {
|
|
|
20113
20155
|
const x0 = FMEA_CONST.CANVAS_PAD;
|
|
20114
20156
|
let y = FMEA_CONST.CANVAS_PAD + 14;
|
|
20115
20157
|
if (ast.title) {
|
|
20116
|
-
out.push(chunk3WNW5Y7P_cjs.text({ x:
|
|
20158
|
+
out.push(chunk3WNW5Y7P_cjs.text({ x: layout.width / 2, y, class: "sx-fmea-title", "text-anchor": "middle" }, ast.title));
|
|
20117
20159
|
y += FMEA_CONST.TITLE_H - 8;
|
|
20118
20160
|
}
|
|
20119
20161
|
const metaEntries = Object.entries(ast.metadata);
|
|
@@ -20163,25 +20205,25 @@ function buildCss9(p) {
|
|
|
20163
20205
|
const isMono = p === PALETTE_MONO;
|
|
20164
20206
|
return `
|
|
20165
20207
|
.sx-fmea-bg { fill: ${p.bg}; }
|
|
20166
|
-
.sx-fmea-border { fill: none; stroke: ${p.border}; stroke-width: ${
|
|
20167
|
-
.sx-fmea-cell { fill: ${p.bg}; stroke: ${p.grid}; stroke-width: ${
|
|
20208
|
+
.sx-fmea-border { fill: none; stroke: ${p.border}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
20209
|
+
.sx-fmea-cell { fill: ${p.bg}; stroke: ${p.grid}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin}; }
|
|
20168
20210
|
.sx-fmea-cell-alt { fill: ${p.cellAltFill}; }
|
|
20169
|
-
.sx-fmea-headcell { fill: ${p.headerFill}; stroke: ${p.grid}; stroke-width: ${
|
|
20170
|
-
.sx-fmea-band { fill: ${p.bandFill}; stroke: ${p.grid}; stroke-width: ${
|
|
20171
|
-
.sx-fmea-band-text { fill: ${p.bandText}; font-size: ${
|
|
20172
|
-
.sx-fmea-headtext { fill: ${p.headerText}; font-size: ${
|
|
20173
|
-
.sx-fmea-text { fill: ${p.cellText}; font-size: ${
|
|
20174
|
-
.sx-fmea-risk-text { fill: ${p.riskText}; font-size: ${
|
|
20175
|
-
.sx-fmea-title { fill: ${p.cellText}; font-size: ${
|
|
20176
|
-
.sx-fmea-meta { fill: ${p.metaText}; font-size: ${
|
|
20177
|
-
.sx-fmea-legend { fill: ${p.metaText}; font-size: ${
|
|
20178
|
-
.sx-fmea-rpn-high { fill: ${p.rpnHigh}; stroke: ${p.grid}; stroke-width: ${
|
|
20179
|
-
.sx-fmea-rpn-mid { fill: ${p.rpnMid}; stroke: ${p.grid}; stroke-width: ${
|
|
20180
|
-
.sx-fmea-rpn-low { fill: ${p.rpnLow}; stroke: ${p.grid}; stroke-width: ${
|
|
20181
|
-
.sx-fmea-ap-high { fill: ${p.apHigh}; stroke: ${p.grid}; stroke-width: ${
|
|
20182
|
-
.sx-fmea-ap-mid { fill: ${p.apMid}; stroke: ${p.grid}; stroke-width: ${
|
|
20183
|
-
.sx-fmea-ap-low { fill: ${p.apLow}; stroke: ${p.grid}; stroke-width: ${
|
|
20184
|
-
.sx-fmea-flag { fill: none; stroke: ${p.flagStroke}; stroke-width: ${
|
|
20211
|
+
.sx-fmea-headcell { fill: ${p.headerFill}; stroke: ${p.grid}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin}; }
|
|
20212
|
+
.sx-fmea-band { fill: ${p.bandFill}; stroke: ${p.grid}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin}; }
|
|
20213
|
+
.sx-fmea-band-text { fill: ${p.bandText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small + 1}px; font-weight: 700; letter-spacing: 0.06em; }
|
|
20214
|
+
.sx-fmea-headtext { fill: ${p.headerText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small + 1}px; font-weight: 700; }
|
|
20215
|
+
.sx-fmea-text { fill: ${p.cellText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small + 1}px; }
|
|
20216
|
+
.sx-fmea-risk-text { fill: ${p.riskText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label}px; font-weight: 700; }
|
|
20217
|
+
.sx-fmea-title { fill: ${p.cellText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
20218
|
+
.sx-fmea-meta { fill: ${p.metaText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small + 1}px; }
|
|
20219
|
+
.sx-fmea-legend { fill: ${p.metaText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small + 1}px; font-weight: 600; }
|
|
20220
|
+
.sx-fmea-rpn-high { fill: ${p.rpnHigh}; stroke: ${p.grid}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin}; }
|
|
20221
|
+
.sx-fmea-rpn-mid { fill: ${p.rpnMid}; stroke: ${p.grid}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin}; }
|
|
20222
|
+
.sx-fmea-rpn-low { fill: ${p.rpnLow}; stroke: ${p.grid}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin}; }
|
|
20223
|
+
.sx-fmea-ap-high { fill: ${p.apHigh}; stroke: ${p.grid}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin}; }
|
|
20224
|
+
.sx-fmea-ap-mid { fill: ${p.apMid}; stroke: ${p.grid}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin}; }
|
|
20225
|
+
.sx-fmea-ap-low { fill: ${p.apLow}; stroke: ${p.grid}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin}; }
|
|
20226
|
+
.sx-fmea-flag { fill: none; stroke: ${p.flagStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thick}; ${isMono ? "stroke-dasharray: 4 2;" : ""} }
|
|
20185
20227
|
`.trim();
|
|
20186
20228
|
}
|
|
20187
20229
|
|
|
@@ -20862,7 +20904,7 @@ function renderCausalLoop(text2, config) {
|
|
|
20862
20904
|
}
|
|
20863
20905
|
function renderCausalLoopLayout(layout, config) {
|
|
20864
20906
|
const theme = resolveTokens(config?.theme ?? "default");
|
|
20865
|
-
const fontFamily = config?.fontFamily ??
|
|
20907
|
+
const fontFamily = config?.fontFamily ?? chunkCAAMBDEN_cjs.DEFAULT_FONT_FAMILY;
|
|
20866
20908
|
const pad = config?.padding ?? 0;
|
|
20867
20909
|
const { ast } = layout;
|
|
20868
20910
|
const width = layout.width + pad * 2;
|
|
@@ -20873,17 +20915,17 @@ function renderCausalLoopLayout(layout, config) {
|
|
|
20873
20915
|
{},
|
|
20874
20916
|
`
|
|
20875
20917
|
.sx-cld-bg { fill: ${theme.bg}; }
|
|
20876
|
-
.sx-cld-link { fill: none; stroke: ${theme.ink}; stroke-width: ${
|
|
20918
|
+
.sx-cld-link { fill: none; stroke: ${theme.ink}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
20877
20919
|
.sx-cld-arrow { fill: ${theme.ink}; stroke: none; }
|
|
20878
|
-
.sx-cld-var { fill: ${theme.ink}; font-size: ${
|
|
20879
|
-
.sx-cld-polarity { fill: ${theme.ink}; font-size: ${
|
|
20880
|
-
.sx-cld-link-label { fill: ${theme.ink}; font-size: ${
|
|
20881
|
-
.sx-cld-delay { stroke: ${theme.delay}; stroke-width: ${
|
|
20882
|
-
.sx-cld-glyph { fill: none; stroke: ${theme.accent}; stroke-width: ${
|
|
20920
|
+
.sx-cld-var { fill: ${theme.ink}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label + 1}px; font-weight: 600; }
|
|
20921
|
+
.sx-cld-polarity { fill: ${theme.ink}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label + 2}px; font-weight: 700; }
|
|
20922
|
+
.sx-cld-link-label { fill: ${theme.ink}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; }
|
|
20923
|
+
.sx-cld-delay { stroke: ${theme.delay}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
20924
|
+
.sx-cld-glyph { fill: none; stroke: ${theme.accent}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
20883
20925
|
.sx-cld-glyph-head { fill: ${theme.accent}; stroke: none; }
|
|
20884
|
-
.sx-cld-glyph-label { fill: ${theme.accent}; font-size: ${
|
|
20885
|
-
.sx-cld-glyph-phrase { fill: ${theme.accent}; font-size: ${
|
|
20886
|
-
.sx-cld-title { fill: ${theme.ink}; font-size: ${
|
|
20926
|
+
.sx-cld-glyph-label { fill: ${theme.accent}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label}px; font-weight: 700; }
|
|
20927
|
+
.sx-cld-glyph-phrase { fill: ${theme.accent}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small + 1}px; font-style: italic; }
|
|
20928
|
+
.sx-cld-title { fill: ${theme.ink}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
20887
20929
|
`.trim()
|
|
20888
20930
|
);
|
|
20889
20931
|
const children = [
|
|
@@ -20896,7 +20938,7 @@ function renderCausalLoopLayout(layout, config) {
|
|
|
20896
20938
|
if (ast.title) {
|
|
20897
20939
|
inner.push(
|
|
20898
20940
|
chunk3WNW5Y7P_cjs.text(
|
|
20899
|
-
{ x:
|
|
20941
|
+
{ x: layout.width / 2, y: 20, class: "sx-cld-title", "font-family": fontFamily, "text-anchor": "middle" },
|
|
20900
20942
|
ast.title
|
|
20901
20943
|
)
|
|
20902
20944
|
);
|
|
@@ -21695,16 +21737,16 @@ function layoutMarkov(ast) {
|
|
|
21695
21737
|
const tag = classOf?.[st.id];
|
|
21696
21738
|
const isAbsorbing = tag === "absorbing";
|
|
21697
21739
|
const pi = piMap?.[st.id] ?? perClassPi[st.id];
|
|
21698
|
-
const
|
|
21740
|
+
const box2 = {
|
|
21699
21741
|
state: st,
|
|
21700
21742
|
cx: c.x,
|
|
21701
21743
|
cy: c.y,
|
|
21702
21744
|
r: C2.STATE_R,
|
|
21703
21745
|
isAbsorbing
|
|
21704
21746
|
};
|
|
21705
|
-
if (tag)
|
|
21706
|
-
if (pi !== void 0)
|
|
21707
|
-
return
|
|
21747
|
+
if (tag) box2.classTag = tag;
|
|
21748
|
+
if (pi !== void 0) box2.pi = pi;
|
|
21749
|
+
return box2;
|
|
21708
21750
|
});
|
|
21709
21751
|
const arcKey = (a, b) => `${a}\0${b}`;
|
|
21710
21752
|
const present = /* @__PURE__ */ new Set();
|
|
@@ -21861,7 +21903,7 @@ function selfLoopGeom(tr, c, ringCenter, layout, C2) {
|
|
|
21861
21903
|
|
|
21862
21904
|
// src/diagrams/markov/renderer.ts
|
|
21863
21905
|
function palette(name) {
|
|
21864
|
-
const b =
|
|
21906
|
+
const b = chunkCAAMBDEN_cjs.resolveBaseTheme(name);
|
|
21865
21907
|
const mono = name === "monochrome";
|
|
21866
21908
|
return {
|
|
21867
21909
|
stateFill: b.fillMuted,
|
|
@@ -22717,13 +22759,13 @@ function renderGitGraph(text2, config) {
|
|
|
22717
22759
|
}
|
|
22718
22760
|
function renderGitGraphLayout(layout, config) {
|
|
22719
22761
|
const pal = resolvePalette2(config?.theme);
|
|
22720
|
-
const fontFamily = config?.fontFamily ??
|
|
22762
|
+
const fontFamily = config?.fontFamily ?? chunkCAAMBDEN_cjs.DEFAULT_FONT_FAMILY;
|
|
22721
22763
|
const pad = config?.padding ?? 0;
|
|
22722
22764
|
const { ast } = layout;
|
|
22723
22765
|
const width = layout.width + pad * 2;
|
|
22724
22766
|
const height = layout.height + pad * 2;
|
|
22725
22767
|
const a11y = ast.title ?? "Git commit graph";
|
|
22726
|
-
const styleBlock =
|
|
22768
|
+
const styleBlock = buildStyle2(pal, ast.showBranches);
|
|
22727
22769
|
const children = [
|
|
22728
22770
|
chunk3WNW5Y7P_cjs.title(a11y),
|
|
22729
22771
|
chunk3WNW5Y7P_cjs.desc(summarise6(layout)),
|
|
@@ -22939,11 +22981,11 @@ function renderCommitLabel(id, x, y, rotate, fontFamily) {
|
|
|
22939
22981
|
id
|
|
22940
22982
|
);
|
|
22941
22983
|
}
|
|
22942
|
-
function
|
|
22984
|
+
function buildStyle2(pal, showBranches) {
|
|
22943
22985
|
const laneStyle = showBranches ? `
|
|
22944
|
-
.sx-gg-lane { stroke-width: ${
|
|
22986
|
+
.sx-gg-lane { stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thick}; stroke-linecap: round; opacity: 0.9; }
|
|
22945
22987
|
.sx-gg-pill { stroke: none; }
|
|
22946
|
-
.sx-gg-pill-text { font-size: ${
|
|
22988
|
+
.sx-gg-pill-text { font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label}px; font-weight: 700; }` : "";
|
|
22947
22989
|
const laneRules = pal.lanes.map((col, i) => {
|
|
22948
22990
|
const ink = pal.laneInk[i] ?? "#ffffff";
|
|
22949
22991
|
return [
|
|
@@ -22958,17 +23000,17 @@ function buildStyle(pal, showBranches) {
|
|
|
22958
23000
|
{},
|
|
22959
23001
|
`
|
|
22960
23002
|
.sx-gg-bg { fill: ${pal.bg}; }${laneStyle}
|
|
22961
|
-
.sx-gg-edge { fill: none; stroke-width: ${
|
|
23003
|
+
.sx-gg-edge { fill: none; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
22962
23004
|
.sx-gg-edge-merge { stroke-dasharray: none; }
|
|
22963
|
-
.sx-gg-node { stroke-width: ${
|
|
23005
|
+
.sx-gg-node { stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
22964
23006
|
.sx-gg-dot { stroke: none; }
|
|
22965
|
-
.sx-gg-merge { fill: ${pal.mergeCenter}; stroke-width: ${
|
|
22966
|
-
.sx-gg-highlight { fill: none; stroke-width: ${
|
|
22967
|
-
.sx-gg-reverse-mark { stroke: ${pal.mergeCenter}; stroke-width: ${
|
|
22968
|
-
.sx-gg-cherry { fill: none; stroke-width: ${
|
|
22969
|
-
.sx-gg-id { fill: ${pal.labelInk}; font-size: ${
|
|
22970
|
-
.sx-gg-tag { fill: ${pal.tagFill}; stroke: ${pal.tagStroke}; stroke-width: ${
|
|
22971
|
-
.sx-gg-tag-text { fill: ${pal.tagInk}; font-size: ${
|
|
23007
|
+
.sx-gg-merge { fill: ${pal.mergeCenter}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thick}; }
|
|
23008
|
+
.sx-gg-highlight { fill: none; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thick}; }
|
|
23009
|
+
.sx-gg-reverse-mark { stroke: ${pal.mergeCenter}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; stroke-linecap: round; }
|
|
23010
|
+
.sx-gg-cherry { fill: none; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
23011
|
+
.sx-gg-id { fill: ${pal.labelInk}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small + 1}px; font-weight: 600; }
|
|
23012
|
+
.sx-gg-tag { fill: ${pal.tagFill}; stroke: ${pal.tagStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin}; }
|
|
23013
|
+
.sx-gg-tag-text { fill: ${pal.tagInk}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; font-weight: 700; }
|
|
22972
23014
|
${laneRules}
|
|
22973
23015
|
`.trim()
|
|
22974
23016
|
);
|
|
@@ -23561,7 +23603,8 @@ function layoutEpc(ast) {
|
|
|
23561
23603
|
const shift = (maxCrossExtent - rankWidths[r6]) / 2 + EPC_CONST.CANVAS_PAD;
|
|
23562
23604
|
for (const id of ranks[r6]) crossPos.set(id, crossPos.get(id) + shift);
|
|
23563
23605
|
}
|
|
23564
|
-
const
|
|
23606
|
+
const backMargin = backSet.size > 0 ? EPC_CONST.BACK_MARGIN : 0;
|
|
23607
|
+
const crossExtent = maxCrossExtent + EPC_CONST.CANVAS_PAD * 2 + backMargin;
|
|
23565
23608
|
const flaggedIds = /* @__PURE__ */ new Set();
|
|
23566
23609
|
for (const v of analysis.violations) {
|
|
23567
23610
|
if (v.severity === "error") for (const id of v.nodes) flaggedIds.add(id);
|
|
@@ -23727,7 +23770,7 @@ function borderPoint(from, to, _isLR) {
|
|
|
23727
23770
|
|
|
23728
23771
|
// src/diagrams/epc/renderer.ts
|
|
23729
23772
|
function epcPalette(themeName) {
|
|
23730
|
-
const base =
|
|
23773
|
+
const base = chunkCAAMBDEN_cjs.resolveBaseTheme(themeName);
|
|
23731
23774
|
if (themeName === "monochrome") {
|
|
23732
23775
|
return {
|
|
23733
23776
|
eventFill: "#ffffff",
|
|
@@ -23786,7 +23829,7 @@ function renderEpc(text2, config) {
|
|
|
23786
23829
|
function renderEpcLayout(layout, config) {
|
|
23787
23830
|
const themeName = config?.theme ?? "default";
|
|
23788
23831
|
const pal = epcPalette(themeName);
|
|
23789
|
-
const fontFamily = config?.fontFamily ??
|
|
23832
|
+
const fontFamily = config?.fontFamily ?? chunkCAAMBDEN_cjs.DEFAULT_FONT_FAMILY;
|
|
23790
23833
|
const pad = config?.padding ?? 0;
|
|
23791
23834
|
const { ast } = layout;
|
|
23792
23835
|
const width = layout.width + pad * 2;
|
|
@@ -23796,22 +23839,22 @@ function renderEpcLayout(layout, config) {
|
|
|
23796
23839
|
"style",
|
|
23797
23840
|
{},
|
|
23798
23841
|
`
|
|
23799
|
-
.sx-epc-bg { fill: ${
|
|
23800
|
-
.sx-epc-event { fill: ${pal.eventFill}; stroke: ${pal.eventStroke}; stroke-width: ${
|
|
23801
|
-
.sx-epc-func { fill: ${pal.funcFill}; stroke: ${pal.funcStroke}; stroke-width: ${
|
|
23802
|
-
.sx-epc-conn { fill: ${pal.connFill}; stroke: ${pal.connStroke}; stroke-width: ${
|
|
23842
|
+
.sx-epc-bg { fill: ${chunkCAAMBDEN_cjs.resolveBaseTheme(themeName).bg}; }
|
|
23843
|
+
.sx-epc-event { fill: ${pal.eventFill}; stroke: ${pal.eventStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; stroke-linejoin: round; }
|
|
23844
|
+
.sx-epc-func { fill: ${pal.funcFill}; stroke: ${pal.funcStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
23845
|
+
.sx-epc-conn { fill: ${pal.connFill}; stroke: ${pal.connStroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
23803
23846
|
.sx-epc-node[data-flagged="true"] .sx-epc-event,
|
|
23804
23847
|
.sx-epc-node[data-flagged="true"] .sx-epc-func,
|
|
23805
|
-
.sx-epc-node[data-flagged="true"] .sx-epc-conn { stroke: ${pal.flag}; stroke-width: ${
|
|
23806
|
-
.sx-epc-flagring { fill: none; stroke: ${pal.flag}; stroke-width: ${
|
|
23807
|
-
.sx-epc-label { fill: ${pal.labelText}; font-size: ${
|
|
23848
|
+
.sx-epc-node[data-flagged="true"] .sx-epc-conn { stroke: ${pal.flag}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thick}; }
|
|
23849
|
+
.sx-epc-flagring { fill: none; stroke: ${pal.flag}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin}; stroke-dasharray: 4 3; }
|
|
23850
|
+
.sx-epc-label { fill: ${pal.labelText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label}px; font-weight: 600; }
|
|
23808
23851
|
.sx-epc-glyph { fill: ${pal.connGlyph}; font-size: 17px; font-weight: 700; }
|
|
23809
|
-
.sx-epc-edge { fill: none; stroke: ${pal.edge}; stroke-width: ${
|
|
23852
|
+
.sx-epc-edge { fill: none; stroke: ${pal.edge}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
23810
23853
|
.sx-epc-edge[data-back="true"] { stroke: ${pal.backEdge}; stroke-dasharray: 5 4; }
|
|
23811
23854
|
.sx-epc-arrow { fill: ${pal.edge}; stroke: none; }
|
|
23812
23855
|
.sx-epc-arrow-back { fill: ${pal.backEdge}; stroke: none; }
|
|
23813
|
-
.sx-epc-edge-label { fill: ${pal.edgeLabel}; font-size: ${
|
|
23814
|
-
.sx-epc-title { fill: ${pal.labelText}; font-size: ${
|
|
23856
|
+
.sx-epc-edge-label { fill: ${pal.edgeLabel}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; }
|
|
23857
|
+
.sx-epc-title { fill: ${pal.labelText}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
23815
23858
|
`.trim()
|
|
23816
23859
|
);
|
|
23817
23860
|
const children = [
|
|
@@ -23842,7 +23885,7 @@ function renderEpcLayout(layout, config) {
|
|
|
23842
23885
|
];
|
|
23843
23886
|
const inner = [];
|
|
23844
23887
|
if (ast.title) {
|
|
23845
|
-
inner.push(chunk3WNW5Y7P_cjs.text({ x:
|
|
23888
|
+
inner.push(chunk3WNW5Y7P_cjs.text({ x: layout.width / 2, y: 22, class: "sx-epc-title", "font-family": fontFamily, "text-anchor": "middle" }, ast.title));
|
|
23846
23889
|
}
|
|
23847
23890
|
for (const e of layout.edges) inner.push(renderEdge6(e));
|
|
23848
23891
|
for (const n of layout.nodes) inner.push(renderNode3(n));
|
|
@@ -24122,13 +24165,13 @@ function parseFunction2(ast, rest, lineNo) {
|
|
|
24122
24165
|
ast.warnings.push(`Line ${lineNo}: box "${id}" redeclared \u2014 keeping first declaration.`);
|
|
24123
24166
|
return;
|
|
24124
24167
|
}
|
|
24125
|
-
const
|
|
24168
|
+
const box2 = {
|
|
24126
24169
|
id,
|
|
24127
24170
|
name,
|
|
24128
24171
|
// analysis assigns the real number; explicit wins if given.
|
|
24129
24172
|
number: explicitNumber ?? 0
|
|
24130
24173
|
};
|
|
24131
|
-
ast.boxes.push(
|
|
24174
|
+
ast.boxes.push(box2);
|
|
24132
24175
|
}
|
|
24133
24176
|
function parseRoleArrow(ast, role, rest, lineNo) {
|
|
24134
24177
|
const idM = /^([A-Za-z_]\w*)/.exec(rest);
|
|
@@ -24400,8 +24443,8 @@ function layoutIdef0(astIn) {
|
|
|
24400
24443
|
const C2 = IDEF0_CONST;
|
|
24401
24444
|
const ox = C2.MARGIN;
|
|
24402
24445
|
const oy = C2.MARGIN + C2.TITLE_H;
|
|
24403
|
-
const boxes = ast.boxes.map((
|
|
24404
|
-
box,
|
|
24446
|
+
const boxes = ast.boxes.map((box2, idx) => ({
|
|
24447
|
+
box: box2,
|
|
24405
24448
|
x: ox + idx * C2.STEP_X,
|
|
24406
24449
|
y: oy + idx * C2.STEP_Y,
|
|
24407
24450
|
width: C2.BOX_W,
|
|
@@ -24541,8 +24584,8 @@ function renderIdef0(text2, config) {
|
|
|
24541
24584
|
return renderIdef0Layout(layout, config);
|
|
24542
24585
|
}
|
|
24543
24586
|
function renderIdef0Layout(layout, config) {
|
|
24544
|
-
const theme =
|
|
24545
|
-
const fontFamily = config?.fontFamily ??
|
|
24587
|
+
const theme = chunkCAAMBDEN_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
24588
|
+
const fontFamily = config?.fontFamily ?? chunkCAAMBDEN_cjs.DEFAULT_FONT_FAMILY;
|
|
24546
24589
|
const pad = config?.padding ?? 0;
|
|
24547
24590
|
const { ast } = layout;
|
|
24548
24591
|
const width = layout.width + pad * 2;
|
|
@@ -24553,22 +24596,22 @@ function renderIdef0Layout(layout, config) {
|
|
|
24553
24596
|
{},
|
|
24554
24597
|
`
|
|
24555
24598
|
.sx-idef0-bg { fill: ${theme.bg}; }
|
|
24556
|
-
.sx-idef0-frame { fill: none; stroke: ${theme.stroke}; stroke-width: ${
|
|
24557
|
-
.sx-idef0-box { fill: ${theme.fillMuted}; stroke: ${theme.stroke}; stroke-width: ${
|
|
24558
|
-
.sx-idef0-box-name { fill: ${theme.text}; font-size: ${
|
|
24559
|
-
.sx-idef0-box-num { fill: ${theme.textMuted}; font-size: ${
|
|
24560
|
-
.sx-idef0-arrow { fill: none; stroke: ${theme.stroke}; stroke-width: ${
|
|
24599
|
+
.sx-idef0-frame { fill: none; stroke: ${theme.stroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
24600
|
+
.sx-idef0-box { fill: ${theme.fillMuted}; stroke: ${theme.stroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
24601
|
+
.sx-idef0-box-name { fill: ${theme.text}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label}px; font-weight: 600; }
|
|
24602
|
+
.sx-idef0-box-num { fill: ${theme.textMuted}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small + 1}px; font-weight: 700; }
|
|
24603
|
+
.sx-idef0-arrow { fill: none; stroke: ${theme.stroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
24561
24604
|
.sx-idef0-arrow[data-margin="true"] { stroke: ${theme.accent}; }
|
|
24562
24605
|
.sx-idef0-arrow[data-tunneled="true"] { stroke-dasharray: 5 3; }
|
|
24563
24606
|
.sx-idef0-head { fill: ${theme.stroke}; }
|
|
24564
24607
|
.sx-idef0-arrow[data-margin="true"] + .sx-idef0-head, .sx-idef0-head[data-margin="true"] { fill: ${theme.accent}; }
|
|
24565
|
-
.sx-idef0-label { fill: ${theme.text}; font-size: ${
|
|
24566
|
-
.sx-idef0-icom { fill: ${theme.textMuted}; font-size: ${
|
|
24567
|
-
.sx-idef0-title { fill: ${theme.text}; font-size: ${
|
|
24568
|
-
.sx-idef0-meta { fill: ${theme.textMuted}; font-size: ${
|
|
24569
|
-
.sx-idef0-tb { fill: none; stroke: ${theme.stroke}; stroke-width: ${
|
|
24570
|
-
.sx-idef0-tb-text { fill: ${theme.text}; font-size: ${
|
|
24571
|
-
.sx-idef0-tb-key { fill: ${theme.textMuted}; font-size: ${
|
|
24608
|
+
.sx-idef0-label { fill: ${theme.text}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small + 1}px; }
|
|
24609
|
+
.sx-idef0-icom { fill: ${theme.textMuted}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; font-weight: 700; }
|
|
24610
|
+
.sx-idef0-title { fill: ${theme.text}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
24611
|
+
.sx-idef0-meta { fill: ${theme.textMuted}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small + 1}px; }
|
|
24612
|
+
.sx-idef0-tb { fill: none; stroke: ${theme.stroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thin}; }
|
|
24613
|
+
.sx-idef0-tb-text { fill: ${theme.text}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small + 1}px; }
|
|
24614
|
+
.sx-idef0-tb-key { fill: ${theme.textMuted}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; font-weight: 700; }
|
|
24572
24615
|
`.trim()
|
|
24573
24616
|
);
|
|
24574
24617
|
const children = [
|
|
@@ -24580,7 +24623,7 @@ function renderIdef0Layout(layout, config) {
|
|
|
24580
24623
|
const inner = [];
|
|
24581
24624
|
if (ast.title) {
|
|
24582
24625
|
inner.push(
|
|
24583
|
-
chunk3WNW5Y7P_cjs.text({ x:
|
|
24626
|
+
chunk3WNW5Y7P_cjs.text({ x: layout.width / 2, y: 24, class: "sx-idef0-title", "font-family": fontFamily, "text-anchor": "middle" }, ast.title)
|
|
24584
24627
|
);
|
|
24585
24628
|
}
|
|
24586
24629
|
for (const a of layout.arrows) {
|
|
@@ -25354,8 +25397,8 @@ function renderThreatModel(text2, config) {
|
|
|
25354
25397
|
return renderThreatModelLayout(layout, config);
|
|
25355
25398
|
}
|
|
25356
25399
|
function renderThreatModelLayout(layout, config) {
|
|
25357
|
-
const theme =
|
|
25358
|
-
const fontFamily = config?.fontFamily ??
|
|
25400
|
+
const theme = chunkCAAMBDEN_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
25401
|
+
const fontFamily = config?.fontFamily ?? chunkCAAMBDEN_cjs.DEFAULT_FONT_FAMILY;
|
|
25359
25402
|
const pad = config?.padding ?? 0;
|
|
25360
25403
|
const width = layout.width + pad * 2;
|
|
25361
25404
|
const height = layout.height + pad * 2;
|
|
@@ -25366,24 +25409,24 @@ function renderThreatModelLayout(layout, config) {
|
|
|
25366
25409
|
{},
|
|
25367
25410
|
`
|
|
25368
25411
|
.sx-tm-bg { fill: ${theme.bg}; }
|
|
25369
|
-
.sx-tm-title { fill: ${theme.text}; font-size: ${
|
|
25370
|
-
.sx-tm-external { fill: ${theme.fillMuted}; stroke: ${theme.stroke}; stroke-width: ${
|
|
25371
|
-
.sx-tm-process { fill: ${theme.fill}; stroke: ${theme.stroke}; stroke-width: ${
|
|
25372
|
-
.sx-tm-store-line { fill: none; stroke: ${theme.stroke}; stroke-width: ${
|
|
25412
|
+
.sx-tm-title { fill: ${theme.text}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
25413
|
+
.sx-tm-external { fill: ${theme.fillMuted}; stroke: ${theme.stroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
25414
|
+
.sx-tm-process { fill: ${theme.fill}; stroke: ${theme.stroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
25415
|
+
.sx-tm-store-line { fill: none; stroke: ${theme.stroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
25373
25416
|
.sx-tm-store-bg { fill: ${theme.bg}; stroke: none; }
|
|
25374
|
-
.sx-tm-label { fill: ${theme.text}; font-size: ${
|
|
25375
|
-
.sx-tm-flow { fill: none; stroke: ${theme.stroke}; stroke-width: ${
|
|
25376
|
-
.sx-tm-flow[data-crossing="true"] { stroke: ${danger}; stroke-width: ${
|
|
25417
|
+
.sx-tm-label { fill: ${theme.text}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.label}px; font-weight: 600; }
|
|
25418
|
+
.sx-tm-flow { fill: none; stroke: ${theme.stroke}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; }
|
|
25419
|
+
.sx-tm-flow[data-crossing="true"] { stroke: ${danger}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.thick}; }
|
|
25377
25420
|
.sx-tm-arrow { fill: ${theme.stroke}; stroke: none; }
|
|
25378
25421
|
.sx-tm-arrow[data-crossing="true"] { fill: ${danger}; }
|
|
25379
|
-
.sx-tm-flow-label { fill: ${theme.text}; font-size: ${
|
|
25422
|
+
.sx-tm-flow-label { fill: ${theme.text}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; }
|
|
25380
25423
|
.sx-tm-flow-label[data-crossing="true"] { fill: ${danger}; font-weight: 700; }
|
|
25381
25424
|
.sx-tm-flow-halo { fill: ${theme.bg}; stroke: none; }
|
|
25382
|
-
.sx-tm-boundary { fill: none; stroke: ${danger}; stroke-width: ${
|
|
25383
|
-
.sx-tm-boundary-label { fill: ${danger}; font-size: ${
|
|
25425
|
+
.sx-tm-boundary { fill: none; stroke: ${danger}; stroke-width: ${chunkCAAMBDEN_cjs.STROKE_WIDTH.normal}; stroke-dasharray: 6 4; }
|
|
25426
|
+
.sx-tm-boundary-label { fill: ${danger}; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; font-weight: 700; }
|
|
25384
25427
|
.sx-tm-badge { fill: ${theme.accent}; }
|
|
25385
25428
|
.sx-tm-badge[data-cond-r="true"] { fill: ${danger}; }
|
|
25386
|
-
.sx-tm-badge-text { fill: #ffffff; font-size: ${
|
|
25429
|
+
.sx-tm-badge-text { fill: #ffffff; font-size: ${chunkCAAMBDEN_cjs.FONT_SIZE.small}px; font-weight: 700; }
|
|
25387
25430
|
`.trim()
|
|
25388
25431
|
);
|
|
25389
25432
|
const markerDefs = chunk3WNW5Y7P_cjs.defs([
|
|
@@ -25401,7 +25444,7 @@ function renderThreatModelLayout(layout, config) {
|
|
|
25401
25444
|
if (layout.ast.title) {
|
|
25402
25445
|
inner.push(
|
|
25403
25446
|
chunk3WNW5Y7P_cjs.text(
|
|
25404
|
-
{ x:
|
|
25447
|
+
{ x: layout.width / 2, y: 24, class: "sx-tm-title", "font-family": fontFamily, "text-anchor": "middle" },
|
|
25405
25448
|
layout.ast.title
|
|
25406
25449
|
)
|
|
25407
25450
|
);
|
|
@@ -27260,7 +27303,7 @@ function renderNode5(n, color, theme, fontFamily, orderClass) {
|
|
|
27260
27303
|
);
|
|
27261
27304
|
}
|
|
27262
27305
|
function renderMindmapAST(ast, themeName = "default", fontFamily = "system-ui, -apple-system, sans-serif") {
|
|
27263
|
-
const theme =
|
|
27306
|
+
const theme = chunkCAAMBDEN_cjs.resolveMindmapTheme(ast.themeOverride ?? themeName);
|
|
27264
27307
|
const mode = modeOf(ast);
|
|
27265
27308
|
const isWheel = mode === "futureswheel";
|
|
27266
27309
|
const layout = layoutMindmap(ast);
|
|
@@ -28319,7 +28362,8 @@ function layoutSipoc(ast) {
|
|
|
28319
28362
|
var QFD_CELL = 46;
|
|
28320
28363
|
var QFD_WHAT_LABEL_W = 190;
|
|
28321
28364
|
var QFD_WEIGHT_W = 46;
|
|
28322
|
-
var
|
|
28365
|
+
var QFD_HOW_FONT = 11.5;
|
|
28366
|
+
var QFD_HOW_ANGLE_SIN = Math.sin(60 * Math.PI / 180);
|
|
28323
28367
|
var QFD_FOOTER_H = 64;
|
|
28324
28368
|
var QFD_PAD = 24;
|
|
28325
28369
|
function layoutQfd(ast) {
|
|
@@ -28331,7 +28375,11 @@ function layoutQfd(ast) {
|
|
|
28331
28375
|
const roofH = Math.ceil(cellW / 2 * cols) + 8;
|
|
28332
28376
|
const whatLabelW = QFD_WHAT_LABEL_W;
|
|
28333
28377
|
const weightW = QFD_WEIGHT_W;
|
|
28334
|
-
const
|
|
28378
|
+
const maxHowW = Math.max(
|
|
28379
|
+
0,
|
|
28380
|
+
...(ast.qfd?.hows ?? []).map((h) => chunkY4OBXYGW_cjs.estimateTextWidth(h.label, QFD_HOW_FONT))
|
|
28381
|
+
);
|
|
28382
|
+
const howLabelH = Math.max(48, Math.min(220, Math.ceil(maxHowW * QFD_HOW_ANGLE_SIN) + 26));
|
|
28335
28383
|
const footerH = QFD_FOOTER_H;
|
|
28336
28384
|
const gridX0 = QFD_PAD + whatLabelW + weightW;
|
|
28337
28385
|
const gridY0 = QFD_PAD + titleH + roofH + howLabelH;
|
|
@@ -28468,76 +28516,78 @@ var HEAT_RAMP = [
|
|
|
28468
28516
|
"#ef4444",
|
|
28469
28517
|
"#b91c1c"
|
|
28470
28518
|
];
|
|
28471
|
-
|
|
28519
|
+
function buildMatrixCss(t) {
|
|
28520
|
+
return `
|
|
28472
28521
|
.sx-matrix { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
|
|
28473
|
-
.sx-matrix-title { font:
|
|
28474
|
-
.sx-matrix-grid { stroke:
|
|
28475
|
-
.sx-matrix-mid { stroke:
|
|
28476
|
-
.sx-matrix-plot-border { stroke:
|
|
28477
|
-
.sx-matrix-axis-label { font: 500 12px sans-serif; fill:
|
|
28478
|
-
.sx-matrix-axis-end { font: 500 11px sans-serif; fill:
|
|
28479
|
-
.sx-matrix-quad-annot { font: 600 13px sans-serif; fill:
|
|
28480
|
-
.sx-matrix-quad-desc { font: 400 10.5px sans-serif; fill:
|
|
28481
|
-
.sx-matrix-corr-header { font: 600 11.5px sans-serif; fill:
|
|
28482
|
-
.sx-matrix-corr-rowlabel { font: 500 11.5px sans-serif; fill:
|
|
28483
|
-
.sx-matrix-corr-margin { font: 500 11px sans-serif; fill:
|
|
28484
|
-
.sx-matrix-corr-margin-best { font: 700 11.5px sans-serif; fill:
|
|
28485
|
-
.sx-matrix-corr-grid { stroke:
|
|
28486
|
-
.sx-matrix-corr-rowbg-a { fill:
|
|
28487
|
-
.sx-matrix-corr-rowbg-b { fill:
|
|
28488
|
-
.sx-matrix-cell-label { font: 500 12px sans-serif; fill:
|
|
28489
|
-
.sx-matrix-cell-title { font: 600 13px sans-serif; fill:
|
|
28490
|
-
.sx-matrix-cell-subtitle { font: 400 11px sans-serif; fill:
|
|
28491
|
-
.sx-matrix-cell-item { font: 500 12px sans-serif; fill:
|
|
28492
|
-
.sx-matrix-cell-value { font: 600 18px sans-serif; fill:
|
|
28522
|
+
.sx-matrix-title { font: 700 16px sans-serif; fill: ${t.inkStrong}; }
|
|
28523
|
+
.sx-matrix-grid { stroke: ${t.gridFaint}; stroke-width: 1; fill: none; }
|
|
28524
|
+
.sx-matrix-mid { stroke: ${t.gridStrong}; stroke-width: 1.2; stroke-dasharray: 4 3; fill: none; }
|
|
28525
|
+
.sx-matrix-plot-border { stroke: ${t.inkMuted}; stroke-width: 1.2; fill: none; }
|
|
28526
|
+
.sx-matrix-axis-label { font: 500 12px sans-serif; fill: ${t.inkMuted}; }
|
|
28527
|
+
.sx-matrix-axis-end { font: 500 11px sans-serif; fill: ${t.inkFaint}; }
|
|
28528
|
+
.sx-matrix-quad-annot { font: 600 13px sans-serif; fill: ${t.inkMuted}; opacity: 0.75; }
|
|
28529
|
+
.sx-matrix-quad-desc { font: 400 10.5px sans-serif; fill: ${t.inkFaint}; opacity: 0.85; }
|
|
28530
|
+
.sx-matrix-corr-header { font: 600 11.5px sans-serif; fill: ${t.ink}; text-anchor: middle; }
|
|
28531
|
+
.sx-matrix-corr-rowlabel { font: 500 11.5px sans-serif; fill: ${t.ink}; text-anchor: end; dominant-baseline: central; }
|
|
28532
|
+
.sx-matrix-corr-margin { font: 500 11px sans-serif; fill: ${t.inkMuted}; text-anchor: middle; dominant-baseline: central; }
|
|
28533
|
+
.sx-matrix-corr-margin-best { font: 700 11.5px sans-serif; fill: ${t.inkStrong}; text-anchor: middle; dominant-baseline: central; }
|
|
28534
|
+
.sx-matrix-corr-grid { stroke: ${t.grid}; stroke-width: 0.8; fill: none; }
|
|
28535
|
+
.sx-matrix-corr-rowbg-a { fill: ${t.surfaceTint}; }
|
|
28536
|
+
.sx-matrix-corr-rowbg-b { fill: ${t.surface}; }
|
|
28537
|
+
.sx-matrix-cell-label { font: 500 12px sans-serif; fill: ${t.ink}; text-anchor: middle; }
|
|
28538
|
+
.sx-matrix-cell-title { font: 600 13px sans-serif; fill: ${t.inkStrong}; }
|
|
28539
|
+
.sx-matrix-cell-subtitle { font: 400 11px sans-serif; fill: ${t.inkFaint}; }
|
|
28540
|
+
.sx-matrix-cell-item { font: 500 12px sans-serif; fill: ${t.ink}; }
|
|
28541
|
+
.sx-matrix-cell-value { font: 600 18px sans-serif; fill: ${t.inkStrong}; text-anchor: middle; }
|
|
28493
28542
|
.sx-matrix-bubble { stroke-width: 1.5; }
|
|
28494
|
-
.sx-matrix-label { font: 500 11px sans-serif; fill:
|
|
28495
|
-
.sx-matrix-leader { stroke:
|
|
28496
|
-
.sx-matrix-legend-text { font: 500 11px sans-serif; fill:
|
|
28497
|
-
.sx-matrix-offchart { fill:
|
|
28498
|
-
.sx-sipoc-header { font: 700 13px sans-serif; fill:
|
|
28499
|
-
.sx-sipoc-headbox { stroke:
|
|
28500
|
-
.sx-sipoc-cell { fill:
|
|
28501
|
-
.sx-sipoc-cell-alt { fill:
|
|
28502
|
-
.sx-sipoc-process { fill:
|
|
28503
|
-
.sx-sipoc-item { font: 500 12px sans-serif; fill:
|
|
28504
|
-
.sx-sipoc-step { font: 600 12px sans-serif; fill:
|
|
28505
|
-
.sx-qfd-grid { stroke:
|
|
28506
|
-
.sx-qfd-cellbg { fill:
|
|
28507
|
-
.sx-qfd-cellbg-alt { fill:
|
|
28508
|
-
.sx-qfd-what { font: 500 12px sans-serif; fill:
|
|
28509
|
-
.sx-qfd-how { font: 500 11.5px sans-serif; fill:
|
|
28510
|
-
.sx-qfd-weight { font: 600 12px sans-serif; fill:
|
|
28511
|
-
.sx-qfd-weight-head { font: 600 10px sans-serif; fill:
|
|
28512
|
-
.sx-qfd-rel-strong { fill:
|
|
28513
|
-
.sx-qfd-rel-medium { fill:
|
|
28514
|
-
.sx-qfd-rel-weak { fill: none; stroke:
|
|
28515
|
-
.sx-qfd-roof-cell { fill:
|
|
28516
|
-
.sx-qfd-roof-cell-filled { fill:
|
|
28543
|
+
.sx-matrix-label { font: 500 11px sans-serif; fill: ${t.inkStrong}; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
|
|
28544
|
+
.sx-matrix-leader { stroke: ${t.gridStrong}; stroke-width: 0.6; opacity: 0.7; fill: none; }
|
|
28545
|
+
.sx-matrix-legend-text { font: 500 11px sans-serif; fill: ${t.inkMuted}; }
|
|
28546
|
+
.sx-matrix-offchart { fill: ${t.warnDeep}; }
|
|
28547
|
+
.sx-sipoc-header { font: 700 13px sans-serif; fill: ${t.onHeader}; text-anchor: middle; dominant-baseline: central; }
|
|
28548
|
+
.sx-sipoc-headbox { stroke: ${t.surface}; stroke-width: 1; }
|
|
28549
|
+
.sx-sipoc-cell { fill: ${t.surface}; stroke: ${t.gridMid}; stroke-width: 1; }
|
|
28550
|
+
.sx-sipoc-cell-alt { fill: ${t.surfaceAlt}; stroke: ${t.gridMid}; stroke-width: 1; }
|
|
28551
|
+
.sx-sipoc-process { fill: ${t.accentTint}; stroke: ${t.gridMid}; stroke-width: 1; }
|
|
28552
|
+
.sx-sipoc-item { font: 500 12px sans-serif; fill: ${t.ink}; text-anchor: middle; dominant-baseline: central; }
|
|
28553
|
+
.sx-sipoc-step { font: 600 12px sans-serif; fill: ${t.accentDeep}; text-anchor: middle; dominant-baseline: central; }
|
|
28554
|
+
.sx-qfd-grid { stroke: ${t.gridMid}; stroke-width: 1; fill: none; }
|
|
28555
|
+
.sx-qfd-cellbg { fill: ${t.surface}; }
|
|
28556
|
+
.sx-qfd-cellbg-alt { fill: ${t.surfaceAlt}; }
|
|
28557
|
+
.sx-qfd-what { font: 500 12px sans-serif; fill: ${t.ink}; text-anchor: end; dominant-baseline: central; }
|
|
28558
|
+
.sx-qfd-how { font: 500 11.5px sans-serif; fill: ${t.ink}; }
|
|
28559
|
+
.sx-qfd-weight { font: 600 12px sans-serif; fill: ${t.inkStrong}; text-anchor: middle; dominant-baseline: central; }
|
|
28560
|
+
.sx-qfd-weight-head { font: 600 10px sans-serif; fill: ${t.inkMuted}; text-anchor: middle; dominant-baseline: central; }
|
|
28561
|
+
.sx-qfd-rel-strong { fill: ${t.accent}; }
|
|
28562
|
+
.sx-qfd-rel-medium { fill: ${t.accentSoft}; stroke: ${t.accent}; stroke-width: 1.4; }
|
|
28563
|
+
.sx-qfd-rel-weak { fill: none; stroke: ${t.accent}; stroke-width: 1.4; }
|
|
28564
|
+
.sx-qfd-roof-cell { fill: ${t.surfaceAlt}; stroke: ${t.gridStrong}; stroke-width: 0.8; }
|
|
28565
|
+
.sx-qfd-roof-cell-filled { fill: ${t.roofFilled}; stroke: ${t.inkFaint}; stroke-width: 0.9; }
|
|
28517
28566
|
.sx-qfd-corr { font: 700 13px sans-serif; text-anchor: middle; dominant-baseline: central; }
|
|
28518
|
-
.sx-qfd-corr-strong-pos { fill:
|
|
28519
|
-
.sx-qfd-corr-pos { fill:
|
|
28520
|
-
.sx-qfd-corr-neg { fill:
|
|
28521
|
-
.sx-qfd-corr-strong-neg { fill:
|
|
28522
|
-
.sx-qfd-imp-band { fill:
|
|
28523
|
-
.sx-qfd-imp-head { font: 600 11px sans-serif; fill:
|
|
28524
|
-
.sx-qfd-imp-value { font: 700 13px sans-serif; fill:
|
|
28525
|
-
.sx-qfd-imp-value-top { font: 800 14px sans-serif; fill:
|
|
28526
|
-
.sx-qfd-dir { font: 700 13px sans-serif; fill:
|
|
28527
|
-
.sx-punnett-corner { fill:
|
|
28528
|
-
.sx-punnett-cornerline { stroke:
|
|
28529
|
-
.sx-punnett-corner-p1 { font: 600 11px sans-serif; fill:
|
|
28530
|
-
.sx-punnett-corner-p2 { font: 600 11px sans-serif; fill:
|
|
28531
|
-
.sx-punnett-header { fill:
|
|
28532
|
-
.sx-punnett-gamete { font: 700 14px ui-monospace, "SF Mono", Menlo, monospace; fill:
|
|
28533
|
-
.sx-punnett-cell { stroke:
|
|
28534
|
-
.sx-punnett-genotype { font: 700 15px ui-monospace, "SF Mono", Menlo, monospace; fill:
|
|
28535
|
-
.sx-punnett-footer-head { font: 700 13px sans-serif; fill:
|
|
28536
|
-
.sx-punnett-legend { font: 500 12.5px sans-serif; fill:
|
|
28537
|
-
.sx-punnett-geno-ratio { font: 500 12px sans-serif; fill:
|
|
28538
|
-
.sx-punnett-hint { font: 500 13px sans-serif; fill:
|
|
28567
|
+
.sx-qfd-corr-strong-pos { fill: ${t.positiveDeep}; }
|
|
28568
|
+
.sx-qfd-corr-pos { fill: ${t.positive}; }
|
|
28569
|
+
.sx-qfd-corr-neg { fill: ${t.negative}; }
|
|
28570
|
+
.sx-qfd-corr-strong-neg { fill: ${t.negativeDeep}; }
|
|
28571
|
+
.sx-qfd-imp-band { fill: ${t.accentTint}; stroke: ${t.gridMid}; stroke-width: 1; }
|
|
28572
|
+
.sx-qfd-imp-head { font: 600 11px sans-serif; fill: ${t.accentDeep}; text-anchor: end; dominant-baseline: central; }
|
|
28573
|
+
.sx-qfd-imp-value { font: 700 13px sans-serif; fill: ${t.accentDeep}; text-anchor: middle; dominant-baseline: central; }
|
|
28574
|
+
.sx-qfd-imp-value-top { font: 800 14px sans-serif; fill: ${t.negative}; text-anchor: middle; dominant-baseline: central; }
|
|
28575
|
+
.sx-qfd-dir { font: 700 13px sans-serif; fill: ${t.inkMuted}; text-anchor: middle; dominant-baseline: central; }
|
|
28576
|
+
.sx-punnett-corner { fill: ${t.cornerFill}; stroke: ${t.gridStrong}; stroke-width: 1; }
|
|
28577
|
+
.sx-punnett-cornerline { stroke: ${t.gridMid}; stroke-width: 1; }
|
|
28578
|
+
.sx-punnett-corner-p1 { font: 600 11px sans-serif; fill: ${t.accentDeep}; dominant-baseline: hanging; }
|
|
28579
|
+
.sx-punnett-corner-p2 { font: 600 11px sans-serif; fill: ${t.accentDeep}; }
|
|
28580
|
+
.sx-punnett-header { fill: ${t.headerFill}; stroke: ${t.gridStrong}; stroke-width: 1; }
|
|
28581
|
+
.sx-punnett-gamete { font: 700 14px ui-monospace, "SF Mono", Menlo, monospace; fill: ${t.inkStrong}; text-anchor: middle; dominant-baseline: central; }
|
|
28582
|
+
.sx-punnett-cell { stroke: ${t.gridStrong}; stroke-width: 1; }
|
|
28583
|
+
.sx-punnett-genotype { font: 700 15px ui-monospace, "SF Mono", Menlo, monospace; fill: ${t.inkStrong}; text-anchor: middle; dominant-baseline: central; }
|
|
28584
|
+
.sx-punnett-footer-head { font: 700 13px sans-serif; fill: ${t.inkStrong}; }
|
|
28585
|
+
.sx-punnett-legend { font: 500 12.5px sans-serif; fill: ${t.ink}; dominant-baseline: central; }
|
|
28586
|
+
.sx-punnett-geno-ratio { font: 500 12px sans-serif; fill: ${t.inkMuted}; }
|
|
28587
|
+
.sx-punnett-hint { font: 500 13px sans-serif; fill: ${t.inkFaint}; text-anchor: middle; }
|
|
28539
28588
|
`.trim();
|
|
28540
|
-
|
|
28589
|
+
}
|
|
28590
|
+
function axisArrow(t) {
|
|
28541
28591
|
return chunk3WNW5Y7P_cjs.el(
|
|
28542
28592
|
"marker",
|
|
28543
28593
|
{
|
|
@@ -28549,7 +28599,7 @@ function axisArrow() {
|
|
|
28549
28599
|
markerHeight: 8,
|
|
28550
28600
|
orient: "auto-start-reverse"
|
|
28551
28601
|
},
|
|
28552
|
-
[chunk3WNW5Y7P_cjs.el("path", { d: "M0,0 L10,5 L0,10 z", fill:
|
|
28602
|
+
[chunk3WNW5Y7P_cjs.el("path", { d: "M0,0 L10,5 L0,10 z", fill: t.border })]
|
|
28553
28603
|
);
|
|
28554
28604
|
}
|
|
28555
28605
|
function bubbleFill(p, categories) {
|
|
@@ -29336,7 +29386,8 @@ function wrapToLines(textStr, maxChars, maxLines) {
|
|
|
29336
29386
|
kept[maxLines - 1] = kept[maxLines - 1].replace(/\s+\S*$/, "") + "\u2026";
|
|
29337
29387
|
return kept;
|
|
29338
29388
|
}
|
|
29339
|
-
function renderSipocAST(ast) {
|
|
29389
|
+
function renderSipocAST(ast, config) {
|
|
29390
|
+
const t = chunkCAAMBDEN_cjs.resolveMatrixTheme(config?.theme ?? "default");
|
|
29340
29391
|
const sipoc = ast.sipoc ?? { suppliers: [], inputs: [], process: [], outputs: [], customers: [] };
|
|
29341
29392
|
const lay = layoutSipoc(ast);
|
|
29342
29393
|
const nodes = [];
|
|
@@ -29418,7 +29469,7 @@ function renderSipocAST(ast) {
|
|
|
29418
29469
|
chunk3WNW5Y7P_cjs.desc(
|
|
29419
29470
|
`SIPOC scoping table \u2014 ${sipoc.suppliers.length} supplier(s), ${sipoc.inputs.length} input(s), ${sipoc.process.length} process step(s), ${sipoc.outputs.length} output(s), ${sipoc.customers.length} customer(s)`
|
|
29420
29471
|
),
|
|
29421
|
-
chunk3WNW5Y7P_cjs.defs([chunk3WNW5Y7P_cjs.el("style", {},
|
|
29472
|
+
chunk3WNW5Y7P_cjs.defs([chunk3WNW5Y7P_cjs.el("style", {}, buildMatrixCss(t))]),
|
|
29422
29473
|
...nodes
|
|
29423
29474
|
]
|
|
29424
29475
|
);
|
|
@@ -29457,7 +29508,8 @@ function renderQfdRelationshipSymbol(strength, cx, cy, r6) {
|
|
|
29457
29508
|
class: "sx-qfd-rel-weak"
|
|
29458
29509
|
});
|
|
29459
29510
|
}
|
|
29460
|
-
function renderQfdAST(ast) {
|
|
29511
|
+
function renderQfdAST(ast, config) {
|
|
29512
|
+
const t = chunkCAAMBDEN_cjs.resolveMatrixTheme(config?.theme ?? "default");
|
|
29461
29513
|
const qfd = ast.qfd ?? { whats: [], hows: [], relationships: [], roof: [], normalize: false };
|
|
29462
29514
|
const lay = layoutQfd(ast);
|
|
29463
29515
|
const importance = computeQfdImportance(qfd);
|
|
@@ -29647,7 +29699,7 @@ function renderQfdAST(ast) {
|
|
|
29647
29699
|
chunk3WNW5Y7P_cjs.desc(
|
|
29648
29700
|
`QFD House of Quality \u2014 ${qfd.whats.length} customer requirement(s), ${qfd.hows.length} engineering characteristic(s), ${qfd.relationships.length} relationship(s); technical importance computed per column`
|
|
29649
29701
|
),
|
|
29650
|
-
chunk3WNW5Y7P_cjs.defs([chunk3WNW5Y7P_cjs.el("style", {},
|
|
29702
|
+
chunk3WNW5Y7P_cjs.defs([chunk3WNW5Y7P_cjs.el("style", {}, buildMatrixCss(t))]),
|
|
29651
29703
|
...nodes
|
|
29652
29704
|
]
|
|
29653
29705
|
);
|
|
@@ -29661,7 +29713,8 @@ function genotypeText(parent, genes) {
|
|
|
29661
29713
|
return a === dom ? a + b : b === dom ? b + a : a + b;
|
|
29662
29714
|
}).join("");
|
|
29663
29715
|
}
|
|
29664
|
-
function renderPunnettAST(ast) {
|
|
29716
|
+
function renderPunnettAST(ast, config) {
|
|
29717
|
+
const t = chunkCAAMBDEN_cjs.resolveMatrixTheme(config?.theme ?? "default");
|
|
29665
29718
|
const pd = ast.punnett;
|
|
29666
29719
|
const lay = layoutPunnett(ast);
|
|
29667
29720
|
const svgWrap = (body, descText2) => chunk3WNW5Y7P_cjs.svgRoot(
|
|
@@ -29677,7 +29730,7 @@ function renderPunnettAST(ast) {
|
|
|
29677
29730
|
[
|
|
29678
29731
|
chunk3WNW5Y7P_cjs.title(ast.title ? `Punnett square \u2014 ${chunk3WNW5Y7P_cjs.escapeXml(ast.title)}` : "Punnett square"),
|
|
29679
29732
|
chunk3WNW5Y7P_cjs.desc(descText2),
|
|
29680
|
-
chunk3WNW5Y7P_cjs.defs([chunk3WNW5Y7P_cjs.el("style", {},
|
|
29733
|
+
chunk3WNW5Y7P_cjs.defs([chunk3WNW5Y7P_cjs.el("style", {}, buildMatrixCss(t))]),
|
|
29681
29734
|
...body
|
|
29682
29735
|
]
|
|
29683
29736
|
);
|
|
@@ -29772,10 +29825,11 @@ function renderPunnettAST(ast) {
|
|
|
29772
29825
|
const descText = `Punnett square \u2014 ${pd.genes.length === 1 ? "monohybrid" : pd.genes.length === 2 ? "dihybrid" : `${pd.genes.length}-gene`} cross ${genotypeText(pd.parent1, pd.genes)} \xD7 ${genotypeText(pd.parent2, pd.genes)}; phenotype ratio ${footer.phenotypeRatio}`;
|
|
29773
29826
|
return svgWrap(nodes, descText);
|
|
29774
29827
|
}
|
|
29775
|
-
function renderMatrixAST(ast) {
|
|
29776
|
-
if (ast.mode === "sipoc") return renderSipocAST(ast);
|
|
29777
|
-
if (ast.mode === "qfd") return renderQfdAST(ast);
|
|
29778
|
-
if (ast.mode === "punnett") return renderPunnettAST(ast);
|
|
29828
|
+
function renderMatrixAST(ast, config) {
|
|
29829
|
+
if (ast.mode === "sipoc") return renderSipocAST(ast, config);
|
|
29830
|
+
if (ast.mode === "qfd") return renderQfdAST(ast, config);
|
|
29831
|
+
if (ast.mode === "punnett") return renderPunnettAST(ast, config);
|
|
29832
|
+
const t = chunkCAAMBDEN_cjs.resolveMatrixTheme(config?.theme ?? "default");
|
|
29779
29833
|
const lay = layoutMatrix(ast);
|
|
29780
29834
|
const needsLegendSpace = lay.categories.length > 0 || ast.mode === "correlation";
|
|
29781
29835
|
const extraWidth = needsLegendSpace && lay.plot.x0 + lay.plot.w + 140 > lay.canvasWidth ? 160 : 0;
|
|
@@ -29809,14 +29863,14 @@ function renderMatrixAST(ast) {
|
|
|
29809
29863
|
chunk3WNW5Y7P_cjs.desc(
|
|
29810
29864
|
`Matrix diagram${ast.template ? ` (${ast.template} template)` : ""}, ${ast.mode} mode, ${ast.points.length} point(s)`
|
|
29811
29865
|
),
|
|
29812
|
-
chunk3WNW5Y7P_cjs.defs([chunk3WNW5Y7P_cjs.el("style", {},
|
|
29866
|
+
chunk3WNW5Y7P_cjs.defs([chunk3WNW5Y7P_cjs.el("style", {}, buildMatrixCss(t)), axisArrow(t)]),
|
|
29813
29867
|
...body
|
|
29814
29868
|
]
|
|
29815
29869
|
);
|
|
29816
29870
|
}
|
|
29817
|
-
function renderMatrix(text2) {
|
|
29871
|
+
function renderMatrix(text2, config) {
|
|
29818
29872
|
const ast = parseMatrix(text2);
|
|
29819
|
-
return renderMatrixAST(ast);
|
|
29873
|
+
return renderMatrixAST(ast, config);
|
|
29820
29874
|
}
|
|
29821
29875
|
|
|
29822
29876
|
// src/diagrams/matrix/index.ts
|
|
@@ -29827,8 +29881,8 @@ var matrix = {
|
|
|
29827
29881
|
return first.startsWith("matrix");
|
|
29828
29882
|
},
|
|
29829
29883
|
parse: parseMatrix,
|
|
29830
|
-
render(text2) {
|
|
29831
|
-
return renderMatrix(text2);
|
|
29884
|
+
render(text2, config) {
|
|
29885
|
+
return renderMatrix(text2, config);
|
|
29832
29886
|
}
|
|
29833
29887
|
};
|
|
29834
29888
|
|
|
@@ -30953,7 +31007,7 @@ function renderEdge7(edge) {
|
|
|
30953
31007
|
return chunk3WNW5Y7P_cjs.group({ class: "lt-erd-edge-group" }, parts);
|
|
30954
31008
|
}
|
|
30955
31009
|
function renderErdAst(result, themeName = "default") {
|
|
30956
|
-
const theme =
|
|
31010
|
+
const theme = chunkCAAMBDEN_cjs.resolveBaseTheme(themeName);
|
|
30957
31011
|
const { entities, edges, width, height, ast } = result;
|
|
30958
31012
|
const cssBlock = chunk3WNW5Y7P_cjs.el("style", {}, buildCss11(theme));
|
|
30959
31013
|
const titleNode = chunk3WNW5Y7P_cjs.title(ast.title ?? "Schematex ERD");
|
|
@@ -32028,7 +32082,7 @@ var WIRE_COLOR_MAP = {
|
|
|
32028
32082
|
function buildCss12(t) {
|
|
32029
32083
|
return `
|
|
32030
32084
|
.lt-bb { font-family: system-ui, -apple-system, sans-serif; }
|
|
32031
|
-
.lt-bb-title { font:
|
|
32085
|
+
.lt-bb-title { font: 700 16px sans-serif; fill: ${t.text}; }
|
|
32032
32086
|
.lt-bb-substrate { fill: #e7d8b6; stroke: #b08c4f; stroke-width: 1.5; }
|
|
32033
32087
|
.lt-bb-rail-pos { fill: #fde2e2; stroke: #dc2626; stroke-width: 0.6; }
|
|
32034
32088
|
.lt-bb-rail-neg { fill: #dde7fa; stroke: #2563eb; stroke-width: 0.6; }
|
|
@@ -32172,10 +32226,10 @@ function renderWire(lw) {
|
|
|
32172
32226
|
return path2 + dot1 + dot2;
|
|
32173
32227
|
}
|
|
32174
32228
|
function renderBreadboardLayout(layout, config) {
|
|
32175
|
-
const theme =
|
|
32229
|
+
const theme = chunkCAAMBDEN_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
32176
32230
|
const css = buildCss12(theme);
|
|
32177
32231
|
const titleStr = layout.ast.title ?? "Breadboard";
|
|
32178
|
-
const titleNode = layout.ast.title ? chunk3WNW5Y7P_cjs.text({ x:
|
|
32232
|
+
const titleNode = layout.ast.title ? chunk3WNW5Y7P_cjs.text({ x: layout.width / 2, y: 22, class: "lt-bb-title", "text-anchor": "middle" }, layout.ast.title) : "";
|
|
32179
32233
|
const substrate = renderSubstrate(layout.substrate);
|
|
32180
32234
|
const parts = layout.parts.map(renderPart).join("\n");
|
|
32181
32235
|
const wires = layout.wires.map(renderWire).join("\n");
|
|
@@ -33038,26 +33092,19 @@ function routeMessageFlow(f, objCenter, poolByLabel) {
|
|
|
33038
33092
|
|
|
33039
33093
|
// src/diagrams/bpmn/renderer.ts
|
|
33040
33094
|
var FONT_FAMILY = "system-ui, -apple-system, 'Segoe UI', sans-serif";
|
|
33041
|
-
var STROKE = "#1f2937";
|
|
33042
|
-
var STROKE_LIGHT = "#94a3b8";
|
|
33043
|
-
var POOL_FILL = "#ffffff";
|
|
33044
|
-
var LANE_FILL = "#fafbfc";
|
|
33045
|
-
var TASK_FILL = "#ffffff";
|
|
33046
|
-
var GATEWAY_FILL = "#fffbeb";
|
|
33047
|
-
var EVENT_FILL = "#ffffff";
|
|
33048
|
-
var LABEL_BAND_FILL = "#f1f5f9";
|
|
33049
33095
|
function renderBpmn(textInput, config) {
|
|
33050
33096
|
const ast = parseBpmn(textInput);
|
|
33051
33097
|
const layout = layoutBpmn(ast);
|
|
33052
|
-
return renderBpmnLayout(layout);
|
|
33098
|
+
return renderBpmnLayout(layout, config);
|
|
33053
33099
|
}
|
|
33054
|
-
function renderBpmnLayout(layout,
|
|
33100
|
+
function renderBpmnLayout(layout, config) {
|
|
33055
33101
|
const { width, height, ast } = layout;
|
|
33102
|
+
const t = chunkCAAMBDEN_cjs.resolveBpmnTheme(config?.theme ?? "default");
|
|
33056
33103
|
const out = [];
|
|
33057
33104
|
out.push(chunk3WNW5Y7P_cjs.title(ast.title ?? "BPMN diagram"));
|
|
33058
33105
|
out.push(chunk3WNW5Y7P_cjs.desc(`BPMN ${ast.direction} \u2014 ${ast.pools.length} pool(s), ${layout.objects.length} flow object(s).`));
|
|
33059
|
-
out.push(buildDefs());
|
|
33060
|
-
for (const pl2 of layout.pools) out.push(renderPool(pl2));
|
|
33106
|
+
out.push(buildDefs(t));
|
|
33107
|
+
for (const pl2 of layout.pools) out.push(renderPool(pl2, t));
|
|
33061
33108
|
for (const lan of layout.lanes) {
|
|
33062
33109
|
out.push(
|
|
33063
33110
|
chunk3WNW5Y7P_cjs.group({ class: "schematex-bpmn-lane" }, [
|
|
@@ -33066,8 +33113,8 @@ function renderBpmnLayout(layout, _config) {
|
|
|
33066
33113
|
y: lan.y,
|
|
33067
33114
|
width: lan.width - lan.labelHeight,
|
|
33068
33115
|
height: lan.height,
|
|
33069
|
-
fill:
|
|
33070
|
-
stroke:
|
|
33116
|
+
fill: t.laneFill,
|
|
33117
|
+
stroke: t.bpmnStroke,
|
|
33071
33118
|
"stroke-width": 1
|
|
33072
33119
|
}),
|
|
33073
33120
|
chunk3WNW5Y7P_cjs.rect({
|
|
@@ -33075,8 +33122,8 @@ function renderBpmnLayout(layout, _config) {
|
|
|
33075
33122
|
y: lan.y,
|
|
33076
33123
|
width: lan.labelHeight,
|
|
33077
33124
|
height: lan.height,
|
|
33078
|
-
fill:
|
|
33079
|
-
stroke:
|
|
33125
|
+
fill: t.labelBandFill,
|
|
33126
|
+
stroke: t.bpmnStroke,
|
|
33080
33127
|
"stroke-width": 1
|
|
33081
33128
|
}),
|
|
33082
33129
|
chunk3WNW5Y7P_cjs.text(
|
|
@@ -33088,15 +33135,15 @@ function renderBpmnLayout(layout, _config) {
|
|
|
33088
33135
|
"dominant-baseline": "middle",
|
|
33089
33136
|
"font-family": FONT_FAMILY,
|
|
33090
33137
|
"font-size": 12,
|
|
33091
|
-
fill:
|
|
33138
|
+
fill: t.bpmnText
|
|
33092
33139
|
},
|
|
33093
33140
|
lan.lane.label
|
|
33094
33141
|
)
|
|
33095
33142
|
])
|
|
33096
33143
|
);
|
|
33097
33144
|
}
|
|
33098
|
-
for (const fl of layout.flows) out.push(renderFlow2(fl));
|
|
33099
|
-
for (const ol of layout.objects) out.push(renderObject(ol));
|
|
33145
|
+
for (const fl of layout.flows) out.push(renderFlow2(fl, t));
|
|
33146
|
+
for (const ol of layout.objects) out.push(renderObject(ol, t));
|
|
33100
33147
|
return chunk3WNW5Y7P_cjs.svgRoot(
|
|
33101
33148
|
{
|
|
33102
33149
|
width,
|
|
@@ -33107,7 +33154,7 @@ function renderBpmnLayout(layout, _config) {
|
|
|
33107
33154
|
out
|
|
33108
33155
|
);
|
|
33109
33156
|
}
|
|
33110
|
-
function buildDefs() {
|
|
33157
|
+
function buildDefs(t) {
|
|
33111
33158
|
return chunk3WNW5Y7P_cjs.defs([
|
|
33112
33159
|
// Sequence flow — filled triangle.
|
|
33113
33160
|
chunk3WNW5Y7P_cjs.el(
|
|
@@ -33124,7 +33171,7 @@ function buildDefs() {
|
|
|
33124
33171
|
[
|
|
33125
33172
|
chunk3WNW5Y7P_cjs.el("path", {
|
|
33126
33173
|
d: "M 0 0 L 10 5 L 0 10 z",
|
|
33127
|
-
fill:
|
|
33174
|
+
fill: t.flowStroke
|
|
33128
33175
|
})
|
|
33129
33176
|
]
|
|
33130
33177
|
),
|
|
@@ -33143,8 +33190,8 @@ function buildDefs() {
|
|
|
33143
33190
|
[
|
|
33144
33191
|
chunk3WNW5Y7P_cjs.el("path", {
|
|
33145
33192
|
d: "M 0 0 L 10 5 L 0 10 z",
|
|
33146
|
-
fill:
|
|
33147
|
-
stroke:
|
|
33193
|
+
fill: t.poolFill,
|
|
33194
|
+
stroke: t.msgFlowStroke,
|
|
33148
33195
|
"stroke-width": 1
|
|
33149
33196
|
})
|
|
33150
33197
|
]
|
|
@@ -33162,12 +33209,12 @@ function buildDefs() {
|
|
|
33162
33209
|
orient: "auto"
|
|
33163
33210
|
},
|
|
33164
33211
|
[
|
|
33165
|
-
chunk3WNW5Y7P_cjs.el("circle", { cx: 5, cy: 5, r: 3, fill:
|
|
33212
|
+
chunk3WNW5Y7P_cjs.el("circle", { cx: 5, cy: 5, r: 3, fill: t.poolFill, stroke: t.msgFlowStroke })
|
|
33166
33213
|
]
|
|
33167
33214
|
)
|
|
33168
33215
|
]);
|
|
33169
33216
|
}
|
|
33170
|
-
function renderPool(pl2) {
|
|
33217
|
+
function renderPool(pl2, t) {
|
|
33171
33218
|
const labelCx = pl2.labelX + pl2.labelWidth / 2;
|
|
33172
33219
|
const labelCy = pl2.labelY + pl2.height / 2;
|
|
33173
33220
|
if (pl2.pool.blackbox) {
|
|
@@ -33177,8 +33224,8 @@ function renderPool(pl2) {
|
|
|
33177
33224
|
y: pl2.y,
|
|
33178
33225
|
width: pl2.width,
|
|
33179
33226
|
height: pl2.height,
|
|
33180
|
-
fill:
|
|
33181
|
-
stroke:
|
|
33227
|
+
fill: t.poolFill,
|
|
33228
|
+
stroke: t.bpmnStroke,
|
|
33182
33229
|
"stroke-width": 1.5
|
|
33183
33230
|
}),
|
|
33184
33231
|
chunk3WNW5Y7P_cjs.rect({
|
|
@@ -33186,8 +33233,8 @@ function renderPool(pl2) {
|
|
|
33186
33233
|
y: pl2.y,
|
|
33187
33234
|
width: pl2.labelWidth,
|
|
33188
33235
|
height: pl2.height,
|
|
33189
|
-
fill:
|
|
33190
|
-
stroke:
|
|
33236
|
+
fill: t.labelBandFill,
|
|
33237
|
+
stroke: t.bpmnStroke,
|
|
33191
33238
|
"stroke-width": 1
|
|
33192
33239
|
}),
|
|
33193
33240
|
chunk3WNW5Y7P_cjs.text(
|
|
@@ -33200,7 +33247,7 @@ function renderPool(pl2) {
|
|
|
33200
33247
|
"font-family": FONT_FAMILY,
|
|
33201
33248
|
"font-size": 13,
|
|
33202
33249
|
"font-weight": "bold",
|
|
33203
|
-
fill:
|
|
33250
|
+
fill: t.bpmnText
|
|
33204
33251
|
},
|
|
33205
33252
|
pl2.pool.label
|
|
33206
33253
|
)
|
|
@@ -33212,8 +33259,8 @@ function renderPool(pl2) {
|
|
|
33212
33259
|
y: pl2.y,
|
|
33213
33260
|
width: pl2.width,
|
|
33214
33261
|
height: pl2.height,
|
|
33215
|
-
fill:
|
|
33216
|
-
stroke:
|
|
33262
|
+
fill: t.poolFill,
|
|
33263
|
+
stroke: t.bpmnStroke,
|
|
33217
33264
|
"stroke-width": 1.5
|
|
33218
33265
|
}),
|
|
33219
33266
|
chunk3WNW5Y7P_cjs.rect({
|
|
@@ -33221,8 +33268,8 @@ function renderPool(pl2) {
|
|
|
33221
33268
|
y: pl2.y,
|
|
33222
33269
|
width: pl2.labelWidth,
|
|
33223
33270
|
height: pl2.height,
|
|
33224
|
-
fill:
|
|
33225
|
-
stroke:
|
|
33271
|
+
fill: t.labelBandFill,
|
|
33272
|
+
stroke: t.bpmnStroke,
|
|
33226
33273
|
"stroke-width": 1
|
|
33227
33274
|
}),
|
|
33228
33275
|
chunk3WNW5Y7P_cjs.text(
|
|
@@ -33235,19 +33282,19 @@ function renderPool(pl2) {
|
|
|
33235
33282
|
"font-family": FONT_FAMILY,
|
|
33236
33283
|
"font-size": 13,
|
|
33237
33284
|
"font-weight": "bold",
|
|
33238
|
-
fill:
|
|
33285
|
+
fill: t.bpmnText
|
|
33239
33286
|
},
|
|
33240
33287
|
pl2.pool.label
|
|
33241
33288
|
)
|
|
33242
33289
|
]);
|
|
33243
33290
|
}
|
|
33244
|
-
function renderObject(ol) {
|
|
33291
|
+
function renderObject(ol, t) {
|
|
33245
33292
|
const o = ol.obj;
|
|
33246
|
-
if ("gatewayKind" in o) return renderGateway(ol);
|
|
33247
|
-
if ("marker" in o) return renderActivity(ol);
|
|
33248
|
-
return renderEvent2(ol);
|
|
33293
|
+
if ("gatewayKind" in o) return renderGateway(ol, t);
|
|
33294
|
+
if ("marker" in o) return renderActivity(ol, t);
|
|
33295
|
+
return renderEvent2(ol, t);
|
|
33249
33296
|
}
|
|
33250
|
-
function renderActivity(ol) {
|
|
33297
|
+
function renderActivity(ol, t) {
|
|
33251
33298
|
const a = ol.obj;
|
|
33252
33299
|
const isSubproc = a.kind === "subprocess-collapsed";
|
|
33253
33300
|
const cx = ol.x + ol.width / 2;
|
|
@@ -33260,8 +33307,8 @@ function renderActivity(ol) {
|
|
|
33260
33307
|
height: ol.height,
|
|
33261
33308
|
rx: 10,
|
|
33262
33309
|
ry: 10,
|
|
33263
|
-
fill:
|
|
33264
|
-
stroke:
|
|
33310
|
+
fill: t.taskFill,
|
|
33311
|
+
stroke: t.taskStroke,
|
|
33265
33312
|
"stroke-width": 1.5
|
|
33266
33313
|
}),
|
|
33267
33314
|
chunk3WNW5Y7P_cjs.multilineText(
|
|
@@ -33272,14 +33319,14 @@ function renderActivity(ol) {
|
|
|
33272
33319
|
"dominant-baseline": "middle",
|
|
33273
33320
|
"font-family": FONT_FAMILY,
|
|
33274
33321
|
"font-size": 12,
|
|
33275
|
-
fill:
|
|
33322
|
+
fill: t.bpmnText
|
|
33276
33323
|
},
|
|
33277
33324
|
a.label,
|
|
33278
33325
|
14
|
|
33279
33326
|
)
|
|
33280
33327
|
];
|
|
33281
33328
|
if (a.kind === "task" && a.marker !== "abstract") {
|
|
33282
|
-
children.push(taskMarker(ol.x + 6, ol.y + 6, a.marker));
|
|
33329
|
+
children.push(taskMarker(ol.x + 6, ol.y + 6, a.marker, t));
|
|
33283
33330
|
}
|
|
33284
33331
|
if (isSubproc) {
|
|
33285
33332
|
const mx = cx;
|
|
@@ -33291,53 +33338,53 @@ function renderActivity(ol) {
|
|
|
33291
33338
|
width: 12,
|
|
33292
33339
|
height: 12,
|
|
33293
33340
|
fill: "none",
|
|
33294
|
-
stroke:
|
|
33341
|
+
stroke: t.bpmnStroke,
|
|
33295
33342
|
"stroke-width": 1
|
|
33296
33343
|
}),
|
|
33297
33344
|
chunk3WNW5Y7P_cjs.el("path", {
|
|
33298
33345
|
d: `M ${mx - 4} ${my} L ${mx + 4} ${my} M ${mx} ${my - 4} L ${mx} ${my + 4}`,
|
|
33299
|
-
stroke:
|
|
33346
|
+
stroke: t.bpmnStroke,
|
|
33300
33347
|
"stroke-width": 1
|
|
33301
33348
|
})
|
|
33302
33349
|
);
|
|
33303
33350
|
}
|
|
33304
33351
|
return chunk3WNW5Y7P_cjs.group({ class: `schematex-bpmn-task marker-${a.marker}` }, children);
|
|
33305
33352
|
}
|
|
33306
|
-
function taskMarker(x, y, marker) {
|
|
33353
|
+
function taskMarker(x, y, marker, t) {
|
|
33307
33354
|
const cx = x + 7;
|
|
33308
33355
|
const cy = y + 7;
|
|
33309
33356
|
if (marker === "user") {
|
|
33310
33357
|
return chunk3WNW5Y7P_cjs.el("g", { class: "marker-user" }, [
|
|
33311
|
-
chunk3WNW5Y7P_cjs.el("circle", { cx, cy: cy - 1, r: 2.5, fill: "none", stroke:
|
|
33358
|
+
chunk3WNW5Y7P_cjs.el("circle", { cx, cy: cy - 1, r: 2.5, fill: "none", stroke: t.bpmnStroke, "stroke-width": 1 }),
|
|
33312
33359
|
chunk3WNW5Y7P_cjs.el("path", {
|
|
33313
33360
|
d: `M ${cx - 5} ${cy + 6} Q ${cx} ${cy + 1} ${cx + 5} ${cy + 6}`,
|
|
33314
33361
|
fill: "none",
|
|
33315
|
-
stroke:
|
|
33362
|
+
stroke: t.bpmnStroke,
|
|
33316
33363
|
"stroke-width": 1
|
|
33317
33364
|
})
|
|
33318
33365
|
]);
|
|
33319
33366
|
}
|
|
33320
33367
|
if (marker === "service") {
|
|
33321
33368
|
return chunk3WNW5Y7P_cjs.el("g", { class: "marker-service" }, [
|
|
33322
|
-
chunk3WNW5Y7P_cjs.el("circle", { cx, cy, r: 4, fill: "none", stroke:
|
|
33323
|
-
chunk3WNW5Y7P_cjs.el("circle", { cx, cy, r: 1.5, fill:
|
|
33369
|
+
chunk3WNW5Y7P_cjs.el("circle", { cx, cy, r: 4, fill: "none", stroke: t.bpmnStroke, "stroke-width": 1 }),
|
|
33370
|
+
chunk3WNW5Y7P_cjs.el("circle", { cx, cy, r: 1.5, fill: t.bpmnStroke }),
|
|
33324
33371
|
chunk3WNW5Y7P_cjs.el("path", {
|
|
33325
33372
|
d: `M ${cx} ${cy - 6} L ${cx} ${cy - 4} M ${cx} ${cy + 4} L ${cx} ${cy + 6} M ${cx - 6} ${cy} L ${cx - 4} ${cy} M ${cx + 4} ${cy} L ${cx + 6} ${cy}`,
|
|
33326
|
-
stroke:
|
|
33373
|
+
stroke: t.bpmnStroke,
|
|
33327
33374
|
"stroke-width": 1
|
|
33328
33375
|
})
|
|
33329
33376
|
]);
|
|
33330
33377
|
}
|
|
33331
33378
|
if (marker === "send") {
|
|
33332
33379
|
return chunk3WNW5Y7P_cjs.el("g", { class: "marker-send" }, [
|
|
33333
|
-
chunk3WNW5Y7P_cjs.el("rect", { x: cx - 5, y: cy - 3, width: 10, height: 7, fill:
|
|
33334
|
-
chunk3WNW5Y7P_cjs.el("path", { d: `M ${cx - 5} ${cy - 3} L ${cx} ${cy + 1} L ${cx + 5} ${cy - 3}`, stroke:
|
|
33380
|
+
chunk3WNW5Y7P_cjs.el("rect", { x: cx - 5, y: cy - 3, width: 10, height: 7, fill: t.bpmnStroke }),
|
|
33381
|
+
chunk3WNW5Y7P_cjs.el("path", { d: `M ${cx - 5} ${cy - 3} L ${cx} ${cy + 1} L ${cx + 5} ${cy - 3}`, stroke: t.poolFill, "stroke-width": 1, fill: "none" })
|
|
33335
33382
|
]);
|
|
33336
33383
|
}
|
|
33337
33384
|
if (marker === "receive") {
|
|
33338
33385
|
return chunk3WNW5Y7P_cjs.el("g", { class: "marker-receive" }, [
|
|
33339
|
-
chunk3WNW5Y7P_cjs.el("rect", { x: cx - 5, y: cy - 3, width: 10, height: 7, fill: "none", stroke:
|
|
33340
|
-
chunk3WNW5Y7P_cjs.el("path", { d: `M ${cx - 5} ${cy - 3} L ${cx} ${cy + 1} L ${cx + 5} ${cy - 3}`, stroke:
|
|
33386
|
+
chunk3WNW5Y7P_cjs.el("rect", { x: cx - 5, y: cy - 3, width: 10, height: 7, fill: "none", stroke: t.bpmnStroke, "stroke-width": 1 }),
|
|
33387
|
+
chunk3WNW5Y7P_cjs.el("path", { d: `M ${cx - 5} ${cy - 3} L ${cx} ${cy + 1} L ${cx + 5} ${cy - 3}`, stroke: t.bpmnStroke, "stroke-width": 1, fill: "none" })
|
|
33341
33388
|
]);
|
|
33342
33389
|
}
|
|
33343
33390
|
if (marker === "manual") {
|
|
@@ -33345,7 +33392,7 @@ function taskMarker(x, y, marker) {
|
|
|
33345
33392
|
chunk3WNW5Y7P_cjs.el("path", {
|
|
33346
33393
|
d: `M ${cx - 3} ${cy + 4} L ${cx - 3} ${cy} L ${cx - 1.5} ${cy} L ${cx - 1.5} ${cy - 4} L ${cx} ${cy - 4} L ${cx} ${cy} L ${cx + 1.5} ${cy} L ${cx + 1.5} ${cy + 1} L ${cx + 3} ${cy + 1} L ${cx + 3} ${cy + 4} z`,
|
|
33347
33394
|
fill: "none",
|
|
33348
|
-
stroke:
|
|
33395
|
+
stroke: t.bpmnStroke,
|
|
33349
33396
|
"stroke-width": 1
|
|
33350
33397
|
})
|
|
33351
33398
|
]);
|
|
@@ -33355,19 +33402,19 @@ function taskMarker(x, y, marker) {
|
|
|
33355
33402
|
chunk3WNW5Y7P_cjs.el("path", {
|
|
33356
33403
|
d: `M ${cx - 4} ${cy - 5} Q ${cx - 6} ${cy} ${cx - 4} ${cy + 5} L ${cx + 4} ${cy + 5} Q ${cx + 2} ${cy} ${cx + 4} ${cy - 5} z`,
|
|
33357
33404
|
fill: "none",
|
|
33358
|
-
stroke:
|
|
33405
|
+
stroke: t.bpmnStroke,
|
|
33359
33406
|
"stroke-width": 1
|
|
33360
33407
|
}),
|
|
33361
33408
|
chunk3WNW5Y7P_cjs.el("path", {
|
|
33362
33409
|
d: `M ${cx - 2} ${cy - 2} L ${cx + 2} ${cy - 2} M ${cx - 2} ${cy} L ${cx + 2} ${cy} M ${cx - 2} ${cy + 2} L ${cx + 2} ${cy + 2}`,
|
|
33363
|
-
stroke:
|
|
33410
|
+
stroke: t.bpmnStroke,
|
|
33364
33411
|
"stroke-width": 0.8
|
|
33365
33412
|
})
|
|
33366
33413
|
]);
|
|
33367
33414
|
}
|
|
33368
33415
|
return "";
|
|
33369
33416
|
}
|
|
33370
|
-
function renderGateway(ol) {
|
|
33417
|
+
function renderGateway(ol, t) {
|
|
33371
33418
|
const g = ol.obj;
|
|
33372
33419
|
const cx = ol.x + ol.width / 2;
|
|
33373
33420
|
const cy = ol.y + ol.height / 2;
|
|
@@ -33379,7 +33426,7 @@ function renderGateway(ol) {
|
|
|
33379
33426
|
inner.push(
|
|
33380
33427
|
chunk3WNW5Y7P_cjs.el("path", {
|
|
33381
33428
|
d: `M ${cx - a} ${cy - a} L ${cx + a} ${cy + a} M ${cx + a} ${cy - a} L ${cx - a} ${cy + a}`,
|
|
33382
|
-
stroke:
|
|
33429
|
+
stroke: t.gatewayGlyph,
|
|
33383
33430
|
"stroke-width": 2.5,
|
|
33384
33431
|
"stroke-linecap": "round"
|
|
33385
33432
|
})
|
|
@@ -33389,7 +33436,7 @@ function renderGateway(ol) {
|
|
|
33389
33436
|
inner.push(
|
|
33390
33437
|
chunk3WNW5Y7P_cjs.el("path", {
|
|
33391
33438
|
d: `M ${cx - a} ${cy} L ${cx + a} ${cy} M ${cx} ${cy - a} L ${cx} ${cy + a}`,
|
|
33392
|
-
stroke:
|
|
33439
|
+
stroke: t.gatewayGlyph,
|
|
33393
33440
|
"stroke-width": 2.5,
|
|
33394
33441
|
"stroke-linecap": "round"
|
|
33395
33442
|
})
|
|
@@ -33401,7 +33448,7 @@ function renderGateway(ol) {
|
|
|
33401
33448
|
cy,
|
|
33402
33449
|
r: r6 * 0.45,
|
|
33403
33450
|
fill: "none",
|
|
33404
|
-
stroke:
|
|
33451
|
+
stroke: t.gatewayGlyph,
|
|
33405
33452
|
"stroke-width": 2
|
|
33406
33453
|
})
|
|
33407
33454
|
);
|
|
@@ -33412,7 +33459,7 @@ function renderGateway(ol) {
|
|
|
33412
33459
|
cy,
|
|
33413
33460
|
r: r6 * 0.55,
|
|
33414
33461
|
fill: "none",
|
|
33415
|
-
stroke:
|
|
33462
|
+
stroke: t.gatewayGlyph,
|
|
33416
33463
|
"stroke-width": 1
|
|
33417
33464
|
})
|
|
33418
33465
|
);
|
|
@@ -33426,7 +33473,7 @@ function renderGateway(ol) {
|
|
|
33426
33473
|
chunk3WNW5Y7P_cjs.el("polygon", {
|
|
33427
33474
|
points: pts.join(" "),
|
|
33428
33475
|
fill: "none",
|
|
33429
|
-
stroke:
|
|
33476
|
+
stroke: t.gatewayGlyph,
|
|
33430
33477
|
"stroke-width": 1.2
|
|
33431
33478
|
})
|
|
33432
33479
|
);
|
|
@@ -33439,22 +33486,22 @@ function renderGateway(ol) {
|
|
|
33439
33486
|
"text-anchor": "middle",
|
|
33440
33487
|
"font-family": FONT_FAMILY,
|
|
33441
33488
|
"font-size": 11,
|
|
33442
|
-
fill:
|
|
33489
|
+
fill: t.bpmnText
|
|
33443
33490
|
},
|
|
33444
33491
|
labelStr
|
|
33445
33492
|
) : "";
|
|
33446
33493
|
return chunk3WNW5Y7P_cjs.group({ class: `schematex-bpmn-gateway kind-${g.gatewayKind}` }, [
|
|
33447
33494
|
chunk3WNW5Y7P_cjs.el("polygon", {
|
|
33448
33495
|
points,
|
|
33449
|
-
fill:
|
|
33450
|
-
stroke:
|
|
33496
|
+
fill: t.gatewayFill,
|
|
33497
|
+
stroke: t.gatewayStroke,
|
|
33451
33498
|
"stroke-width": 1.5
|
|
33452
33499
|
}),
|
|
33453
33500
|
...inner,
|
|
33454
33501
|
labelEl
|
|
33455
33502
|
]);
|
|
33456
33503
|
}
|
|
33457
|
-
function renderEvent2(ol) {
|
|
33504
|
+
function renderEvent2(ol, t) {
|
|
33458
33505
|
const e = ol.obj;
|
|
33459
33506
|
const cx = ol.x + ol.width / 2;
|
|
33460
33507
|
const cy = ol.y + ol.height / 2;
|
|
@@ -33462,14 +33509,16 @@ function renderEvent2(ol) {
|
|
|
33462
33509
|
const isEnd = e.kind === "end";
|
|
33463
33510
|
const isIntermediate = e.kind === "intermediate";
|
|
33464
33511
|
const strokeW = isEnd ? 3 : 1.2;
|
|
33512
|
+
const fill = isEnd ? t.endFill : isIntermediate ? t.intermediateFill : t.startFill;
|
|
33513
|
+
const ring = isEnd ? t.endStroke : isIntermediate ? t.intermediateStroke : t.startStroke;
|
|
33465
33514
|
const children = [];
|
|
33466
33515
|
children.push(
|
|
33467
33516
|
chunk3WNW5Y7P_cjs.el("circle", {
|
|
33468
33517
|
cx,
|
|
33469
33518
|
cy,
|
|
33470
33519
|
r: r6,
|
|
33471
|
-
fill
|
|
33472
|
-
stroke:
|
|
33520
|
+
fill,
|
|
33521
|
+
stroke: ring,
|
|
33473
33522
|
"stroke-width": strokeW
|
|
33474
33523
|
})
|
|
33475
33524
|
);
|
|
@@ -33480,16 +33529,16 @@ function renderEvent2(ol) {
|
|
|
33480
33529
|
cy,
|
|
33481
33530
|
r: r6 - 3,
|
|
33482
33531
|
fill: "none",
|
|
33483
|
-
stroke:
|
|
33532
|
+
stroke: ring,
|
|
33484
33533
|
"stroke-width": 1.2
|
|
33485
33534
|
})
|
|
33486
33535
|
);
|
|
33487
33536
|
}
|
|
33488
33537
|
const filled = e.throwCatch === "throw" && (isIntermediate || isEnd);
|
|
33489
33538
|
if (e.trigger === "message") {
|
|
33490
|
-
children.push(messageGlyph(cx, cy, r6 * 0.55, filled));
|
|
33539
|
+
children.push(messageGlyph(cx, cy, r6 * 0.55, filled, t));
|
|
33491
33540
|
} else if (e.trigger === "timer") {
|
|
33492
|
-
children.push(timerGlyph(cx, cy, r6 * 0.55));
|
|
33541
|
+
children.push(timerGlyph(cx, cy, r6 * 0.55, t));
|
|
33493
33542
|
}
|
|
33494
33543
|
if (e.label) {
|
|
33495
33544
|
children.push(
|
|
@@ -33500,7 +33549,7 @@ function renderEvent2(ol) {
|
|
|
33500
33549
|
"text-anchor": "middle",
|
|
33501
33550
|
"font-family": FONT_FAMILY,
|
|
33502
33551
|
"font-size": 11,
|
|
33503
|
-
fill:
|
|
33552
|
+
fill: t.bpmnText
|
|
33504
33553
|
},
|
|
33505
33554
|
e.label
|
|
33506
33555
|
)
|
|
@@ -33508,7 +33557,7 @@ function renderEvent2(ol) {
|
|
|
33508
33557
|
}
|
|
33509
33558
|
return chunk3WNW5Y7P_cjs.group({ class: `schematex-bpmn-event kind-${e.kind} trigger-${e.trigger}` }, children);
|
|
33510
33559
|
}
|
|
33511
|
-
function messageGlyph(cx, cy, size, filled) {
|
|
33560
|
+
function messageGlyph(cx, cy, size, filled, t) {
|
|
33512
33561
|
const w = size;
|
|
33513
33562
|
const h = size * 0.7;
|
|
33514
33563
|
const x = cx - w / 2;
|
|
@@ -33519,19 +33568,19 @@ function messageGlyph(cx, cy, size, filled) {
|
|
|
33519
33568
|
y,
|
|
33520
33569
|
width: w,
|
|
33521
33570
|
height: h,
|
|
33522
|
-
fill: filled ?
|
|
33523
|
-
stroke:
|
|
33571
|
+
fill: filled ? t.bpmnStroke : t.poolFill,
|
|
33572
|
+
stroke: t.bpmnStroke,
|
|
33524
33573
|
"stroke-width": 1
|
|
33525
33574
|
}),
|
|
33526
33575
|
chunk3WNW5Y7P_cjs.el("path", {
|
|
33527
33576
|
d: `M ${x} ${y} L ${cx} ${y + h * 0.55} L ${x + w} ${y}`,
|
|
33528
|
-
stroke: filled ?
|
|
33577
|
+
stroke: filled ? t.poolFill : t.bpmnStroke,
|
|
33529
33578
|
"stroke-width": 1,
|
|
33530
33579
|
fill: "none"
|
|
33531
33580
|
})
|
|
33532
33581
|
]);
|
|
33533
33582
|
}
|
|
33534
|
-
function timerGlyph(cx, cy, size) {
|
|
33583
|
+
function timerGlyph(cx, cy, size, t) {
|
|
33535
33584
|
const r6 = size / 2;
|
|
33536
33585
|
const ticks = [];
|
|
33537
33586
|
for (let k = 0; k < 12; k++) {
|
|
@@ -33543,18 +33592,18 @@ function timerGlyph(cx, cy, size) {
|
|
|
33543
33592
|
ticks.push(`M ${t1x} ${t1y} L ${t2x} ${t2y}`);
|
|
33544
33593
|
}
|
|
33545
33594
|
return chunk3WNW5Y7P_cjs.el("g", { class: "trigger-timer" }, [
|
|
33546
|
-
chunk3WNW5Y7P_cjs.el("circle", { cx, cy, r: r6, fill: "none", stroke:
|
|
33547
|
-
chunk3WNW5Y7P_cjs.el("path", { d: ticks.join(" "), stroke:
|
|
33595
|
+
chunk3WNW5Y7P_cjs.el("circle", { cx, cy, r: r6, fill: "none", stroke: t.bpmnStroke, "stroke-width": 1 }),
|
|
33596
|
+
chunk3WNW5Y7P_cjs.el("path", { d: ticks.join(" "), stroke: t.bpmnStroke, "stroke-width": 0.8 }),
|
|
33548
33597
|
// Hands
|
|
33549
33598
|
chunk3WNW5Y7P_cjs.el("path", {
|
|
33550
33599
|
d: `M ${cx} ${cy} L ${cx} ${cy - r6 * 0.7} M ${cx} ${cy} L ${cx + r6 * 0.5} ${cy}`,
|
|
33551
|
-
stroke:
|
|
33600
|
+
stroke: t.bpmnStroke,
|
|
33552
33601
|
"stroke-width": 1.2,
|
|
33553
33602
|
"stroke-linecap": "round"
|
|
33554
33603
|
})
|
|
33555
33604
|
]);
|
|
33556
33605
|
}
|
|
33557
|
-
function renderFlow2(fl) {
|
|
33606
|
+
function renderFlow2(fl, t) {
|
|
33558
33607
|
const f = fl.flow;
|
|
33559
33608
|
const isMessage = f.kind === "message";
|
|
33560
33609
|
const dasharray = isMessage ? "6 4" : void 0;
|
|
@@ -33564,7 +33613,7 @@ function renderFlow2(fl) {
|
|
|
33564
33613
|
chunk3WNW5Y7P_cjs.path({
|
|
33565
33614
|
d: fl.path,
|
|
33566
33615
|
fill: "none",
|
|
33567
|
-
stroke: isMessage ?
|
|
33616
|
+
stroke: isMessage ? t.msgFlowStroke : t.flowStroke,
|
|
33568
33617
|
"stroke-width": 1.4,
|
|
33569
33618
|
"stroke-dasharray": dasharray,
|
|
33570
33619
|
"marker-start": markerStart,
|
|
@@ -33577,8 +33626,8 @@ function renderFlow2(fl) {
|
|
|
33577
33626
|
children.push(
|
|
33578
33627
|
chunk3WNW5Y7P_cjs.el("polygon", {
|
|
33579
33628
|
points: diamondPoints(head.x, head.y, 5),
|
|
33580
|
-
fill:
|
|
33581
|
-
stroke:
|
|
33629
|
+
fill: t.poolFill,
|
|
33630
|
+
stroke: t.flowStroke,
|
|
33582
33631
|
"stroke-width": 1
|
|
33583
33632
|
})
|
|
33584
33633
|
);
|
|
@@ -33590,7 +33639,7 @@ function renderFlow2(fl) {
|
|
|
33590
33639
|
children.push(
|
|
33591
33640
|
chunk3WNW5Y7P_cjs.el("path", {
|
|
33592
33641
|
d: `M ${head.x - 4} ${head.y + 4} L ${head.x + 4} ${head.y - 4}`,
|
|
33593
|
-
stroke:
|
|
33642
|
+
stroke: t.flowStroke,
|
|
33594
33643
|
"stroke-width": 1.5
|
|
33595
33644
|
})
|
|
33596
33645
|
);
|
|
@@ -33605,7 +33654,7 @@ function renderFlow2(fl) {
|
|
|
33605
33654
|
"text-anchor": "middle",
|
|
33606
33655
|
"font-family": FONT_FAMILY,
|
|
33607
33656
|
"font-size": 10,
|
|
33608
|
-
fill:
|
|
33657
|
+
fill: t.bpmnText
|
|
33609
33658
|
},
|
|
33610
33659
|
f.label
|
|
33611
33660
|
)
|
|
@@ -33637,7 +33686,7 @@ var bpmn = {
|
|
|
33637
33686
|
},
|
|
33638
33687
|
parse: parseBpmn,
|
|
33639
33688
|
render(text2, config) {
|
|
33640
|
-
return renderBpmn(text2);
|
|
33689
|
+
return renderBpmn(text2, config);
|
|
33641
33690
|
}
|
|
33642
33691
|
};
|
|
33643
33692
|
|
|
@@ -35924,26 +35973,2528 @@ var sfc = {
|
|
|
35924
35973
|
}
|
|
35925
35974
|
};
|
|
35926
35975
|
|
|
35976
|
+
// src/diagrams/floorplan/catalog.ts
|
|
35977
|
+
var CHAIR_W = 0.44;
|
|
35978
|
+
var CHAIR_D = 0.38;
|
|
35979
|
+
var CHAIR_GAP = 0.27;
|
|
35980
|
+
var CHAIR_OVERHANG = 0.5;
|
|
35981
|
+
var RING = 0.45;
|
|
35982
|
+
function chairAt(px, cx, cy, deg) {
|
|
35983
|
+
const body = chunk3WNW5Y7P_cjs.rect({
|
|
35984
|
+
class: "sx-fp-chair",
|
|
35985
|
+
x: px(-CHAIR_W / 2),
|
|
35986
|
+
y: px(-CHAIR_D / 2),
|
|
35987
|
+
width: px(CHAIR_W),
|
|
35988
|
+
height: px(CHAIR_D),
|
|
35989
|
+
rx: px(0.09)
|
|
35990
|
+
});
|
|
35991
|
+
const rot = Math.round(deg * 10) / 10;
|
|
35992
|
+
return chunk3WNW5Y7P_cjs.el("g", { transform: `translate(${px(cx)},${px(cy)}) rotate(${rot})` }, [body]);
|
|
35993
|
+
}
|
|
35994
|
+
function edgeChairs(c, top, bottom) {
|
|
35995
|
+
const n = Math.max(1, Math.round(c.w / 0.65));
|
|
35996
|
+
const out = [];
|
|
35997
|
+
for (let i = 0; i < n; i++) {
|
|
35998
|
+
const cx = (i + 0.5) / n * c.w;
|
|
35999
|
+
if (top) out.push(chairAt(c.px, cx, -CHAIR_GAP, 0));
|
|
36000
|
+
out.push(chairAt(c.px, cx, c.h + CHAIR_GAP, 180));
|
|
36001
|
+
}
|
|
36002
|
+
return out.join("");
|
|
36003
|
+
}
|
|
36004
|
+
function box(c, cls = "sx-fp-furn", rx = 0) {
|
|
36005
|
+
return chunk3WNW5Y7P_cjs.rect({ class: cls, x: 0, y: 0, width: c.px(c.w), height: c.px(c.h), rx: rx ? c.px(rx) : void 0 });
|
|
36006
|
+
}
|
|
36007
|
+
function glyphText(c, label) {
|
|
36008
|
+
return chunk3WNW5Y7P_cjs.text(
|
|
36009
|
+
{
|
|
36010
|
+
class: "sx-fp-furn-text",
|
|
36011
|
+
x: c.px(c.w / 2),
|
|
36012
|
+
y: c.px(c.h / 2),
|
|
36013
|
+
"text-anchor": "middle",
|
|
36014
|
+
"dominant-baseline": "central",
|
|
36015
|
+
"font-size": c.px(Math.min(0.24, c.h * 0.4))
|
|
36016
|
+
},
|
|
36017
|
+
label
|
|
36018
|
+
);
|
|
36019
|
+
}
|
|
36020
|
+
function bedDraw(pillows) {
|
|
36021
|
+
return (c) => {
|
|
36022
|
+
const parts = [box(c, "sx-fp-furn", 0.05)];
|
|
36023
|
+
const pw = pillows === 2 ? c.w / 2 - 0.18 : c.w - 0.24;
|
|
36024
|
+
parts.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn", x: c.px(0.12), y: c.px(0.1), width: c.px(pw), height: c.px(0.42), rx: c.px(0.06) }));
|
|
36025
|
+
if (pillows === 2) {
|
|
36026
|
+
parts.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn", x: c.px(c.w / 2 + 0.06), y: c.px(0.1), width: c.px(pw), height: c.px(0.42), rx: c.px(0.06) }));
|
|
36027
|
+
}
|
|
36028
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: 0, y1: c.px(0.72), x2: c.px(c.w), y2: c.px(0.72) }));
|
|
36029
|
+
return parts.join("");
|
|
36030
|
+
};
|
|
36031
|
+
}
|
|
36032
|
+
function sofaDraw(cushions) {
|
|
36033
|
+
return (c) => {
|
|
36034
|
+
const parts = [box(c, "sx-fp-furn", 0.08)];
|
|
36035
|
+
parts.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn", x: c.px(0.15), y: 0, width: c.px(c.w - 0.3), height: c.px(0.18), rx: c.px(0.05) }));
|
|
36036
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(0.15), y1: c.px(0.18), x2: c.px(0.15), y2: c.px(c.h - 0.05) }));
|
|
36037
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(c.w - 0.15), y1: c.px(0.18), x2: c.px(c.w - 0.15), y2: c.px(c.h - 0.05) }));
|
|
36038
|
+
for (let i = 1; i < cushions; i++) {
|
|
36039
|
+
const x = c.px(0.15 + (c.w - 0.3) * i / cushions);
|
|
36040
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: x, y1: c.px(0.18), x2: x, y2: c.px(c.h - 0.08) }));
|
|
36041
|
+
}
|
|
36042
|
+
return parts.join("");
|
|
36043
|
+
};
|
|
36044
|
+
}
|
|
36045
|
+
function shelfDraw(c) {
|
|
36046
|
+
const parts = [box(c)];
|
|
36047
|
+
const n = Math.max(2, Math.round(c.w / 0.15));
|
|
36048
|
+
for (let i = 1; i < n; i++) {
|
|
36049
|
+
const x = c.px(c.w * i / n);
|
|
36050
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: x, y1: 0, x2: x, y2: c.px(c.h) }));
|
|
36051
|
+
}
|
|
36052
|
+
return parts.join("");
|
|
36053
|
+
}
|
|
36054
|
+
function boardDraw(c) {
|
|
36055
|
+
return [
|
|
36056
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-solid", x: 0, y: 0, width: c.px(c.w), height: c.px(c.h) }),
|
|
36057
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-board-inner", x: c.px(0.08), y: c.px(c.h * 0.2), width: c.px(c.w - 0.16), height: c.px(c.h * 0.6) })
|
|
36058
|
+
].join("");
|
|
36059
|
+
}
|
|
36060
|
+
function applianceDraw(label, drum) {
|
|
36061
|
+
return (c) => {
|
|
36062
|
+
const parts = [box(c)];
|
|
36063
|
+
if (drum) {
|
|
36064
|
+
parts.push(chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-line", cx: c.px(c.w / 2), cy: c.px(c.h / 2), r: c.px(Math.min(c.w, c.h) * 0.32) }));
|
|
36065
|
+
} else {
|
|
36066
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: 0, y1: c.px(0.12), x2: c.px(c.w), y2: c.px(0.12) }));
|
|
36067
|
+
}
|
|
36068
|
+
parts.push(glyphText(c, label));
|
|
36069
|
+
return parts.join("");
|
|
36070
|
+
};
|
|
36071
|
+
}
|
|
36072
|
+
function roundTable(seats, diaM) {
|
|
36073
|
+
const nominal = diaM + 2 * RING;
|
|
36074
|
+
return {
|
|
36075
|
+
w: nominal,
|
|
36076
|
+
h: nominal,
|
|
36077
|
+
draw: (c) => {
|
|
36078
|
+
const half = Math.min(c.w, c.h) / 2;
|
|
36079
|
+
const ring = Math.min(RING, half * 0.37);
|
|
36080
|
+
const r6 = half - ring;
|
|
36081
|
+
const cx = c.w / 2;
|
|
36082
|
+
const cy = c.h / 2;
|
|
36083
|
+
const parts = [chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn", cx: c.px(cx), cy: c.px(cy), r: c.px(r6) })];
|
|
36084
|
+
for (let i = 0; i < seats; i++) {
|
|
36085
|
+
const a = i / seats * 2 * Math.PI - Math.PI / 2;
|
|
36086
|
+
const px0 = cx + (r6 + ring * 0.55) * Math.cos(a);
|
|
36087
|
+
const py0 = cy + (r6 + ring * 0.55) * Math.sin(a);
|
|
36088
|
+
parts.push(chairAt(c.px, px0, py0, a * 180 / Math.PI + 90));
|
|
36089
|
+
}
|
|
36090
|
+
return parts.join("");
|
|
36091
|
+
}
|
|
36092
|
+
};
|
|
36093
|
+
}
|
|
36094
|
+
function tableDraw(top, bottom) {
|
|
36095
|
+
return (c) => box(c) + edgeChairs(c, top);
|
|
36096
|
+
}
|
|
36097
|
+
var TREAD = 0.28;
|
|
36098
|
+
function treadLines(c, vert, fixed0, fixed1, from, to, dashedFrom) {
|
|
36099
|
+
const parts = [];
|
|
36100
|
+
const dir = to >= from ? 1 : -1;
|
|
36101
|
+
for (let d = from; dir > 0 ? d <= to : d >= to; d += TREAD * dir) {
|
|
36102
|
+
const dashed = dashedFrom !== void 0 && (dir > 0 ? d > dashedFrom : d < dashedFrom);
|
|
36103
|
+
const cls = dashed ? "sx-fp-furn-dash" : "sx-fp-furn-line";
|
|
36104
|
+
if (vert) parts.push(chunk3WNW5Y7P_cjs.line({ class: cls, x1: c.px(fixed0), y1: c.px(d), x2: c.px(fixed1), y2: c.px(d) }));
|
|
36105
|
+
else parts.push(chunk3WNW5Y7P_cjs.line({ class: cls, x1: c.px(d), y1: c.px(fixed0), x2: c.px(d), y2: c.px(fixed1) }));
|
|
36106
|
+
}
|
|
36107
|
+
return parts.join("");
|
|
36108
|
+
}
|
|
36109
|
+
function breakLine(c, vert, lo, hi, at) {
|
|
36110
|
+
const span = hi - lo;
|
|
36111
|
+
const dz = Math.min(0.12, span * 0.18);
|
|
36112
|
+
const tilt = span * 0.18;
|
|
36113
|
+
const pts = vert ? [
|
|
36114
|
+
[lo, at + tilt],
|
|
36115
|
+
[lo + span * 0.4, at + tilt * 0.2],
|
|
36116
|
+
[lo + span * 0.5 - dz, at + tilt * 0.2 + dz],
|
|
36117
|
+
[lo + span * 0.5 + dz, at - tilt * 0.2 - dz],
|
|
36118
|
+
[lo + span * 0.6, at - tilt * 0.2],
|
|
36119
|
+
[hi, at - tilt]
|
|
36120
|
+
] : [
|
|
36121
|
+
[at + tilt, lo],
|
|
36122
|
+
[at + tilt * 0.2, lo + span * 0.4],
|
|
36123
|
+
[at + tilt * 0.2 + dz, lo + span * 0.5 - dz],
|
|
36124
|
+
[at - tilt * 0.2 - dz, lo + span * 0.5 + dz],
|
|
36125
|
+
[at - tilt * 0.2, lo + span * 0.6],
|
|
36126
|
+
[at - tilt, hi]
|
|
36127
|
+
];
|
|
36128
|
+
const d = pts.map(([a, b], i) => `${i === 0 ? "M" : "L"} ${c.px(vert ? a : a)} ${c.px(vert ? b : b)}`).join(" ");
|
|
36129
|
+
return chunk3WNW5Y7P_cjs.path({ class: "sx-fp-stair-break", d });
|
|
36130
|
+
}
|
|
36131
|
+
function dirArrow(c, points, labelText2) {
|
|
36132
|
+
const parts = [];
|
|
36133
|
+
const [sx, sy] = points[0];
|
|
36134
|
+
parts.push(chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-line", cx: c.px(sx), cy: c.px(sy), r: c.px(0.05) }));
|
|
36135
|
+
const d = points.map(([x, y], i) => `${i === 0 ? "M" : "L"} ${c.px(x)} ${c.px(y)}`).join(" ");
|
|
36136
|
+
parts.push(chunk3WNW5Y7P_cjs.path({ class: "sx-fp-furn-line", d }));
|
|
36137
|
+
const [ex, ey] = points[points.length - 1];
|
|
36138
|
+
const [px2, py2] = points[points.length - 2];
|
|
36139
|
+
const ang = Math.atan2(ey - py2, ex - px2);
|
|
36140
|
+
const hs = 0.11;
|
|
36141
|
+
const a1 = ang + Math.PI - 0.5;
|
|
36142
|
+
const a2 = ang + Math.PI + 0.5;
|
|
36143
|
+
parts.push(
|
|
36144
|
+
chunk3WNW5Y7P_cjs.polygon({
|
|
36145
|
+
class: "sx-fp-furn-dot",
|
|
36146
|
+
points: `${c.px(ex)},${c.px(ey)} ${c.px(ex + hs * Math.cos(a1))},${c.px(ey + hs * Math.sin(a1))} ${c.px(ex + hs * Math.cos(a2))},${c.px(ey + hs * Math.sin(a2))}`
|
|
36147
|
+
})
|
|
36148
|
+
);
|
|
36149
|
+
const [nx, ny] = points[1];
|
|
36150
|
+
const segLen = Math.hypot(nx - sx, ny - sy) || 1;
|
|
36151
|
+
const ux = (nx - sx) / segLen;
|
|
36152
|
+
const uy = (ny - sy) / segLen;
|
|
36153
|
+
const lx = sx + ux * 0.42 - uy * 0.16;
|
|
36154
|
+
const ly = sy + uy * 0.42 + ux * 0.16;
|
|
36155
|
+
parts.push(
|
|
36156
|
+
chunk3WNW5Y7P_cjs.text(
|
|
36157
|
+
{
|
|
36158
|
+
class: "sx-fp-furn-text",
|
|
36159
|
+
x: c.px(lx),
|
|
36160
|
+
y: c.px(ly),
|
|
36161
|
+
"text-anchor": "middle",
|
|
36162
|
+
"dominant-baseline": "central",
|
|
36163
|
+
"font-size": c.px(0.18)
|
|
36164
|
+
},
|
|
36165
|
+
labelText2
|
|
36166
|
+
)
|
|
36167
|
+
);
|
|
36168
|
+
return parts.join("");
|
|
36169
|
+
}
|
|
36170
|
+
function straightStairs(c) {
|
|
36171
|
+
const vert = c.h >= c.w;
|
|
36172
|
+
const len = vert ? c.h : c.w;
|
|
36173
|
+
const breakAt = Math.min(7 * TREAD, len * 0.62);
|
|
36174
|
+
const parts = [box(c, "sx-fp-furn-nofill")];
|
|
36175
|
+
if (vert) {
|
|
36176
|
+
parts.push(treadLines(c, true, 0, c.w, c.h - TREAD, 0.02, c.h - breakAt));
|
|
36177
|
+
parts.push(breakLine(c, true, 0, c.w, c.h - breakAt));
|
|
36178
|
+
parts.push(dirArrow(c, [[c.w / 2, c.h - 0.18], [c.w / 2, c.h - breakAt + 0.28]], c.label ?? "UP"));
|
|
36179
|
+
} else {
|
|
36180
|
+
parts.push(treadLines(c, false, 0, c.h, TREAD, c.w - 0.02, breakAt));
|
|
36181
|
+
parts.push(breakLine(c, false, 0, c.h, breakAt));
|
|
36182
|
+
parts.push(dirArrow(c, [[0.18, c.h / 2], [breakAt - 0.28, c.h / 2]], c.label ?? "UP"));
|
|
36183
|
+
}
|
|
36184
|
+
return parts.join("");
|
|
36185
|
+
}
|
|
36186
|
+
function lStairs(c) {
|
|
36187
|
+
const rw = Math.min(c.w, c.h) * 0.45;
|
|
36188
|
+
const parts = [
|
|
36189
|
+
chunk3WNW5Y7P_cjs.path({
|
|
36190
|
+
class: "sx-fp-furn-nofill",
|
|
36191
|
+
d: `M 0 0 L ${c.px(c.w)} 0 L ${c.px(c.w)} ${c.px(rw)} L ${c.px(rw)} ${c.px(rw)} L ${c.px(rw)} ${c.px(c.h)} L 0 ${c.px(c.h)} Z`
|
|
36192
|
+
})
|
|
36193
|
+
];
|
|
36194
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(rw), y1: 0, x2: c.px(rw), y2: c.px(rw) }));
|
|
36195
|
+
parts.push(treadLines(c, true, 0, rw, c.h - TREAD, rw + 0.05));
|
|
36196
|
+
const breakAt = rw + (c.w - rw) * 0.55;
|
|
36197
|
+
parts.push(treadLines(c, false, 0, rw, rw + TREAD, c.w - 0.02, breakAt));
|
|
36198
|
+
parts.push(breakLine(c, false, 0, rw, breakAt));
|
|
36199
|
+
parts.push(
|
|
36200
|
+
dirArrow(
|
|
36201
|
+
c,
|
|
36202
|
+
[
|
|
36203
|
+
[rw / 2, c.h - 0.18],
|
|
36204
|
+
[rw / 2, rw / 2],
|
|
36205
|
+
[breakAt - 0.24, rw / 2]
|
|
36206
|
+
],
|
|
36207
|
+
c.label ?? "UP"
|
|
36208
|
+
)
|
|
36209
|
+
);
|
|
36210
|
+
return parts.join("");
|
|
36211
|
+
}
|
|
36212
|
+
function uStairs(c) {
|
|
36213
|
+
const lh = Math.min(c.h * 0.3, Math.max(0.9, c.w / 2));
|
|
36214
|
+
const mid = c.w / 2;
|
|
36215
|
+
const parts = [box(c, "sx-fp-furn-nofill")];
|
|
36216
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: 0, y1: c.px(lh), x2: c.px(c.w), y2: c.px(lh) }));
|
|
36217
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(mid), y1: c.px(lh), x2: c.px(mid), y2: c.px(c.h) }));
|
|
36218
|
+
parts.push(treadLines(c, true, mid, c.w, c.h - TREAD, lh + 0.05));
|
|
36219
|
+
const breakAt = lh + (c.h - lh) * 0.4;
|
|
36220
|
+
parts.push(treadLines(c, true, 0, mid, lh + TREAD, c.h - 0.02, breakAt));
|
|
36221
|
+
parts.push(breakLine(c, true, 0, mid, breakAt));
|
|
36222
|
+
parts.push(
|
|
36223
|
+
dirArrow(
|
|
36224
|
+
c,
|
|
36225
|
+
[
|
|
36226
|
+
[mid + mid / 2, c.h - 0.18],
|
|
36227
|
+
[mid + mid / 2, lh / 2],
|
|
36228
|
+
[mid / 2, lh / 2],
|
|
36229
|
+
[mid / 2, breakAt - 0.24]
|
|
36230
|
+
],
|
|
36231
|
+
c.label ?? "UP"
|
|
36232
|
+
)
|
|
36233
|
+
);
|
|
36234
|
+
return parts.join("");
|
|
36235
|
+
}
|
|
36236
|
+
function spiralStairs(c) {
|
|
36237
|
+
const r6 = Math.min(c.w, c.h) / 2 - 0.02;
|
|
36238
|
+
const cx = c.w / 2;
|
|
36239
|
+
const cy = c.h / 2;
|
|
36240
|
+
const parts = [
|
|
36241
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn", cx: c.px(cx), cy: c.px(cy), r: c.px(r6) }),
|
|
36242
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-line", cx: c.px(cx), cy: c.px(cy), r: c.px(0.08) })
|
|
36243
|
+
];
|
|
36244
|
+
for (let i = 0; i < 12; i++) {
|
|
36245
|
+
const a = i / 12 * 2 * Math.PI;
|
|
36246
|
+
parts.push(
|
|
36247
|
+
chunk3WNW5Y7P_cjs.line({
|
|
36248
|
+
class: "sx-fp-furn-line",
|
|
36249
|
+
x1: c.px(cx + 0.08 * Math.cos(a)),
|
|
36250
|
+
y1: c.px(cy + 0.08 * Math.sin(a)),
|
|
36251
|
+
x2: c.px(cx + r6 * Math.cos(a)),
|
|
36252
|
+
y2: c.px(cy + r6 * Math.sin(a))
|
|
36253
|
+
})
|
|
36254
|
+
);
|
|
36255
|
+
}
|
|
36256
|
+
const wr = r6 * 0.62;
|
|
36257
|
+
const a0 = Math.PI * 0.75;
|
|
36258
|
+
const a1 = Math.PI * 1.9;
|
|
36259
|
+
const steps = 5;
|
|
36260
|
+
const pts = [];
|
|
36261
|
+
for (let i = 0; i <= steps; i++) {
|
|
36262
|
+
const a = a0 + (a1 - a0) * i / steps;
|
|
36263
|
+
pts.push([cx + wr * Math.cos(a), cy + wr * Math.sin(a)]);
|
|
36264
|
+
}
|
|
36265
|
+
parts.push(dirArrow(c, pts, c.label ?? "UP"));
|
|
36266
|
+
return parts.join("");
|
|
36267
|
+
}
|
|
36268
|
+
var FLOORPLAN_SYMBOLS = {
|
|
36269
|
+
// ── residential / living ──
|
|
36270
|
+
"bed-double": { w: 1.6, h: 2, draw: bedDraw(2) },
|
|
36271
|
+
"bed-single": { w: 0.9, h: 2, draw: bedDraw(1) },
|
|
36272
|
+
"bed-queen": { w: 1.55, h: 2.05, draw: bedDraw(2) },
|
|
36273
|
+
"bed-king": { w: 1.95, h: 2.05, draw: bedDraw(2) },
|
|
36274
|
+
sofa: { w: 2.2, h: 0.9, draw: sofaDraw(3) },
|
|
36275
|
+
loveseat: { w: 1.5, h: 0.9, draw: sofaDraw(2) },
|
|
36276
|
+
armchair: { w: 0.9, h: 0.9, draw: sofaDraw(1) },
|
|
36277
|
+
"coffee-table": { w: 1, h: 0.5, draw: (c) => box(c, "sx-fp-furn", 0.06) },
|
|
36278
|
+
tv: { w: 1.4, h: 0.15, draw: (c) => chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-solid", x: 0, y: 0, width: c.px(c.w), height: c.px(c.h) }) },
|
|
36279
|
+
rug: {
|
|
36280
|
+
w: 2,
|
|
36281
|
+
h: 1.4,
|
|
36282
|
+
underlay: true,
|
|
36283
|
+
draw: (c) => chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-rug", x: 0, y: 0, width: c.px(c.w), height: c.px(c.h), rx: c.px(0.1) })
|
|
36284
|
+
},
|
|
36285
|
+
wardrobe: {
|
|
36286
|
+
w: 1.8,
|
|
36287
|
+
h: 0.6,
|
|
36288
|
+
draw: (c) => {
|
|
36289
|
+
const parts = [box(c)];
|
|
36290
|
+
if (c.w >= c.h) {
|
|
36291
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: 0, y1: c.px(c.h / 2), x2: c.px(c.w), y2: c.px(c.h / 2) }));
|
|
36292
|
+
const n = Math.max(2, Math.round(c.w / 0.15));
|
|
36293
|
+
for (let i = 0; i < n; i++) {
|
|
36294
|
+
const x = c.px((i + 0.5) / n * c.w);
|
|
36295
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: x, y1: c.px(c.h / 2 - 0.1), x2: x, y2: c.px(c.h / 2 + 0.1) }));
|
|
36296
|
+
}
|
|
36297
|
+
} else {
|
|
36298
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(c.w / 2), y1: 0, x2: c.px(c.w / 2), y2: c.px(c.h) }));
|
|
36299
|
+
const n = Math.max(2, Math.round(c.h / 0.15));
|
|
36300
|
+
for (let i = 0; i < n; i++) {
|
|
36301
|
+
const y = c.px((i + 0.5) / n * c.h);
|
|
36302
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(c.w / 2 - 0.1), y1: y, x2: c.px(c.w / 2 + 0.1), y2: y }));
|
|
36303
|
+
}
|
|
36304
|
+
}
|
|
36305
|
+
return parts.join("");
|
|
36306
|
+
}
|
|
36307
|
+
},
|
|
36308
|
+
dresser: {
|
|
36309
|
+
w: 1.2,
|
|
36310
|
+
h: 0.5,
|
|
36311
|
+
draw: (c) => [
|
|
36312
|
+
box(c),
|
|
36313
|
+
chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: 0, y1: c.px(c.h / 2), x2: c.px(c.w), y2: c.px(c.h / 2) }),
|
|
36314
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-line", cx: c.px(c.w * 0.3), cy: c.px(c.h * 0.25), r: c.px(0.03) }),
|
|
36315
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-line", cx: c.px(c.w * 0.7), cy: c.px(c.h * 0.25), r: c.px(0.03) })
|
|
36316
|
+
].join("")
|
|
36317
|
+
},
|
|
36318
|
+
nightstand: {
|
|
36319
|
+
w: 0.5,
|
|
36320
|
+
h: 0.4,
|
|
36321
|
+
draw: (c) => box(c) + chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-line", cx: c.px(c.w / 2), cy: c.px(c.h / 2), r: c.px(0.08) })
|
|
36322
|
+
},
|
|
36323
|
+
bookshelf: { w: 0.9, h: 0.3, draw: shelfDraw },
|
|
36324
|
+
plant: {
|
|
36325
|
+
w: 0.5,
|
|
36326
|
+
h: 0.5,
|
|
36327
|
+
draw: (c) => {
|
|
36328
|
+
const r6 = Math.min(c.w, c.h) / 2;
|
|
36329
|
+
const parts = [chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn", cx: c.px(c.w / 2), cy: c.px(c.h / 2), r: c.px(r6) })];
|
|
36330
|
+
for (const a of [0, 60, 120, 180, 240, 300]) {
|
|
36331
|
+
const rad = a * Math.PI / 180;
|
|
36332
|
+
parts.push(
|
|
36333
|
+
chunk3WNW5Y7P_cjs.line({
|
|
36334
|
+
class: "sx-fp-furn-line",
|
|
36335
|
+
x1: c.px(c.w / 2),
|
|
36336
|
+
y1: c.px(c.h / 2),
|
|
36337
|
+
x2: c.px(c.w / 2 + (r6 - 0.03) * Math.cos(rad)),
|
|
36338
|
+
y2: c.px(c.h / 2 + (r6 - 0.03) * Math.sin(rad))
|
|
36339
|
+
})
|
|
36340
|
+
);
|
|
36341
|
+
}
|
|
36342
|
+
return parts.join("");
|
|
36343
|
+
}
|
|
36344
|
+
},
|
|
36345
|
+
"dining-table": { w: 1.6, h: 0.9, envelope: [CHAIR_OVERHANG, 0, CHAIR_OVERHANG, 0], draw: tableDraw(true) },
|
|
36346
|
+
sectional: {
|
|
36347
|
+
w: 2.6,
|
|
36348
|
+
h: 2,
|
|
36349
|
+
draw: (c) => {
|
|
36350
|
+
const d = 0.9 * Math.min(c.h / 2, 1);
|
|
36351
|
+
const parts = [
|
|
36352
|
+
chunk3WNW5Y7P_cjs.path({
|
|
36353
|
+
class: "sx-fp-furn",
|
|
36354
|
+
d: `M 0 0 L ${c.px(c.w)} 0 L ${c.px(c.w)} ${c.px(d)} L ${c.px(d)} ${c.px(d)} L ${c.px(d)} ${c.px(c.h)} L 0 ${c.px(c.h)} Z`
|
|
36355
|
+
}),
|
|
36356
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn", x: c.px(0.12), y: 0, width: c.px(c.w - 0.24), height: c.px(0.16), rx: c.px(0.05) }),
|
|
36357
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn", x: 0, y: c.px(0.12), width: c.px(0.16), height: c.px(c.h - 0.24), rx: c.px(0.05) })
|
|
36358
|
+
];
|
|
36359
|
+
for (const fx of [0.33, 0.66]) {
|
|
36360
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(d + (c.w - d) * fx), y1: c.px(0.16), x2: c.px(d + (c.w - d) * fx), y2: c.px(d - 0.05) }));
|
|
36361
|
+
}
|
|
36362
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(0.16), y1: c.px(c.h / 2 + d / 4), x2: c.px(d - 0.05), y2: c.px(c.h / 2 + d / 4) }));
|
|
36363
|
+
return parts.join("");
|
|
36364
|
+
}
|
|
36365
|
+
},
|
|
36366
|
+
"side-table": { w: 0.5, h: 0.5, draw: (c) => box(c, "sx-fp-furn", 0.06) },
|
|
36367
|
+
"tv-stand": {
|
|
36368
|
+
w: 1.6,
|
|
36369
|
+
h: 0.45,
|
|
36370
|
+
underlay: true,
|
|
36371
|
+
// a surface — the TV sits on it
|
|
36372
|
+
draw: (c) => box(c) + chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: 0, y1: c.px(c.h / 2), x2: c.px(c.w), y2: c.px(c.h / 2) })
|
|
36373
|
+
},
|
|
36374
|
+
fireplace: {
|
|
36375
|
+
w: 1.5,
|
|
36376
|
+
h: 0.5,
|
|
36377
|
+
draw: (c) => {
|
|
36378
|
+
const inset = Math.min(0.18, c.w * 0.15);
|
|
36379
|
+
return [
|
|
36380
|
+
box(c),
|
|
36381
|
+
// firebox opening toward the room (south edge)
|
|
36382
|
+
chunk3WNW5Y7P_cjs.rect({
|
|
36383
|
+
class: "sx-fp-furn-line",
|
|
36384
|
+
x: c.px(inset),
|
|
36385
|
+
y: c.px(c.h * 0.3),
|
|
36386
|
+
width: c.px(c.w - 2 * inset),
|
|
36387
|
+
height: c.px(c.h * 0.7 - 0.04)
|
|
36388
|
+
}),
|
|
36389
|
+
chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: 0, y1: c.px(c.h * 0.3), x2: c.px(inset), y2: 0 }),
|
|
36390
|
+
chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(c.w), y1: c.px(c.h * 0.3), x2: c.px(c.w - inset), y2: 0 })
|
|
36391
|
+
].join("");
|
|
36392
|
+
}
|
|
36393
|
+
},
|
|
36394
|
+
"floor-lamp": {
|
|
36395
|
+
w: 0.35,
|
|
36396
|
+
h: 0.35,
|
|
36397
|
+
draw: (c) => {
|
|
36398
|
+
const r6 = Math.min(c.w, c.h) / 2;
|
|
36399
|
+
return [
|
|
36400
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn", cx: c.px(c.w / 2), cy: c.px(c.h / 2), r: c.px(r6) }),
|
|
36401
|
+
chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(c.w / 2 - r6), y1: c.px(c.h / 2), x2: c.px(c.w / 2 + r6), y2: c.px(c.h / 2) }),
|
|
36402
|
+
chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(c.w / 2), y1: c.px(c.h / 2 - r6), x2: c.px(c.w / 2), y2: c.px(c.h / 2 + r6) })
|
|
36403
|
+
].join("");
|
|
36404
|
+
}
|
|
36405
|
+
},
|
|
36406
|
+
ottoman: { w: 0.6, h: 0.45, draw: (c) => box(c, "sx-fp-furn", 0.12) },
|
|
36407
|
+
piano: {
|
|
36408
|
+
w: 1.5,
|
|
36409
|
+
h: 1.7,
|
|
36410
|
+
draw: (c) => {
|
|
36411
|
+
const X = (v) => c.px(v * (c.w / 1.5));
|
|
36412
|
+
const Y = (v) => c.px(v * (c.h / 1.7));
|
|
36413
|
+
const body = [
|
|
36414
|
+
`M ${X(0)} ${Y(0)}`,
|
|
36415
|
+
`L ${X(1.5)} ${Y(0)}`,
|
|
36416
|
+
`L ${X(1.5)} ${Y(0.75)}`,
|
|
36417
|
+
`C ${X(1.5)} ${Y(1.25)} ${X(1.25)} ${Y(1.7)} ${X(0.8)} ${Y(1.7)}`,
|
|
36418
|
+
`C ${X(0.45)} ${Y(1.7)} ${X(0.28)} ${Y(1.45)} ${X(0.28)} ${Y(1.1)}`,
|
|
36419
|
+
`C ${X(0.28)} ${Y(0.85)} ${X(0.14)} ${Y(0.72)} ${X(0)} ${Y(0.68)}`,
|
|
36420
|
+
"Z"
|
|
36421
|
+
].join(" ");
|
|
36422
|
+
return chunk3WNW5Y7P_cjs.path({ class: "sx-fp-furn", d: body }) + chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: X(0), y1: Y(0.14), x2: X(1.5), y2: Y(0.14) }) + chairAt(c.px, c.w / 1.5 * 0.75, -0.25, 180);
|
|
36423
|
+
},
|
|
36424
|
+
envelope: [CHAIR_OVERHANG, 0, 0, 0]
|
|
36425
|
+
},
|
|
36426
|
+
"piano-upright": {
|
|
36427
|
+
w: 1.5,
|
|
36428
|
+
h: 0.6,
|
|
36429
|
+
envelope: [0, 0, CHAIR_OVERHANG, 0],
|
|
36430
|
+
draw: (c) => box(c) + chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: 0, y1: c.px(c.h * 0.55), x2: c.px(c.w), y2: c.px(c.h * 0.55) }) + chairAt(c.px, c.w / 2, c.h + CHAIR_GAP, 180)
|
|
36431
|
+
},
|
|
36432
|
+
"pool-table": {
|
|
36433
|
+
w: 2.54,
|
|
36434
|
+
h: 1.27,
|
|
36435
|
+
draw: (c) => {
|
|
36436
|
+
const rail = Math.min(0.12, c.h * 0.1);
|
|
36437
|
+
const parts = [
|
|
36438
|
+
box(c, "sx-fp-furn", 0.06),
|
|
36439
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-line", x: c.px(rail), y: c.px(rail), width: c.px(c.w - 2 * rail), height: c.px(c.h - 2 * rail) })
|
|
36440
|
+
];
|
|
36441
|
+
for (const [px0, py0] of [
|
|
36442
|
+
[rail, rail],
|
|
36443
|
+
[c.w / 2, rail],
|
|
36444
|
+
[c.w - rail, rail],
|
|
36445
|
+
[rail, c.h - rail],
|
|
36446
|
+
[c.w / 2, c.h - rail],
|
|
36447
|
+
[c.w - rail, c.h - rail]
|
|
36448
|
+
]) {
|
|
36449
|
+
parts.push(chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-dot", cx: c.px(px0), cy: c.px(py0), r: c.px(0.045) }));
|
|
36450
|
+
}
|
|
36451
|
+
return parts.join("");
|
|
36452
|
+
}
|
|
36453
|
+
},
|
|
36454
|
+
crib: {
|
|
36455
|
+
w: 0.7,
|
|
36456
|
+
h: 1.3,
|
|
36457
|
+
draw: (c) => {
|
|
36458
|
+
const parts = [box(c, "sx-fp-furn", 0.05), chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-line", x: c.px(0.08), y: c.px(0.08), width: c.px(c.w - 0.16), height: c.px(c.h - 0.16), rx: c.px(0.04) })];
|
|
36459
|
+
const n = Math.max(3, Math.round(c.h / 0.18));
|
|
36460
|
+
for (let i = 1; i < n; i++) {
|
|
36461
|
+
const y = c.px(0.08 + (c.h - 0.16) * i / n);
|
|
36462
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(0.08), y1: y, x2: c.px(c.w - 0.08), y2: y }));
|
|
36463
|
+
}
|
|
36464
|
+
return parts.join("");
|
|
36465
|
+
}
|
|
36466
|
+
},
|
|
36467
|
+
"bunk-bed": {
|
|
36468
|
+
w: 0.95,
|
|
36469
|
+
h: 2,
|
|
36470
|
+
draw: (c) => bedDraw(1)(c) + chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-dash", x1: c.px(0.07), y1: c.px(0.07), x2: c.px(c.w - 0.07), y2: c.px(0.07) }) + [0.25, 0.45, 0.65].map((f) => chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(c.w - 0.16), y1: c.px(c.h * f), x2: c.px(c.w), y2: c.px(c.h * f) })).join("")
|
|
36471
|
+
},
|
|
36472
|
+
"ceiling-fan": {
|
|
36473
|
+
w: 0.9,
|
|
36474
|
+
h: 0.9,
|
|
36475
|
+
underlay: true,
|
|
36476
|
+
// overhead fixture — never collides with floor furniture
|
|
36477
|
+
draw: (c) => {
|
|
36478
|
+
const r6 = Math.min(c.w, c.h) / 2;
|
|
36479
|
+
const cx = c.w / 2;
|
|
36480
|
+
const cy = c.h / 2;
|
|
36481
|
+
const parts = [
|
|
36482
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-dash", cx: c.px(cx), cy: c.px(cy), r: c.px(r6) }),
|
|
36483
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn", cx: c.px(cx), cy: c.px(cy), r: c.px(r6 * 0.18) })
|
|
36484
|
+
];
|
|
36485
|
+
for (const a of [20, 110, 200, 290]) {
|
|
36486
|
+
const rad = a * Math.PI / 180;
|
|
36487
|
+
parts.push(
|
|
36488
|
+
chunk3WNW5Y7P_cjs.el("ellipse", {
|
|
36489
|
+
class: "sx-fp-furn-line",
|
|
36490
|
+
cx: c.px(cx + r6 * 0.55 * Math.cos(rad)),
|
|
36491
|
+
cy: c.px(cy + r6 * 0.55 * Math.sin(rad)),
|
|
36492
|
+
rx: c.px(r6 * 0.42),
|
|
36493
|
+
ry: c.px(r6 * 0.15),
|
|
36494
|
+
transform: `rotate(${a} ${c.px(cx + r6 * 0.55 * Math.cos(rad))} ${c.px(cy + r6 * 0.55 * Math.sin(rad))})`
|
|
36495
|
+
})
|
|
36496
|
+
);
|
|
36497
|
+
}
|
|
36498
|
+
return parts.join("");
|
|
36499
|
+
}
|
|
36500
|
+
},
|
|
36501
|
+
// ── kitchen / bath ──
|
|
36502
|
+
counter: {
|
|
36503
|
+
w: 2,
|
|
36504
|
+
h: 0.6,
|
|
36505
|
+
underlay: true,
|
|
36506
|
+
draw: (c) => box(c) + chunk3WNW5Y7P_cjs.line({
|
|
36507
|
+
class: "sx-fp-furn-dash",
|
|
36508
|
+
x1: c.px(0.05),
|
|
36509
|
+
y1: c.px(c.h - 0.06),
|
|
36510
|
+
x2: c.px(c.w - 0.05),
|
|
36511
|
+
y2: c.px(c.h - 0.06)
|
|
36512
|
+
})
|
|
36513
|
+
},
|
|
36514
|
+
"kitchen-sink": {
|
|
36515
|
+
w: 0.8,
|
|
36516
|
+
h: 0.6,
|
|
36517
|
+
draw: (c) => [
|
|
36518
|
+
box(c),
|
|
36519
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-line", x: c.px(0.07), y: c.px(0.1), width: c.px(c.w / 2 - 0.11), height: c.px(c.h - 0.2), rx: c.px(0.04) }),
|
|
36520
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-line", x: c.px(c.w / 2 + 0.04), y: c.px(0.1), width: c.px(c.w / 2 - 0.11), height: c.px(c.h - 0.2), rx: c.px(0.04) }),
|
|
36521
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-dot", cx: c.px(c.w / 2), cy: c.px(0.06), r: c.px(0.024) })
|
|
36522
|
+
].join("")
|
|
36523
|
+
},
|
|
36524
|
+
stove: {
|
|
36525
|
+
w: 0.6,
|
|
36526
|
+
h: 0.6,
|
|
36527
|
+
draw: (c) => {
|
|
36528
|
+
const parts = [box(c)];
|
|
36529
|
+
const inset = 0.18;
|
|
36530
|
+
for (const [bx, by] of [
|
|
36531
|
+
[inset, inset],
|
|
36532
|
+
[c.w - inset, inset],
|
|
36533
|
+
[inset, c.h - inset],
|
|
36534
|
+
[c.w - inset, c.h - inset]
|
|
36535
|
+
]) {
|
|
36536
|
+
parts.push(chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-line", cx: c.px(bx), cy: c.px(by), r: c.px(0.085) }));
|
|
36537
|
+
}
|
|
36538
|
+
return parts.join("");
|
|
36539
|
+
}
|
|
36540
|
+
},
|
|
36541
|
+
fridge: { w: 0.7, h: 0.7, draw: applianceDraw("REF", false) },
|
|
36542
|
+
dishwasher: { w: 0.6, h: 0.6, draw: applianceDraw("DW", false) },
|
|
36543
|
+
island: {
|
|
36544
|
+
w: 1.8,
|
|
36545
|
+
h: 0.9,
|
|
36546
|
+
underlay: true,
|
|
36547
|
+
draw: (c) => box(c) + chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-line", x: c.px(0.08), y: c.px(0.08), width: c.px(c.w - 0.16), height: c.px(c.h - 0.16) })
|
|
36548
|
+
},
|
|
36549
|
+
toilet: {
|
|
36550
|
+
w: 0.5,
|
|
36551
|
+
h: 0.7,
|
|
36552
|
+
draw: (c) => [
|
|
36553
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn", x: 0, y: 0, width: c.px(c.w), height: c.px(0.2), rx: c.px(0.04) }),
|
|
36554
|
+
chunk3WNW5Y7P_cjs.el("ellipse", {
|
|
36555
|
+
class: "sx-fp-furn",
|
|
36556
|
+
cx: c.px(c.w / 2),
|
|
36557
|
+
cy: c.px(0.2 + (c.h - 0.24) / 2),
|
|
36558
|
+
rx: c.px(c.w / 2 - 0.04),
|
|
36559
|
+
ry: c.px((c.h - 0.28) / 2)
|
|
36560
|
+
})
|
|
36561
|
+
].join("")
|
|
36562
|
+
},
|
|
36563
|
+
sink: {
|
|
36564
|
+
w: 0.55,
|
|
36565
|
+
h: 0.45,
|
|
36566
|
+
draw: (c) => [
|
|
36567
|
+
box(c, "sx-fp-furn", 0.05),
|
|
36568
|
+
chunk3WNW5Y7P_cjs.el("ellipse", {
|
|
36569
|
+
class: "sx-fp-furn-line",
|
|
36570
|
+
cx: c.px(c.w / 2),
|
|
36571
|
+
cy: c.px(c.h / 2 + 0.02),
|
|
36572
|
+
rx: c.px(c.w / 2 - 0.08),
|
|
36573
|
+
ry: c.px(c.h / 2 - 0.1)
|
|
36574
|
+
}),
|
|
36575
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-dot", cx: c.px(c.w / 2), cy: c.px(0.07), r: c.px(0.024) })
|
|
36576
|
+
].join("")
|
|
36577
|
+
},
|
|
36578
|
+
bathtub: {
|
|
36579
|
+
w: 0.8,
|
|
36580
|
+
h: 1.7,
|
|
36581
|
+
draw: (c) => [
|
|
36582
|
+
box(c, "sx-fp-furn", 0.08),
|
|
36583
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-line", x: c.px(0.09), y: c.px(0.09), width: c.px(c.w - 0.18), height: c.px(c.h - 0.18), rx: c.px(0.22) }),
|
|
36584
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-dot", cx: c.px(c.w / 2), cy: c.px(0.26), r: c.px(0.035) })
|
|
36585
|
+
].join("")
|
|
36586
|
+
},
|
|
36587
|
+
shower: {
|
|
36588
|
+
w: 0.9,
|
|
36589
|
+
h: 0.9,
|
|
36590
|
+
draw: (c) => [
|
|
36591
|
+
box(c),
|
|
36592
|
+
chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: 0, y1: 0, x2: c.px(c.w), y2: c.px(c.h) }),
|
|
36593
|
+
chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(c.w), y1: 0, x2: 0, y2: c.px(c.h) }),
|
|
36594
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn", cx: c.px(0.15), cy: c.px(0.15), r: c.px(0.06) })
|
|
36595
|
+
].join("")
|
|
36596
|
+
},
|
|
36597
|
+
washer: { w: 0.6, h: 0.6, draw: applianceDraw("W", true) },
|
|
36598
|
+
dryer: { w: 0.6, h: 0.6, draw: applianceDraw("D", true) },
|
|
36599
|
+
"wall-cabinet": {
|
|
36600
|
+
w: 0.9,
|
|
36601
|
+
h: 0.35,
|
|
36602
|
+
underlay: true,
|
|
36603
|
+
// above the cut plane — drawn dashed over the base run
|
|
36604
|
+
draw: (c) => chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-dash", x: 0, y: 0, width: c.px(c.w), height: c.px(c.h) })
|
|
36605
|
+
},
|
|
36606
|
+
"range-hood": {
|
|
36607
|
+
w: 0.8,
|
|
36608
|
+
h: 0.55,
|
|
36609
|
+
underlay: true,
|
|
36610
|
+
// above the cut plane
|
|
36611
|
+
draw: (c) => chunk3WNW5Y7P_cjs.el("g", {}, [
|
|
36612
|
+
chunk3WNW5Y7P_cjs.polygon({
|
|
36613
|
+
class: "sx-fp-furn-dash",
|
|
36614
|
+
points: `${c.px(0.08)},0 ${c.px(c.w - 0.08)},0 ${c.px(c.w)},${c.px(c.h)} 0,${c.px(c.h)}`
|
|
36615
|
+
})
|
|
36616
|
+
])
|
|
36617
|
+
},
|
|
36618
|
+
"bar-stool": {
|
|
36619
|
+
w: 0.35,
|
|
36620
|
+
h: 0.35,
|
|
36621
|
+
draw: (c) => chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-chair", cx: c.px(c.w / 2), cy: c.px(c.h / 2), r: c.px(Math.min(c.w, c.h) / 2) })
|
|
36622
|
+
},
|
|
36623
|
+
vanity: {
|
|
36624
|
+
w: 1.5,
|
|
36625
|
+
h: 0.55,
|
|
36626
|
+
draw: (c) => {
|
|
36627
|
+
const parts = [box(c)];
|
|
36628
|
+
for (const fx of [0.27, 0.73]) {
|
|
36629
|
+
parts.push(
|
|
36630
|
+
chunk3WNW5Y7P_cjs.el("ellipse", {
|
|
36631
|
+
class: "sx-fp-furn-line",
|
|
36632
|
+
cx: c.px(c.w * fx),
|
|
36633
|
+
cy: c.px(c.h / 2 + 0.02),
|
|
36634
|
+
rx: c.px(Math.min(0.22, c.w * 0.16)),
|
|
36635
|
+
ry: c.px(c.h / 2 - 0.12)
|
|
36636
|
+
})
|
|
36637
|
+
);
|
|
36638
|
+
parts.push(chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-dot", cx: c.px(c.w * fx), cy: c.px(0.07), r: c.px(0.022) }));
|
|
36639
|
+
}
|
|
36640
|
+
return parts.join("");
|
|
36641
|
+
}
|
|
36642
|
+
},
|
|
36643
|
+
bidet: {
|
|
36644
|
+
w: 0.4,
|
|
36645
|
+
h: 0.6,
|
|
36646
|
+
draw: (c) => chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn", x: c.px(c.w * 0.15), y: 0, width: c.px(c.w * 0.7), height: c.px(0.12), rx: c.px(0.03) }) + chunk3WNW5Y7P_cjs.el("ellipse", {
|
|
36647
|
+
class: "sx-fp-furn",
|
|
36648
|
+
cx: c.px(c.w / 2),
|
|
36649
|
+
cy: c.px(0.12 + (c.h - 0.16) / 2),
|
|
36650
|
+
rx: c.px(c.w / 2 - 0.03),
|
|
36651
|
+
ry: c.px((c.h - 0.18) / 2)
|
|
36652
|
+
}) + chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-line", cx: c.px(c.w / 2), cy: c.px(c.h * 0.45), r: c.px(0.035) })
|
|
36653
|
+
},
|
|
36654
|
+
urinal: {
|
|
36655
|
+
w: 0.4,
|
|
36656
|
+
h: 0.35,
|
|
36657
|
+
draw: (c) => chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn", x: 0, y: 0, width: c.px(c.w), height: c.px(0.08) }) + chunk3WNW5Y7P_cjs.path({
|
|
36658
|
+
class: "sx-fp-furn",
|
|
36659
|
+
d: `M ${c.px(0.05)} ${c.px(0.08)} L ${c.px(c.w - 0.05)} ${c.px(0.08)} C ${c.px(c.w - 0.05)} ${c.px(c.h * 0.75)} ${c.px(c.w * 0.7)} ${c.px(c.h)} ${c.px(c.w / 2)} ${c.px(c.h)} C ${c.px(c.w * 0.3)} ${c.px(c.h)} ${c.px(0.05)} ${c.px(c.h * 0.75)} ${c.px(0.05)} ${c.px(0.08)} Z`
|
|
36660
|
+
})
|
|
36661
|
+
},
|
|
36662
|
+
// ── stairs & vertical circulation ──
|
|
36663
|
+
stairs: { w: 1, h: 3, consumesLabel: true, draw: straightStairs },
|
|
36664
|
+
"stairs-l": { w: 2.2, h: 2.2, consumesLabel: true, draw: lStairs },
|
|
36665
|
+
"stairs-u": { w: 2, h: 3, consumesLabel: true, draw: uStairs },
|
|
36666
|
+
"spiral-stairs": { w: 1.5, h: 1.5, consumesLabel: true, draw: spiralStairs },
|
|
36667
|
+
elevator: {
|
|
36668
|
+
w: 1.6,
|
|
36669
|
+
h: 1.5,
|
|
36670
|
+
draw: (c) => box(c) + chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: 0, y1: 0, x2: c.px(c.w), y2: c.px(c.h) }) + chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(c.w), y1: 0, x2: 0, y2: c.px(c.h) })
|
|
36671
|
+
},
|
|
36672
|
+
// ── structural ──
|
|
36673
|
+
column: {
|
|
36674
|
+
w: 0.4,
|
|
36675
|
+
h: 0.4,
|
|
36676
|
+
draw: (c) => chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-solid", x: 0, y: 0, width: c.px(c.w), height: c.px(c.h) })
|
|
36677
|
+
},
|
|
36678
|
+
// ── classroom / office ──
|
|
36679
|
+
"desk-chair": {
|
|
36680
|
+
w: 0.6,
|
|
36681
|
+
h: 0.75,
|
|
36682
|
+
draw: (c) => [
|
|
36683
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn", x: 0, y: 0, width: c.px(c.w), height: c.px(c.h * 0.58) }),
|
|
36684
|
+
chunk3WNW5Y7P_cjs.rect({
|
|
36685
|
+
class: "sx-fp-chair",
|
|
36686
|
+
x: c.px(c.w / 2 - c.w * 0.3),
|
|
36687
|
+
y: c.px(c.h * 0.66),
|
|
36688
|
+
width: c.px(c.w * 0.6),
|
|
36689
|
+
height: c.px(c.h * 0.32),
|
|
36690
|
+
rx: c.px(0.07)
|
|
36691
|
+
})
|
|
36692
|
+
].join("")
|
|
36693
|
+
},
|
|
36694
|
+
desk: {
|
|
36695
|
+
w: 1.4,
|
|
36696
|
+
h: 0.7,
|
|
36697
|
+
envelope: [0, 0, CHAIR_OVERHANG, 0],
|
|
36698
|
+
draw: (c) => box(c) + chairAt(c.px, c.w / 2, c.h + CHAIR_GAP, 180)
|
|
36699
|
+
},
|
|
36700
|
+
chair: {
|
|
36701
|
+
w: 0.45,
|
|
36702
|
+
h: 0.45,
|
|
36703
|
+
draw: (c) => chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-chair", x: 0, y: 0, width: c.px(c.w), height: c.px(c.h), rx: c.px(0.1) }) + chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: 0, y1: c.px(0.06), x2: 0, y2: c.px(c.h - 0.06) })
|
|
36704
|
+
},
|
|
36705
|
+
whiteboard: { w: 3, h: 0.12, draw: boardDraw },
|
|
36706
|
+
smartboard: { w: 2, h: 0.12, draw: boardDraw },
|
|
36707
|
+
bookcase: { w: 0.9, h: 0.3, draw: shelfDraw },
|
|
36708
|
+
"desk-l": {
|
|
36709
|
+
w: 1.6,
|
|
36710
|
+
h: 1.6,
|
|
36711
|
+
draw: (c) => {
|
|
36712
|
+
const d = 0.7 * Math.min(c.w / 1.6, c.h / 1.6);
|
|
36713
|
+
return chunk3WNW5Y7P_cjs.path({
|
|
36714
|
+
class: "sx-fp-furn",
|
|
36715
|
+
d: `M 0 0 L ${c.px(c.w)} 0 L ${c.px(c.w)} ${c.px(d)} L ${c.px(d)} ${c.px(d)} L ${c.px(d)} ${c.px(c.h)} L 0 ${c.px(c.h)} Z`
|
|
36716
|
+
}) + chairAt(c.px, d + 0.32, d + 0.32, 315);
|
|
36717
|
+
}
|
|
36718
|
+
},
|
|
36719
|
+
"filing-cabinet": {
|
|
36720
|
+
w: 0.5,
|
|
36721
|
+
h: 0.6,
|
|
36722
|
+
draw: (c) => box(c) + chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: 0, y1: c.px(c.h / 3), x2: c.px(c.w), y2: c.px(c.h / 3) }) + chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: 0, y1: c.px(2 * c.h / 3), x2: c.px(c.w), y2: c.px(2 * c.h / 3) })
|
|
36723
|
+
},
|
|
36724
|
+
lockers: {
|
|
36725
|
+
w: 1.8,
|
|
36726
|
+
h: 0.45,
|
|
36727
|
+
draw: (c) => {
|
|
36728
|
+
const parts = [box(c)];
|
|
36729
|
+
const n = Math.max(2, Math.round(c.w / 0.3));
|
|
36730
|
+
for (let i = 1; i < n; i++) {
|
|
36731
|
+
const x = c.px(c.w * i / n);
|
|
36732
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: x, y1: 0, x2: x, y2: c.px(c.h) }));
|
|
36733
|
+
}
|
|
36734
|
+
for (let i = 0; i < n; i++) {
|
|
36735
|
+
parts.push(chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-dot", cx: c.px((i + 0.78) / n * c.w), cy: c.px(c.h / 2), r: c.px(0.02) }));
|
|
36736
|
+
}
|
|
36737
|
+
return parts.join("");
|
|
36738
|
+
}
|
|
36739
|
+
},
|
|
36740
|
+
cubbies: {
|
|
36741
|
+
w: 2,
|
|
36742
|
+
h: 0.4,
|
|
36743
|
+
draw: (c) => {
|
|
36744
|
+
const parts = [box(c)];
|
|
36745
|
+
const n = Math.max(2, Math.round(c.w / 0.3));
|
|
36746
|
+
for (let i = 1; i < n; i++) {
|
|
36747
|
+
const x = c.px(c.w * i / n);
|
|
36748
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: x, y1: 0, x2: x, y2: c.px(c.h) }));
|
|
36749
|
+
}
|
|
36750
|
+
return parts.join("");
|
|
36751
|
+
}
|
|
36752
|
+
},
|
|
36753
|
+
"kidney-table": {
|
|
36754
|
+
w: 1.8,
|
|
36755
|
+
h: 1.2,
|
|
36756
|
+
draw: (c) => {
|
|
36757
|
+
const sx = c.w / 1.8;
|
|
36758
|
+
const sy = c.h / 1.2;
|
|
36759
|
+
const X = (v) => c.px(v * sx);
|
|
36760
|
+
const Y = (v) => c.px(v * sy);
|
|
36761
|
+
const d = [
|
|
36762
|
+
`M ${X(0)} ${Y(0.55)}`,
|
|
36763
|
+
`C ${X(0)} ${Y(0.15)} ${X(0.35)} ${Y(0)} ${X(0.9)} ${Y(0)}`,
|
|
36764
|
+
`C ${X(1.45)} ${Y(0)} ${X(1.8)} ${Y(0.15)} ${X(1.8)} ${Y(0.55)}`,
|
|
36765
|
+
`C ${X(1.8)} ${Y(0.95)} ${X(1.5)} ${Y(1.2)} ${X(1.18)} ${Y(1.2)}`,
|
|
36766
|
+
`Q ${X(0.9)} ${Y(0.82)} ${X(0.62)} ${Y(1.2)}`,
|
|
36767
|
+
`C ${X(0.3)} ${Y(1.2)} ${X(0)} ${Y(0.95)} ${X(0)} ${Y(0.55)}`,
|
|
36768
|
+
"Z"
|
|
36769
|
+
].join(" ");
|
|
36770
|
+
return chunk3WNW5Y7P_cjs.path({ class: "sx-fp-furn", d });
|
|
36771
|
+
}
|
|
36772
|
+
},
|
|
36773
|
+
"round-table-4": roundTable(4, 1.52),
|
|
36774
|
+
"round-table-6": roundTable(6, 1.52),
|
|
36775
|
+
"round-table-8": roundTable(8, 1.52),
|
|
36776
|
+
"round-table-10": roundTable(10, 1.83),
|
|
36777
|
+
"conference-table": { w: 2.4, h: 1.2, envelope: [CHAIR_OVERHANG, 0, CHAIR_OVERHANG, 0], draw: tableDraw(true) },
|
|
36778
|
+
// ── event / banquet ──
|
|
36779
|
+
"banquet-table": { w: 2.44, h: 0.76, envelope: [CHAIR_OVERHANG, 0, CHAIR_OVERHANG, 0], draw: tableDraw(true) },
|
|
36780
|
+
"head-table": { w: 3.7, h: 0.76, envelope: [0, 0, CHAIR_OVERHANG, 0], draw: tableDraw(false) },
|
|
36781
|
+
stage: {
|
|
36782
|
+
w: 4,
|
|
36783
|
+
h: 2,
|
|
36784
|
+
draw: (c) => box(c) + chunk3WNW5Y7P_cjs.rect({
|
|
36785
|
+
class: "sx-fp-furn-dash",
|
|
36786
|
+
x: c.px(0.1),
|
|
36787
|
+
y: c.px(0.1),
|
|
36788
|
+
width: c.px(c.w - 0.2),
|
|
36789
|
+
height: c.px(c.h - 0.2)
|
|
36790
|
+
})
|
|
36791
|
+
},
|
|
36792
|
+
"dance-floor": {
|
|
36793
|
+
w: 4,
|
|
36794
|
+
h: 4,
|
|
36795
|
+
underlay: true,
|
|
36796
|
+
draw: (c) => {
|
|
36797
|
+
const parts = [];
|
|
36798
|
+
for (let d = 0.5; d < c.w + c.h; d += 0.5) {
|
|
36799
|
+
const x1 = Math.max(0, d - c.h);
|
|
36800
|
+
const y1 = Math.min(d, c.h);
|
|
36801
|
+
const x2 = Math.min(d, c.w);
|
|
36802
|
+
const y2 = Math.max(0, d - c.w);
|
|
36803
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-hatch", x1: c.px(x1), y1: c.px(y1), x2: c.px(x2), y2: c.px(y2) }));
|
|
36804
|
+
}
|
|
36805
|
+
parts.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-nofill", x: 0, y: 0, width: c.px(c.w), height: c.px(c.h) }));
|
|
36806
|
+
return parts.join("");
|
|
36807
|
+
}
|
|
36808
|
+
},
|
|
36809
|
+
bar: {
|
|
36810
|
+
w: 3,
|
|
36811
|
+
h: 0.7,
|
|
36812
|
+
draw: (c) => box(c) + chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: 0, y1: c.px(c.h - 0.15), x2: c.px(c.w), y2: c.px(c.h - 0.15) })
|
|
36813
|
+
},
|
|
36814
|
+
"dj-booth": { w: 1.2, h: 0.8, draw: (c) => box(c) + glyphText(c, "DJ") },
|
|
36815
|
+
"cocktail-table": {
|
|
36816
|
+
w: 0.76,
|
|
36817
|
+
h: 0.76,
|
|
36818
|
+
draw: (c) => chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn", cx: c.px(c.w / 2), cy: c.px(c.h / 2), r: c.px(Math.min(c.w, c.h) / 2) }) + chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-line", cx: c.px(c.w / 2), cy: c.px(c.h / 2), r: c.px(Math.min(c.w, c.h) / 6) })
|
|
36819
|
+
},
|
|
36820
|
+
podium: {
|
|
36821
|
+
w: 0.6,
|
|
36822
|
+
h: 0.5,
|
|
36823
|
+
draw: (c) => chunk3WNW5Y7P_cjs.polygon({
|
|
36824
|
+
class: "sx-fp-furn",
|
|
36825
|
+
points: `${c.px(c.w * 0.15)},0 ${c.px(c.w * 0.85)},0 ${c.px(c.w)},${c.px(c.h)} 0,${c.px(c.h)}`
|
|
36826
|
+
})
|
|
36827
|
+
},
|
|
36828
|
+
"row-chairs": {
|
|
36829
|
+
w: 2.2,
|
|
36830
|
+
h: 0.5,
|
|
36831
|
+
draw: (c) => {
|
|
36832
|
+
const n = Math.max(1, Math.floor(c.w / 0.55 + 1e-6));
|
|
36833
|
+
const parts = [];
|
|
36834
|
+
for (let i = 0; i < n; i++) {
|
|
36835
|
+
parts.push(chairAt(c.px, (i + 0.5) / n * c.w, c.h / 2, 0));
|
|
36836
|
+
}
|
|
36837
|
+
return parts.join("");
|
|
36838
|
+
}
|
|
36839
|
+
},
|
|
36840
|
+
// ── retail ──
|
|
36841
|
+
// Gondola run: a long fixture with a back-to-back spine and product bays.
|
|
36842
|
+
shelving: {
|
|
36843
|
+
w: 1.8,
|
|
36844
|
+
h: 0.6,
|
|
36845
|
+
draw: (c) => {
|
|
36846
|
+
const parts = [box(c)];
|
|
36847
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: 0, y1: c.px(c.h / 2), x2: c.px(c.w), y2: c.px(c.h / 2) }));
|
|
36848
|
+
const n = Math.max(2, Math.round(c.w / 0.45));
|
|
36849
|
+
for (let i = 1; i < n; i++) {
|
|
36850
|
+
const x = c.px(c.w * i / n);
|
|
36851
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: x, y1: 0, x2: x, y2: c.px(c.h) }));
|
|
36852
|
+
}
|
|
36853
|
+
return parts.join("");
|
|
36854
|
+
}
|
|
36855
|
+
},
|
|
36856
|
+
// POS counter with a register block and a belt line.
|
|
36857
|
+
checkout: {
|
|
36858
|
+
w: 1.6,
|
|
36859
|
+
h: 0.7,
|
|
36860
|
+
draw: (c) => [
|
|
36861
|
+
box(c),
|
|
36862
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-solid", x: c.px(c.w - 0.5), y: c.px(0.12), width: c.px(0.34), height: c.px(0.3), rx: c.px(0.04) }),
|
|
36863
|
+
chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(0.12), y1: c.px(c.h * 0.6), x2: c.px(c.w - 0.62), y2: c.px(c.h * 0.6) })
|
|
36864
|
+
].join("")
|
|
36865
|
+
},
|
|
36866
|
+
// Round garment rack: rail circle with radial hanger ticks.
|
|
36867
|
+
"clothing-rack": {
|
|
36868
|
+
w: 1,
|
|
36869
|
+
h: 1,
|
|
36870
|
+
draw: (c) => {
|
|
36871
|
+
const r6 = Math.min(c.w, c.h) / 2;
|
|
36872
|
+
const cx = c.w / 2;
|
|
36873
|
+
const cy = c.h / 2;
|
|
36874
|
+
const parts = [
|
|
36875
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-nofill", cx: c.px(cx), cy: c.px(cy), r: c.px(r6) }),
|
|
36876
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-dot", cx: c.px(cx), cy: c.px(cy), r: c.px(0.04) })
|
|
36877
|
+
];
|
|
36878
|
+
for (const a of [0, 45, 90, 135, 180, 225, 270, 315]) {
|
|
36879
|
+
const rad = a * Math.PI / 180;
|
|
36880
|
+
parts.push(
|
|
36881
|
+
chunk3WNW5Y7P_cjs.line({
|
|
36882
|
+
class: "sx-fp-furn-line",
|
|
36883
|
+
x1: c.px(cx + (r6 - 0.09) * Math.cos(rad)),
|
|
36884
|
+
y1: c.px(cy + (r6 - 0.09) * Math.sin(rad)),
|
|
36885
|
+
x2: c.px(cx + r6 * Math.cos(rad)),
|
|
36886
|
+
y2: c.px(cy + r6 * Math.sin(rad))
|
|
36887
|
+
})
|
|
36888
|
+
);
|
|
36889
|
+
}
|
|
36890
|
+
return parts.join("");
|
|
36891
|
+
}
|
|
36892
|
+
},
|
|
36893
|
+
// Changing booth: bench at the back, a mirror strip, a dashed curtain at the opening.
|
|
36894
|
+
"fitting-room": {
|
|
36895
|
+
w: 1.1,
|
|
36896
|
+
h: 1.1,
|
|
36897
|
+
draw: (c) => [
|
|
36898
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-nofill", x: 0, y: 0, width: c.px(c.w), height: c.px(c.h) }),
|
|
36899
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn", x: c.px(0.12), y: c.px(0.12), width: c.px(c.w - 0.24), height: c.px(0.28), rx: c.px(0.04) }),
|
|
36900
|
+
chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-dash", x1: 0, y1: c.px(c.h), x2: c.px(c.w), y2: c.px(c.h) }),
|
|
36901
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-solid", x: c.px(c.w - 0.06), y: c.px(c.h * 0.5), width: c.px(0.04), height: c.px(c.h * 0.35) })
|
|
36902
|
+
].join("")
|
|
36903
|
+
},
|
|
36904
|
+
// ── warehouse / industrial ──
|
|
36905
|
+
// Pallet racking: an open frame with bay dividers and cross-bracing.
|
|
36906
|
+
"pallet-rack": {
|
|
36907
|
+
w: 2.7,
|
|
36908
|
+
h: 1.1,
|
|
36909
|
+
draw: (c) => {
|
|
36910
|
+
const parts = [chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-nofill", x: 0, y: 0, width: c.px(c.w), height: c.px(c.h) })];
|
|
36911
|
+
const bays = Math.max(2, Math.round(c.w / 1.35));
|
|
36912
|
+
for (let i = 0; i < bays; i++) {
|
|
36913
|
+
const x0 = c.w * i / bays;
|
|
36914
|
+
const x1 = c.w * (i + 1) / bays;
|
|
36915
|
+
if (i > 0) parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(x0), y1: 0, x2: c.px(x0), y2: c.px(c.h) }));
|
|
36916
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(x0), y1: 0, x2: c.px(x1), y2: c.px(c.h) }));
|
|
36917
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(x1), y1: 0, x2: c.px(x0), y2: c.px(c.h) }));
|
|
36918
|
+
}
|
|
36919
|
+
return parts.join("");
|
|
36920
|
+
}
|
|
36921
|
+
},
|
|
36922
|
+
// Dock door: roll-up door segments with two bumpers at the outer face.
|
|
36923
|
+
"loading-dock": {
|
|
36924
|
+
w: 3,
|
|
36925
|
+
h: 0.6,
|
|
36926
|
+
draw: (c) => {
|
|
36927
|
+
const parts = [box(c)];
|
|
36928
|
+
const n = Math.max(3, Math.round(c.w / 0.5));
|
|
36929
|
+
for (let i = 1; i < n; i++) {
|
|
36930
|
+
const x = c.px(c.w * i / n);
|
|
36931
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: x, y1: 0, x2: x, y2: c.px(c.h) }));
|
|
36932
|
+
}
|
|
36933
|
+
parts.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-solid", x: c.px(0.12), y: c.px(c.h - 0.12), width: c.px(0.3), height: c.px(0.1) }));
|
|
36934
|
+
parts.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-solid", x: c.px(c.w - 0.42), y: c.px(c.h - 0.12), width: c.px(0.3), height: c.px(0.1) }));
|
|
36935
|
+
return parts.join("");
|
|
36936
|
+
}
|
|
36937
|
+
},
|
|
36938
|
+
// Counterbalance forklift silhouette: body, mast forks at the front, operator seat.
|
|
36939
|
+
forklift: {
|
|
36940
|
+
w: 1.2,
|
|
36941
|
+
h: 2.2,
|
|
36942
|
+
draw: (c) => [
|
|
36943
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn", x: c.px(0.15), y: c.px(0.42), width: c.px(c.w - 0.3), height: c.px(c.h - 0.72), rx: c.px(0.06) }),
|
|
36944
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-solid", x: c.px(0.25), y: 0, width: c.px(0.12), height: c.px(0.42) }),
|
|
36945
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-solid", x: c.px(c.w - 0.37), y: 0, width: c.px(0.12), height: c.px(0.42) }),
|
|
36946
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-line", cx: c.px(c.w / 2), cy: c.px(c.h - 0.62), r: c.px(0.18) })
|
|
36947
|
+
].join("")
|
|
36948
|
+
},
|
|
36949
|
+
// ── salon / spa ──
|
|
36950
|
+
// Styling station: back counter with a mirror strip and a chair facing it.
|
|
36951
|
+
"salon-chair": {
|
|
36952
|
+
w: 0.8,
|
|
36953
|
+
h: 1.4,
|
|
36954
|
+
draw: (c) => [
|
|
36955
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn", x: 0, y: 0, width: c.px(c.w), height: c.px(0.32), rx: c.px(0.03) }),
|
|
36956
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-solid", x: c.px(0.08), y: c.px(0.05), width: c.px(c.w - 0.16), height: c.px(0.05) }),
|
|
36957
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn", cx: c.px(c.w / 2), cy: c.px(c.h * 0.64), r: c.px(Math.min(c.w, 0.62) / 2) }),
|
|
36958
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-line", cx: c.px(c.w / 2), cy: c.px(c.h * 0.64), r: c.px(0.08) })
|
|
36959
|
+
].join("")
|
|
36960
|
+
},
|
|
36961
|
+
// Backwash unit: a reclining chair with a wash basin at the head end.
|
|
36962
|
+
"shampoo-bowl": {
|
|
36963
|
+
w: 0.9,
|
|
36964
|
+
h: 1.5,
|
|
36965
|
+
draw: (c) => [
|
|
36966
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn", x: c.px(0.1), y: c.px(0.5), width: c.px(c.w - 0.2), height: c.px(c.h - 0.6), rx: c.px(0.08) }),
|
|
36967
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn", cx: c.px(c.w / 2), cy: c.px(0.4), r: c.px(0.32) }),
|
|
36968
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-line", cx: c.px(c.w / 2), cy: c.px(0.4), r: c.px(0.12) }),
|
|
36969
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-dot", cx: c.px(c.w / 2), cy: c.px(0.12), r: c.px(0.04) })
|
|
36970
|
+
].join("")
|
|
36971
|
+
},
|
|
36972
|
+
// Manicure table: a small table with a client and a technician chair.
|
|
36973
|
+
"manicure-table": {
|
|
36974
|
+
w: 1,
|
|
36975
|
+
h: 0.5,
|
|
36976
|
+
envelope: [CHAIR_GAP + CHAIR_D, 0, CHAIR_GAP + CHAIR_D, 0],
|
|
36977
|
+
draw: (c) => [box(c), chairAt(c.px, c.w / 2, -CHAIR_GAP, 0), chairAt(c.px, c.w / 2, c.h + CHAIR_GAP, 180)].join("")
|
|
36978
|
+
},
|
|
36979
|
+
// ── gym / fitness ──
|
|
36980
|
+
// Treadmill: a deck with a running belt and a console at the front.
|
|
36981
|
+
treadmill: {
|
|
36982
|
+
w: 0.9,
|
|
36983
|
+
h: 2,
|
|
36984
|
+
draw: (c) => [
|
|
36985
|
+
box(c, "sx-fp-furn", 0.05),
|
|
36986
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-line", x: c.px(0.12), y: c.px(0.5), width: c.px(c.w - 0.24), height: c.px(c.h - 0.65), rx: c.px(0.04) }),
|
|
36987
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-solid", x: c.px(0.1), y: c.px(0.08), width: c.px(c.w - 0.2), height: c.px(0.16), rx: c.px(0.03) })
|
|
36988
|
+
].join("")
|
|
36989
|
+
},
|
|
36990
|
+
// Flat bench with upright posts and a loaded barbell crossing it.
|
|
36991
|
+
"weight-bench": {
|
|
36992
|
+
w: 0.6,
|
|
36993
|
+
h: 1.8,
|
|
36994
|
+
envelope: [0, 0.35, 0, 0.35],
|
|
36995
|
+
draw: (c) => [
|
|
36996
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn", x: c.px(c.w / 2 - 0.12), y: c.px(0.3), width: c.px(0.24), height: c.px(c.h - 0.4), rx: c.px(0.05) }),
|
|
36997
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-solid", x: c.px(0.06), y: c.px(0.18), width: c.px(0.1), height: c.px(0.1) }),
|
|
36998
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-solid", x: c.px(c.w - 0.16), y: c.px(0.18), width: c.px(0.1), height: c.px(0.1) }),
|
|
36999
|
+
chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(-0.3), y1: c.px(0.23), x2: c.px(c.w + 0.3), y2: c.px(0.23) })
|
|
37000
|
+
].join("")
|
|
37001
|
+
},
|
|
37002
|
+
// Power rack: a square frame with four corner posts and a barbell.
|
|
37003
|
+
"power-rack": {
|
|
37004
|
+
w: 1.4,
|
|
37005
|
+
h: 1.4,
|
|
37006
|
+
envelope: [0, 0.3, 0, 0.3],
|
|
37007
|
+
draw: (c) => {
|
|
37008
|
+
const post = 0.14;
|
|
37009
|
+
const corners = [
|
|
37010
|
+
[0, 0],
|
|
37011
|
+
[c.w - post, 0],
|
|
37012
|
+
[0, c.h - post],
|
|
37013
|
+
[c.w - post, c.h - post]
|
|
37014
|
+
];
|
|
37015
|
+
const parts = [chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-nofill", x: 0, y: 0, width: c.px(c.w), height: c.px(c.h) })];
|
|
37016
|
+
for (const [px0, py0] of corners) {
|
|
37017
|
+
parts.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-solid", x: c.px(px0), y: c.px(py0), width: c.px(post), height: c.px(post) }));
|
|
37018
|
+
}
|
|
37019
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(-0.28), y1: c.px(c.h * 0.4), x2: c.px(c.w + 0.28), y2: c.px(c.h * 0.4) }));
|
|
37020
|
+
return parts.join("");
|
|
37021
|
+
}
|
|
37022
|
+
},
|
|
37023
|
+
// Exercise mat — an underlay surface, like a rug.
|
|
37024
|
+
"yoga-mat": {
|
|
37025
|
+
w: 0.6,
|
|
37026
|
+
h: 1.8,
|
|
37027
|
+
underlay: true,
|
|
37028
|
+
draw: (c) => chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-dash", x: 0, y: 0, width: c.px(c.w), height: c.px(c.h), rx: c.px(0.08) })
|
|
37029
|
+
},
|
|
37030
|
+
// ── site / outdoor ──
|
|
37031
|
+
// Tree in plan: a canopy disc with a foliage ring and a trunk dot.
|
|
37032
|
+
tree: {
|
|
37033
|
+
w: 2,
|
|
37034
|
+
h: 2,
|
|
37035
|
+
draw: (c) => {
|
|
37036
|
+
const r6 = Math.min(c.w, c.h) / 2;
|
|
37037
|
+
return [
|
|
37038
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn", cx: c.px(c.w / 2), cy: c.px(c.h / 2), r: c.px(r6) }),
|
|
37039
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-line", cx: c.px(c.w / 2), cy: c.px(c.h / 2), r: c.px(r6 * 0.6) }),
|
|
37040
|
+
chunk3WNW5Y7P_cjs.circle({ class: "sx-fp-furn-dot", cx: c.px(c.w / 2), cy: c.px(c.h / 2), r: c.px(0.07) })
|
|
37041
|
+
].join("");
|
|
37042
|
+
}
|
|
37043
|
+
},
|
|
37044
|
+
// Car in plan (parking-stall footprint): body, glazing lines, four wheels.
|
|
37045
|
+
car: {
|
|
37046
|
+
w: 1.8,
|
|
37047
|
+
h: 4.4,
|
|
37048
|
+
draw: (c) => {
|
|
37049
|
+
const parts = [chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn", x: c.px(0.12), y: c.px(0.1), width: c.px(c.w - 0.24), height: c.px(c.h - 0.2), rx: c.px(0.35) })];
|
|
37050
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(0.3), y1: c.px(c.h * 0.26), x2: c.px(c.w - 0.3), y2: c.px(c.h * 0.26) }));
|
|
37051
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-furn-line", x1: c.px(0.3), y1: c.px(c.h * 0.72), x2: c.px(c.w - 0.3), y2: c.px(c.h * 0.72) }));
|
|
37052
|
+
for (const wy of [c.h * 0.3, c.h * 0.7]) {
|
|
37053
|
+
parts.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-solid", x: 0, y: c.px(wy - 0.18), width: c.px(0.14), height: c.px(0.36), rx: c.px(0.03) }));
|
|
37054
|
+
parts.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-furn-solid", x: c.px(c.w - 0.14), y: c.px(wy - 0.18), width: c.px(0.14), height: c.px(0.36), rx: c.px(0.03) }));
|
|
37055
|
+
}
|
|
37056
|
+
return parts.join("");
|
|
37057
|
+
}
|
|
37058
|
+
}
|
|
37059
|
+
};
|
|
37060
|
+
var FURNITURE_TYPES = Object.keys(FLOORPLAN_SYMBOLS);
|
|
37061
|
+
|
|
37062
|
+
// src/diagrams/floorplan/parser.ts
|
|
37063
|
+
var FloorplanParseError = class extends Error {
|
|
37064
|
+
line;
|
|
37065
|
+
constructor(message, line2) {
|
|
37066
|
+
super(`line ${line2}: ${message}`);
|
|
37067
|
+
this.name = "FloorplanParseError";
|
|
37068
|
+
this.line = line2;
|
|
37069
|
+
}
|
|
37070
|
+
};
|
|
37071
|
+
var isStr = (t) => t !== void 0 && "str" in t;
|
|
37072
|
+
var isWord = (t, w) => t !== void 0 && "word" in t && (w === void 0 || t.word === w);
|
|
37073
|
+
function normalizeQuotes3(line2) {
|
|
37074
|
+
return line2.replace(/[“”「」『』]/g, '"').replace(/[‘’]/g, "'");
|
|
37075
|
+
}
|
|
37076
|
+
function tokenize7(line2) {
|
|
37077
|
+
const out = [];
|
|
37078
|
+
const re = /"([^"]*)"|(\S+)/g;
|
|
37079
|
+
let m;
|
|
37080
|
+
while (m = re.exec(line2)) {
|
|
37081
|
+
if (m[1] !== void 0) out.push({ str: m[1] });
|
|
37082
|
+
else out.push({ word: m[2] });
|
|
37083
|
+
}
|
|
37084
|
+
return out;
|
|
37085
|
+
}
|
|
37086
|
+
function parseNum(t, what, ln) {
|
|
37087
|
+
if (!isWord(t)) throw new FloorplanParseError(`expected a number for ${what}`, ln);
|
|
37088
|
+
const v = Number(t.word);
|
|
37089
|
+
if (!Number.isFinite(v)) throw new FloorplanParseError(`expected a number for ${what}, got "${t.word}"`, ln);
|
|
37090
|
+
return v;
|
|
37091
|
+
}
|
|
37092
|
+
function parseCoord2(t, what, ln) {
|
|
37093
|
+
if (!isWord(t)) throw new FloorplanParseError(`expected "x,y" for ${what}`, ln);
|
|
37094
|
+
const m = /^(-?\d*\.?\d+),(-?\d*\.?\d+)$/.exec(t.word);
|
|
37095
|
+
if (!m) throw new FloorplanParseError(`expected "x,y" for ${what}, got "${t.word}"`, ln);
|
|
37096
|
+
return { x: Number(m[1]), y: Number(m[2]) };
|
|
37097
|
+
}
|
|
37098
|
+
function parseDims(t, what, ln) {
|
|
37099
|
+
if (!isWord(t)) throw new FloorplanParseError(`expected "WxH" for ${what}`, ln);
|
|
37100
|
+
const m = /^(\d*\.?\d+)x(\d*\.?\d+)$/i.exec(t.word);
|
|
37101
|
+
if (!m) throw new FloorplanParseError(`expected "WxH" for ${what}, got "${t.word}"`, ln);
|
|
37102
|
+
return { w: Number(m[1]), h: Number(m[2]) };
|
|
37103
|
+
}
|
|
37104
|
+
function parsePct(t, ln) {
|
|
37105
|
+
if (!isWord(t)) throw new FloorplanParseError(`expected a percentage for "at"`, ln);
|
|
37106
|
+
const v = Number(t.word.replace(/%$/, ""));
|
|
37107
|
+
if (!Number.isFinite(v)) throw new FloorplanParseError(`expected a percentage for "at", got "${t.word}"`, ln);
|
|
37108
|
+
return v;
|
|
37109
|
+
}
|
|
37110
|
+
function parseId(t, what, ln) {
|
|
37111
|
+
if (!isWord(t)) throw new FloorplanParseError(`expected ${what}`, ln);
|
|
37112
|
+
return t.word;
|
|
37113
|
+
}
|
|
37114
|
+
var SIDES = ["north", "south", "east", "west"];
|
|
37115
|
+
var REL_HOW = ["right-of", "left-of", "above", "below"];
|
|
37116
|
+
function parseFurnitureType(t, ln) {
|
|
37117
|
+
const word = isWord(t) ? t.word : "";
|
|
37118
|
+
if (!FURNITURE_TYPES.includes(word)) {
|
|
37119
|
+
throw new FloorplanParseError(
|
|
37120
|
+
`unknown furniture type "${word}". Valid types: ${FURNITURE_TYPES.join(", ")}`,
|
|
37121
|
+
ln
|
|
37122
|
+
);
|
|
37123
|
+
}
|
|
37124
|
+
return word;
|
|
37125
|
+
}
|
|
37126
|
+
function parseHeader3(tok, ast, ln) {
|
|
37127
|
+
while (tok.length) {
|
|
37128
|
+
const t = tok.shift();
|
|
37129
|
+
if (isStr(t)) ast.title = t.str;
|
|
37130
|
+
else if (t.word === "unit") {
|
|
37131
|
+
const u = parseId(tok.shift(), "unit (m|ft)", ln);
|
|
37132
|
+
if (u !== "m" && u !== "ft") throw new FloorplanParseError(`unit must be "m" or "ft", got "${u}"`, ln);
|
|
37133
|
+
ast.unit = u;
|
|
37134
|
+
} else throw new FloorplanParseError(`floorplan: unexpected token "${t.word}"`, ln);
|
|
37135
|
+
}
|
|
37136
|
+
}
|
|
37137
|
+
function parseRoom(tok, ast, ln) {
|
|
37138
|
+
const id = parseId(tok.shift(), "a room id", ln);
|
|
37139
|
+
if (ast.rooms.some((r6) => r6.id === id)) {
|
|
37140
|
+
throw new FloorplanParseError(`duplicate room id "${id}"`, ln);
|
|
37141
|
+
}
|
|
37142
|
+
const room = { id, label: id, w: 4, h: 3, line: ln };
|
|
37143
|
+
while (tok.length) {
|
|
37144
|
+
const t = tok.shift();
|
|
37145
|
+
if (isStr(t)) room.label = t.str;
|
|
37146
|
+
else if (t.word === "at") room.at = parseCoord2(tok.shift(), "at", ln);
|
|
37147
|
+
else if (REL_HOW.includes(t.word)) {
|
|
37148
|
+
room.rel = {
|
|
37149
|
+
how: t.word,
|
|
37150
|
+
ref: parseId(tok.shift(), `a room id after "${t.word}"`, ln),
|
|
37151
|
+
offset: void 0,
|
|
37152
|
+
align: void 0
|
|
37153
|
+
};
|
|
37154
|
+
} else if (t.word === "offset") {
|
|
37155
|
+
if (!room.rel) throw new FloorplanParseError(`"offset" requires a relative placement (right-of/left-of/above/below)`, ln);
|
|
37156
|
+
room.rel.offset = parseNum(tok.shift(), "offset", ln);
|
|
37157
|
+
} else if (t.word === "align") {
|
|
37158
|
+
if (!room.rel) throw new FloorplanParseError(`"align" requires a relative placement (right-of/left-of/above/below)`, ln);
|
|
37159
|
+
const a = parseId(tok.shift(), "align (start|center|end)", ln);
|
|
37160
|
+
if (a !== "start" && a !== "center" && a !== "end") {
|
|
37161
|
+
throw new FloorplanParseError(`align must be start|center|end, got "${a}"`, ln);
|
|
37162
|
+
}
|
|
37163
|
+
room.rel.align = a;
|
|
37164
|
+
} else if (t.word === "size") {
|
|
37165
|
+
const d = parseDims(tok.shift(), "size", ln);
|
|
37166
|
+
room.w = d.w;
|
|
37167
|
+
room.h = d.h;
|
|
37168
|
+
} else if (t.word === "fill") room.fill = parseId(tok.shift(), "a fill color", ln);
|
|
37169
|
+
else if (t.word === "nolabel") room.nolabel = true;
|
|
37170
|
+
else throw new FloorplanParseError(`room: unexpected token "${t.word}"`, ln);
|
|
37171
|
+
}
|
|
37172
|
+
ast.rooms.push(room);
|
|
37173
|
+
}
|
|
37174
|
+
function parseExtend(tok, ast, ln) {
|
|
37175
|
+
const room = parseId(tok.shift(), "a room id", ln);
|
|
37176
|
+
const ext = { room, w: 2, h: 2, line: ln };
|
|
37177
|
+
while (tok.length) {
|
|
37178
|
+
const t = tok.shift();
|
|
37179
|
+
if (!isWord(t)) throw new FloorplanParseError(`extend: unexpected string "${t.str}"`, ln);
|
|
37180
|
+
else if (t.word === "at") ext.at = parseCoord2(tok.shift(), "at", ln);
|
|
37181
|
+
else if (REL_HOW.includes(t.word)) {
|
|
37182
|
+
ext.rel = {
|
|
37183
|
+
how: t.word,
|
|
37184
|
+
ref: parseId(tok.shift(), `a room id after "${t.word}"`, ln),
|
|
37185
|
+
offset: void 0,
|
|
37186
|
+
align: void 0
|
|
37187
|
+
};
|
|
37188
|
+
} else if (t.word === "offset") {
|
|
37189
|
+
if (!ext.rel) throw new FloorplanParseError(`"offset" requires a relative placement (right-of/left-of/above/below)`, ln);
|
|
37190
|
+
ext.rel.offset = parseNum(tok.shift(), "offset", ln);
|
|
37191
|
+
} else if (t.word === "align") {
|
|
37192
|
+
if (!ext.rel) throw new FloorplanParseError(`"align" requires a relative placement (right-of/left-of/above/below)`, ln);
|
|
37193
|
+
const a = parseId(tok.shift(), "align (start|center|end)", ln);
|
|
37194
|
+
if (a !== "start" && a !== "center" && a !== "end") {
|
|
37195
|
+
throw new FloorplanParseError(`align must be start|center|end, got "${a}"`, ln);
|
|
37196
|
+
}
|
|
37197
|
+
ext.rel.align = a;
|
|
37198
|
+
} else if (t.word === "size") {
|
|
37199
|
+
const d = parseDims(tok.shift(), "size", ln);
|
|
37200
|
+
ext.w = d.w;
|
|
37201
|
+
ext.h = d.h;
|
|
37202
|
+
} else throw new FloorplanParseError(`extend: unexpected token "${t.word}"`, ln);
|
|
37203
|
+
}
|
|
37204
|
+
ast.extensions.push(ext);
|
|
37205
|
+
}
|
|
37206
|
+
var DOOR_TYPES = ["single", "double", "sliding", "pocket", "bifold"];
|
|
37207
|
+
var WINDOW_TYPES = ["fixed", "sliding", "casement", "bay"];
|
|
37208
|
+
function parseOpening(kind, tok, ast, ln) {
|
|
37209
|
+
const op = {
|
|
37210
|
+
kind,
|
|
37211
|
+
pct: 50,
|
|
37212
|
+
width: 0,
|
|
37213
|
+
// resolved after the form is known
|
|
37214
|
+
hinge: "left",
|
|
37215
|
+
swing: "in",
|
|
37216
|
+
doorType: "single",
|
|
37217
|
+
windowType: "fixed",
|
|
37218
|
+
line: ln
|
|
37219
|
+
};
|
|
37220
|
+
const t0 = tok.shift();
|
|
37221
|
+
if (isWord(t0, "between")) {
|
|
37222
|
+
op.between = [parseId(tok.shift(), "a room id", ln), parseId(tok.shift(), "a second room id", ln)];
|
|
37223
|
+
} else {
|
|
37224
|
+
op.room = parseId(t0, `a room id or "between"`, ln);
|
|
37225
|
+
const side = parseId(tok.shift(), "a wall side", ln);
|
|
37226
|
+
if (!SIDES.includes(side)) {
|
|
37227
|
+
throw new FloorplanParseError(`expected a wall side north|south|east|west, got "${side}"`, ln);
|
|
37228
|
+
}
|
|
37229
|
+
op.side = side;
|
|
37230
|
+
}
|
|
37231
|
+
while (tok.length) {
|
|
37232
|
+
const t = tok.shift();
|
|
37233
|
+
if (!isWord(t)) throw new FloorplanParseError(`${kind}: unexpected string "${t.str}"`, ln);
|
|
37234
|
+
else if (t.word === "at") op.pct = parsePct(tok.shift(), ln);
|
|
37235
|
+
else if (t.word === "width") op.width = parseNum(tok.shift(), "width", ln);
|
|
37236
|
+
else if (t.word === "hinge") {
|
|
37237
|
+
const h = parseId(tok.shift(), "hinge (left|right)", ln);
|
|
37238
|
+
if (h !== "left" && h !== "right") throw new FloorplanParseError(`hinge must be left|right, got "${h}"`, ln);
|
|
37239
|
+
op.hinge = h;
|
|
37240
|
+
} else if (t.word === "swing") {
|
|
37241
|
+
const s = parseId(tok.shift(), "swing (in|out)", ln);
|
|
37242
|
+
if (s !== "in" && s !== "out") throw new FloorplanParseError(`swing must be in|out, got "${s}"`, ln);
|
|
37243
|
+
op.swing = s;
|
|
37244
|
+
} else if (t.word === "type") {
|
|
37245
|
+
const d = parseId(tok.shift(), `${kind} type`, ln);
|
|
37246
|
+
if (kind === "window") {
|
|
37247
|
+
if (!WINDOW_TYPES.includes(d)) {
|
|
37248
|
+
throw new FloorplanParseError(`window type must be ${WINDOW_TYPES.join("|")}, got "${d}"`, ln);
|
|
37249
|
+
}
|
|
37250
|
+
op.windowType = d;
|
|
37251
|
+
} else {
|
|
37252
|
+
if (!DOOR_TYPES.includes(d)) {
|
|
37253
|
+
throw new FloorplanParseError(`door type must be ${DOOR_TYPES.join("|")}, got "${d}"`, ln);
|
|
37254
|
+
}
|
|
37255
|
+
op.doorType = d;
|
|
37256
|
+
}
|
|
37257
|
+
} else throw new FloorplanParseError(`${kind}: unexpected token "${t.word}"`, ln);
|
|
37258
|
+
}
|
|
37259
|
+
if (op.width === 0) {
|
|
37260
|
+
op.width = kind === "window" ? 1.2 : kind === "opening" ? 1 : op.between ? 0.8 : 0.9;
|
|
37261
|
+
}
|
|
37262
|
+
ast.openings.push(op);
|
|
37263
|
+
}
|
|
37264
|
+
function parseFurniture(tok, ast, ln) {
|
|
37265
|
+
const type = parseFurnitureType(tok.shift(), ln);
|
|
37266
|
+
const f = { type, x: 0, y: 0, rotate: 0, line: ln };
|
|
37267
|
+
while (tok.length) {
|
|
37268
|
+
const t = tok.shift();
|
|
37269
|
+
if (isStr(t)) f.label = t.str;
|
|
37270
|
+
else if (t.word === "in") f.room = parseId(tok.shift(), `a room id after "in"`, ln);
|
|
37271
|
+
else if (t.word === "at") {
|
|
37272
|
+
const c = parseCoord2(tok.shift(), "at", ln);
|
|
37273
|
+
f.x = c.x;
|
|
37274
|
+
f.y = c.y;
|
|
37275
|
+
} else if (t.word === "size") f.size = parseDims(tok.shift(), "size", ln);
|
|
37276
|
+
else if (t.word === "rotate") f.rotate = parseNum(tok.shift(), "rotate", ln);
|
|
37277
|
+
else throw new FloorplanParseError(`furniture: unexpected token "${t.word}"`, ln);
|
|
37278
|
+
}
|
|
37279
|
+
ast.furniture.push(f);
|
|
37280
|
+
}
|
|
37281
|
+
function parseArray(mode, tok, ast, ln) {
|
|
37282
|
+
const type = parseFurnitureType(tok.shift(), ln);
|
|
37283
|
+
const a = {
|
|
37284
|
+
mode,
|
|
37285
|
+
type,
|
|
37286
|
+
rows: 1,
|
|
37287
|
+
cols: 1,
|
|
37288
|
+
count: Infinity,
|
|
37289
|
+
rotate: 0,
|
|
37290
|
+
line: ln
|
|
37291
|
+
};
|
|
37292
|
+
while (tok.length) {
|
|
37293
|
+
const t = tok.shift();
|
|
37294
|
+
if (!isWord(t)) throw new FloorplanParseError(`${mode}: unexpected string "${t.str}"`, ln);
|
|
37295
|
+
else if (t.word === "in") a.room = parseId(tok.shift(), `a room id after "in"`, ln);
|
|
37296
|
+
else if (t.word === "rows") a.rows = parseNum(tok.shift(), "rows", ln);
|
|
37297
|
+
else if (t.word === "cols") a.cols = parseNum(tok.shift(), "cols", ln);
|
|
37298
|
+
else if (t.word === "count") a.count = parseNum(tok.shift(), "count", ln);
|
|
37299
|
+
else if (t.word === "area") {
|
|
37300
|
+
a.p1 = parseCoord2(tok.shift(), "area p1", ln);
|
|
37301
|
+
a.p2 = parseCoord2(tok.shift(), "area p2", ln);
|
|
37302
|
+
} else if (t.word === "itemsize") a.itemsize = parseDims(tok.shift(), "itemsize", ln);
|
|
37303
|
+
else if (t.word === "rotate") a.rotate = parseNum(tok.shift(), "rotate", ln);
|
|
37304
|
+
else if (t.word === "center") a.center = parseCoord2(tok.shift(), "center", ln);
|
|
37305
|
+
else if (t.word === "radius") a.radius = parseNum(tok.shift(), "radius", ln);
|
|
37306
|
+
else if (t.word === "from") a.fromDeg = parseNum(tok.shift(), "from", ln);
|
|
37307
|
+
else if (t.word === "to") a.toDeg = parseNum(tok.shift(), "to", ln);
|
|
37308
|
+
else throw new FloorplanParseError(`${mode}: unexpected token "${t.word}"`, ln);
|
|
37309
|
+
}
|
|
37310
|
+
ast.arrays.push(a);
|
|
37311
|
+
}
|
|
37312
|
+
function parseFloorplan(text2) {
|
|
37313
|
+
const ast = {
|
|
37314
|
+
type: "floorplan",
|
|
37315
|
+
title: "Floor Plan",
|
|
37316
|
+
unit: "m",
|
|
37317
|
+
rooms: [],
|
|
37318
|
+
extensions: [],
|
|
37319
|
+
openings: [],
|
|
37320
|
+
furniture: [],
|
|
37321
|
+
arrays: []
|
|
37322
|
+
};
|
|
37323
|
+
let sawHeader = false;
|
|
37324
|
+
const lines = text2.split(/\r?\n/);
|
|
37325
|
+
for (let i = 0; i < lines.length; i++) {
|
|
37326
|
+
const ln = i + 1;
|
|
37327
|
+
const raw = normalizeQuotes3(lines[i]).trim();
|
|
37328
|
+
if (!raw) continue;
|
|
37329
|
+
const all = tokenize7(raw);
|
|
37330
|
+
const tok = [];
|
|
37331
|
+
for (let k = 0; k < all.length; k++) {
|
|
37332
|
+
const t = all[k];
|
|
37333
|
+
if (isWord(t) && (t.word.startsWith("#") || t.word.startsWith("//"))) {
|
|
37334
|
+
const prev = all[k - 1];
|
|
37335
|
+
if (t.word.startsWith("#") && isWord(prev, "fill")) {
|
|
37336
|
+
tok.push(t);
|
|
37337
|
+
continue;
|
|
37338
|
+
}
|
|
37339
|
+
break;
|
|
37340
|
+
}
|
|
37341
|
+
tok.push(t);
|
|
37342
|
+
}
|
|
37343
|
+
if (tok.length === 0) continue;
|
|
37344
|
+
const head = tok.shift();
|
|
37345
|
+
if (!isWord(head)) throw new FloorplanParseError(`unexpected string at line start`, ln);
|
|
37346
|
+
const kw = head.word.toLowerCase();
|
|
37347
|
+
if (kw === "floorplan") {
|
|
37348
|
+
parseHeader3(tok, ast, ln);
|
|
37349
|
+
sawHeader = true;
|
|
37350
|
+
} else if (!sawHeader) {
|
|
37351
|
+
throw new FloorplanParseError(`the first statement must be the "floorplan" header`, ln);
|
|
37352
|
+
} else if (kw === "room") parseRoom(tok, ast, ln);
|
|
37353
|
+
else if (kw === "north") {
|
|
37354
|
+
ast.north = tok.length ? parseNum(tok.shift(), "north rotation (degrees)", ln) : 0;
|
|
37355
|
+
if (tok.length) throw new FloorplanParseError(`north: unexpected trailing tokens`, ln);
|
|
37356
|
+
} else if (kw === "extend") parseExtend(tok, ast, ln);
|
|
37357
|
+
else if (kw === "door" || kw === "window" || kw === "opening") parseOpening(kw, tok, ast, ln);
|
|
37358
|
+
else if (kw === "furniture") parseFurniture(tok, ast, ln);
|
|
37359
|
+
else if (kw === "grid" || kw === "row" || kw === "arc") parseArray(kw, tok, ast, ln);
|
|
37360
|
+
else {
|
|
37361
|
+
throw new FloorplanParseError(
|
|
37362
|
+
`unknown keyword "${kw}". Expected: floorplan, room, extend, door, window, opening, furniture, grid, row, arc`,
|
|
37363
|
+
ln
|
|
37364
|
+
);
|
|
37365
|
+
}
|
|
37366
|
+
}
|
|
37367
|
+
return ast;
|
|
37368
|
+
}
|
|
37369
|
+
|
|
37370
|
+
// src/diagrams/floorplan/layout.ts
|
|
37371
|
+
var FT = 0.3048;
|
|
37372
|
+
var FLOORPLAN_CONST = {
|
|
37373
|
+
/** Wall band thickness, meters (§5). */
|
|
37374
|
+
wallT: 0.2,
|
|
37375
|
+
/** Default render scale, px per meter (§4.1). */
|
|
37376
|
+
scale: 55,
|
|
37377
|
+
/** Jamb margin an opening keeps from the segment ends, meters (§4.3). */
|
|
37378
|
+
jamb: 0.05,
|
|
37379
|
+
/** Dimension band depth outside the plan, meters. */
|
|
37380
|
+
dimBand: 1,
|
|
37381
|
+
/** Outer padding, meters. */
|
|
37382
|
+
pad: 0.45,
|
|
37383
|
+
/** Offsets of the major / minor dimension rows from the plan edge, meters. */
|
|
37384
|
+
dimMajorOff: 0.62,
|
|
37385
|
+
dimMinorOff: 0.3
|
|
37386
|
+
};
|
|
37387
|
+
function formatLength(m, unit) {
|
|
37388
|
+
if (unit === "m") {
|
|
37389
|
+
const v = Math.round(m * 100) / 100;
|
|
37390
|
+
return `${v} m`;
|
|
37391
|
+
}
|
|
37392
|
+
const ftv = m / FT;
|
|
37393
|
+
let f = Math.floor(ftv + 1e-6);
|
|
37394
|
+
let inches = Math.round((ftv - f) * 12);
|
|
37395
|
+
if (inches >= 12) {
|
|
37396
|
+
f += 1;
|
|
37397
|
+
inches = 0;
|
|
37398
|
+
}
|
|
37399
|
+
return inches ? `${f}'${inches}"` : `${f}'`;
|
|
37400
|
+
}
|
|
37401
|
+
function formatArea(areaM2, unit) {
|
|
37402
|
+
if (unit === "m") return `${areaM2.toFixed(1)} m\xB2`;
|
|
37403
|
+
return `${Math.round(areaM2 / (FT * FT))} sq ft`;
|
|
37404
|
+
}
|
|
37405
|
+
var fmtNum = (v) => String(Math.round(v * 100) / 100);
|
|
37406
|
+
var snap = (v) => Math.round(v * 1e6) / 1e6;
|
|
37407
|
+
var ADJ_EPS = 0.051;
|
|
37408
|
+
var MIN_OVERLAP = 0.3;
|
|
37409
|
+
function rectSharedEdge(a, b) {
|
|
37410
|
+
if (Math.abs(a.x + a.w - b.x) < ADJ_EPS || Math.abs(b.x + b.w - a.x) < ADJ_EPS) {
|
|
37411
|
+
const along = Math.abs(a.x + a.w - b.x) < ADJ_EPS ? a.x + a.w : b.x + b.w;
|
|
37412
|
+
const lo = Math.max(a.y, b.y);
|
|
37413
|
+
const hi = Math.min(a.y + a.h, b.y + b.h);
|
|
37414
|
+
if (hi - lo >= MIN_OVERLAP) return { vertical: true, along, lo, hi };
|
|
37415
|
+
}
|
|
37416
|
+
if (Math.abs(a.y + a.h - b.y) < ADJ_EPS || Math.abs(b.y + b.h - a.y) < ADJ_EPS) {
|
|
37417
|
+
const along = Math.abs(a.y + a.h - b.y) < ADJ_EPS ? a.y + a.h : b.y + b.h;
|
|
37418
|
+
const lo = Math.max(a.x, b.x);
|
|
37419
|
+
const hi = Math.min(a.x + a.w, b.x + b.w);
|
|
37420
|
+
if (hi - lo >= MIN_OVERLAP) return { vertical: false, along, lo, hi };
|
|
37421
|
+
}
|
|
37422
|
+
return null;
|
|
37423
|
+
}
|
|
37424
|
+
function roomSharedEdge(a, b) {
|
|
37425
|
+
let best = null;
|
|
37426
|
+
for (const pa of a.parts) {
|
|
37427
|
+
for (const pb of b.parts) {
|
|
37428
|
+
const e = rectSharedEdge(pa, pb);
|
|
37429
|
+
if (e && (!best || e.hi - e.lo > best.edge.hi - best.edge.lo)) {
|
|
37430
|
+
best = { edge: e, aPart: pa, bPart: pb };
|
|
37431
|
+
}
|
|
37432
|
+
}
|
|
37433
|
+
}
|
|
37434
|
+
return best;
|
|
37435
|
+
}
|
|
37436
|
+
function rectOverlap(a, b) {
|
|
37437
|
+
return {
|
|
37438
|
+
ox: Math.min(a.x + a.w, b.x + b.w) - Math.max(a.x, b.x),
|
|
37439
|
+
oy: Math.min(a.y + a.h, b.y + b.h) - Math.max(a.y, b.y)
|
|
37440
|
+
};
|
|
37441
|
+
}
|
|
37442
|
+
function obbCorners(x, y, w, h, rotDeg, margins) {
|
|
37443
|
+
const [mt, mr, mb, ml] = margins;
|
|
37444
|
+
const cx = x + w / 2;
|
|
37445
|
+
const cy = y + h / 2;
|
|
37446
|
+
const corners = [
|
|
37447
|
+
[x - ml, y - mt],
|
|
37448
|
+
[x + w + mr, y - mt],
|
|
37449
|
+
[x + w + mr, y + h + mb],
|
|
37450
|
+
[x - ml, y + h + mb]
|
|
37451
|
+
];
|
|
37452
|
+
if (!rotDeg) return corners;
|
|
37453
|
+
const rad = rotDeg * Math.PI / 180;
|
|
37454
|
+
const cos = Math.cos(rad);
|
|
37455
|
+
const sin = Math.sin(rad);
|
|
37456
|
+
return corners.map(([px, py]) => {
|
|
37457
|
+
const dx = px - cx;
|
|
37458
|
+
const dy = py - cy;
|
|
37459
|
+
return [cx + dx * cos - dy * sin, cy + dx * sin + dy * cos];
|
|
37460
|
+
});
|
|
37461
|
+
}
|
|
37462
|
+
function rotatedAabb(x, y, w, h, rotDeg, margins) {
|
|
37463
|
+
const corners = obbCorners(x, y, w, h, rotDeg, margins);
|
|
37464
|
+
let minX = Infinity;
|
|
37465
|
+
let minY = Infinity;
|
|
37466
|
+
let maxX = -Infinity;
|
|
37467
|
+
let maxY = -Infinity;
|
|
37468
|
+
for (const [px, py] of corners) {
|
|
37469
|
+
minX = Math.min(minX, px);
|
|
37470
|
+
minY = Math.min(minY, py);
|
|
37471
|
+
maxX = Math.max(maxX, px);
|
|
37472
|
+
maxY = Math.max(maxY, py);
|
|
37473
|
+
}
|
|
37474
|
+
return { minX, minY, maxX, maxY };
|
|
37475
|
+
}
|
|
37476
|
+
function obbPenetration(a, b) {
|
|
37477
|
+
let minPen = Infinity;
|
|
37478
|
+
for (const poly of [a, b]) {
|
|
37479
|
+
for (let i = 0; i < 4; i++) {
|
|
37480
|
+
const j = (i + 1) % 4;
|
|
37481
|
+
let ax = poly[j][1] - poly[i][1];
|
|
37482
|
+
let ay = poly[i][0] - poly[j][0];
|
|
37483
|
+
const len = Math.hypot(ax, ay);
|
|
37484
|
+
if (len < 1e-12) continue;
|
|
37485
|
+
ax /= len;
|
|
37486
|
+
ay /= len;
|
|
37487
|
+
let aLo = Infinity;
|
|
37488
|
+
let aHi = -Infinity;
|
|
37489
|
+
for (const [px, py] of a) {
|
|
37490
|
+
const v = px * ax + py * ay;
|
|
37491
|
+
aLo = Math.min(aLo, v);
|
|
37492
|
+
aHi = Math.max(aHi, v);
|
|
37493
|
+
}
|
|
37494
|
+
let bLo = Infinity;
|
|
37495
|
+
let bHi = -Infinity;
|
|
37496
|
+
for (const [px, py] of b) {
|
|
37497
|
+
const v = px * ax + py * ay;
|
|
37498
|
+
bLo = Math.min(bLo, v);
|
|
37499
|
+
bHi = Math.max(bHi, v);
|
|
37500
|
+
}
|
|
37501
|
+
const pen = Math.min(aHi, bHi) - Math.max(aLo, bLo);
|
|
37502
|
+
if (pen <= 0) return 0;
|
|
37503
|
+
minPen = Math.min(minPen, pen);
|
|
37504
|
+
}
|
|
37505
|
+
}
|
|
37506
|
+
return minPen === Infinity ? 0 : minPen;
|
|
37507
|
+
}
|
|
37508
|
+
function resolvePlacement(p, w, h, byId, rooms, u, who, errors) {
|
|
37509
|
+
if (p.at) return { x: snap(p.at.x * u), y: snap(p.at.y * u) };
|
|
37510
|
+
if (p.rel) {
|
|
37511
|
+
const refIdx = byId.get(p.rel.ref);
|
|
37512
|
+
if (refIdx === void 0) {
|
|
37513
|
+
errors.push(`${who}: unknown reference room "${p.rel.ref}" \u2014 declare it first`);
|
|
37514
|
+
return null;
|
|
37515
|
+
}
|
|
37516
|
+
const ref = rooms[refIdx];
|
|
37517
|
+
const off = (p.rel.offset ?? 0) * u;
|
|
37518
|
+
const alignPos = (refStart, refLen, len) => {
|
|
37519
|
+
if (p.rel.align === "center") return refStart + (refLen - len) / 2 + off;
|
|
37520
|
+
if (p.rel.align === "end") return refStart + refLen - len + off;
|
|
37521
|
+
return refStart + off;
|
|
37522
|
+
};
|
|
37523
|
+
let x = 0;
|
|
37524
|
+
let y = 0;
|
|
37525
|
+
switch (p.rel.how) {
|
|
37526
|
+
case "right-of":
|
|
37527
|
+
x = ref.x + ref.w;
|
|
37528
|
+
y = alignPos(ref.y, ref.h, h);
|
|
37529
|
+
break;
|
|
37530
|
+
case "left-of":
|
|
37531
|
+
x = ref.x - w;
|
|
37532
|
+
y = alignPos(ref.y, ref.h, h);
|
|
37533
|
+
break;
|
|
37534
|
+
case "below":
|
|
37535
|
+
y = ref.y + ref.h;
|
|
37536
|
+
x = alignPos(ref.x, ref.w, w);
|
|
37537
|
+
break;
|
|
37538
|
+
case "above":
|
|
37539
|
+
y = ref.y - h;
|
|
37540
|
+
x = alignPos(ref.x, ref.w, w);
|
|
37541
|
+
break;
|
|
37542
|
+
}
|
|
37543
|
+
return { x: snap(x), y: snap(y) };
|
|
37544
|
+
}
|
|
37545
|
+
return { x: 0, y: 0 };
|
|
37546
|
+
}
|
|
37547
|
+
function refreshRoomBounds(room, unit) {
|
|
37548
|
+
let minX = Infinity;
|
|
37549
|
+
let minY = Infinity;
|
|
37550
|
+
let maxX = -Infinity;
|
|
37551
|
+
let maxY = -Infinity;
|
|
37552
|
+
let area = 0;
|
|
37553
|
+
for (const p of room.parts) {
|
|
37554
|
+
minX = Math.min(minX, p.x);
|
|
37555
|
+
minY = Math.min(minY, p.y);
|
|
37556
|
+
maxX = Math.max(maxX, p.x + p.w);
|
|
37557
|
+
maxY = Math.max(maxY, p.y + p.h);
|
|
37558
|
+
area += p.w * p.h;
|
|
37559
|
+
}
|
|
37560
|
+
room.x = snap(minX);
|
|
37561
|
+
room.y = snap(minY);
|
|
37562
|
+
room.w = snap(maxX - minX);
|
|
37563
|
+
room.h = snap(maxY - minY);
|
|
37564
|
+
room.areaM2 = area;
|
|
37565
|
+
room.areaText = formatArea(area, unit);
|
|
37566
|
+
}
|
|
37567
|
+
function subtractIntervals(lo, hi, cuts) {
|
|
37568
|
+
let pieces = [[lo, hi]];
|
|
37569
|
+
for (const [cLo, cHi] of cuts) {
|
|
37570
|
+
const next = [];
|
|
37571
|
+
for (const [pLo, pHi] of pieces) {
|
|
37572
|
+
if (cHi <= pLo + 1e-9 || cLo >= pHi - 1e-9) {
|
|
37573
|
+
next.push([pLo, pHi]);
|
|
37574
|
+
continue;
|
|
37575
|
+
}
|
|
37576
|
+
if (cLo > pLo + 1e-9) next.push([pLo, Math.min(cLo, pHi)]);
|
|
37577
|
+
if (cHi < pHi - 1e-9) next.push([Math.max(cHi, pLo), pHi]);
|
|
37578
|
+
}
|
|
37579
|
+
pieces = next;
|
|
37580
|
+
}
|
|
37581
|
+
return pieces.filter(([a, b]) => b - a > 1e-9);
|
|
37582
|
+
}
|
|
37583
|
+
function sideSegments(room, side) {
|
|
37584
|
+
const segs = [];
|
|
37585
|
+
for (const p of room.parts) {
|
|
37586
|
+
const vertical = side === "west" || side === "east";
|
|
37587
|
+
const along = side === "north" ? p.y : side === "south" ? p.y + p.h : side === "west" ? p.x : p.x + p.w;
|
|
37588
|
+
const lo = vertical ? p.y : p.x;
|
|
37589
|
+
const hi = vertical ? p.y + p.h : p.x + p.w;
|
|
37590
|
+
const cuts = [];
|
|
37591
|
+
for (const q of room.parts) {
|
|
37592
|
+
if (q === p) continue;
|
|
37593
|
+
const qNear = side === "north" ? q.y + q.h : side === "south" ? q.y : side === "west" ? q.x + q.w : q.x;
|
|
37594
|
+
if (Math.abs(qNear - along) >= ADJ_EPS) continue;
|
|
37595
|
+
const cLo = vertical ? Math.max(lo, q.y) : Math.max(lo, q.x);
|
|
37596
|
+
const cHi = vertical ? Math.min(hi, q.y + q.h) : Math.min(hi, q.x + q.w);
|
|
37597
|
+
if (cHi > cLo) cuts.push([cLo, cHi]);
|
|
37598
|
+
}
|
|
37599
|
+
for (const [sLo, sHi] of subtractIntervals(lo, hi, cuts)) {
|
|
37600
|
+
if (sHi - sLo >= MIN_OVERLAP) segs.push({ along, lo: sLo, hi: sHi });
|
|
37601
|
+
}
|
|
37602
|
+
}
|
|
37603
|
+
return segs.sort((a, b) => a.lo - b.lo || a.along - b.along);
|
|
37604
|
+
}
|
|
37605
|
+
function layoutFloorplan(ast) {
|
|
37606
|
+
const u = ast.unit === "ft" ? FT : 1;
|
|
37607
|
+
const errors = [];
|
|
37608
|
+
const warnings = [];
|
|
37609
|
+
const rooms = [];
|
|
37610
|
+
const byId = /* @__PURE__ */ new Map();
|
|
37611
|
+
const stmts = [
|
|
37612
|
+
...ast.rooms.map((room) => ({ line: room.line ?? 0, room })),
|
|
37613
|
+
...ast.extensions.map((ext) => ({ line: ext.line ?? 0, ext }))
|
|
37614
|
+
].sort((a, b) => a.line - b.line);
|
|
37615
|
+
for (const stmt of stmts) {
|
|
37616
|
+
if (stmt.room) {
|
|
37617
|
+
const r6 = stmt.room;
|
|
37618
|
+
const w = r6.w * u;
|
|
37619
|
+
const h = r6.h * u;
|
|
37620
|
+
const pos = resolvePlacement(r6, w, h, byId, rooms, u, `room "${r6.id}"`, errors) ?? { x: 0, y: 0 };
|
|
37621
|
+
const part = { x: pos.x, y: pos.y, w, h };
|
|
37622
|
+
const room = {
|
|
37623
|
+
id: r6.id,
|
|
37624
|
+
label: r6.label,
|
|
37625
|
+
x: part.x,
|
|
37626
|
+
y: part.y,
|
|
37627
|
+
w,
|
|
37628
|
+
h,
|
|
37629
|
+
parts: [part],
|
|
37630
|
+
areaM2: 0,
|
|
37631
|
+
areaText: "",
|
|
37632
|
+
fill: r6.fill,
|
|
37633
|
+
nolabel: r6.nolabel ?? false
|
|
37634
|
+
};
|
|
37635
|
+
refreshRoomBounds(room, ast.unit);
|
|
37636
|
+
byId.set(r6.id, rooms.length);
|
|
37637
|
+
rooms.push(room);
|
|
37638
|
+
} else if (stmt.ext) {
|
|
37639
|
+
const e = stmt.ext;
|
|
37640
|
+
const idx = byId.get(e.room);
|
|
37641
|
+
if (idx === void 0) {
|
|
37642
|
+
errors.push(`extend: unknown room "${e.room}" \u2014 declare it first`);
|
|
37643
|
+
continue;
|
|
37644
|
+
}
|
|
37645
|
+
const room = rooms[idx];
|
|
37646
|
+
const w = e.w * u;
|
|
37647
|
+
const h = e.h * u;
|
|
37648
|
+
const pos = resolvePlacement(e, w, h, byId, rooms, u, `extend "${e.room}"`, errors);
|
|
37649
|
+
if (!pos) continue;
|
|
37650
|
+
const part = { x: pos.x, y: pos.y, w, h };
|
|
37651
|
+
let touches = false;
|
|
37652
|
+
let overlaps = false;
|
|
37653
|
+
for (const p of room.parts) {
|
|
37654
|
+
const { ox, oy } = rectOverlap(p, part);
|
|
37655
|
+
if (ox > ADJ_EPS && oy > ADJ_EPS) overlaps = true;
|
|
37656
|
+
if (rectSharedEdge(p, part)) touches = true;
|
|
37657
|
+
}
|
|
37658
|
+
if (overlaps) {
|
|
37659
|
+
errors.push(`extend "${e.room}": extension overlaps the room's existing area \u2014 place it edge-to-edge`);
|
|
37660
|
+
continue;
|
|
37661
|
+
}
|
|
37662
|
+
if (!touches) {
|
|
37663
|
+
errors.push(`extend "${e.room}": extension does not touch the room \u2014 extensions must share an edge`);
|
|
37664
|
+
continue;
|
|
37665
|
+
}
|
|
37666
|
+
room.parts.push(part);
|
|
37667
|
+
refreshRoomBounds(room, ast.unit);
|
|
37668
|
+
}
|
|
37669
|
+
}
|
|
37670
|
+
for (let i = 0; i < rooms.length; i++) {
|
|
37671
|
+
for (let j = i + 1; j < rooms.length; j++) {
|
|
37672
|
+
const a = rooms[i];
|
|
37673
|
+
const b = rooms[j];
|
|
37674
|
+
let worst = null;
|
|
37675
|
+
for (const pa of a.parts) {
|
|
37676
|
+
for (const pb of b.parts) {
|
|
37677
|
+
const { ox, oy } = rectOverlap(pa, pb);
|
|
37678
|
+
if (ox > ADJ_EPS && oy > ADJ_EPS && (!worst || ox * oy > worst.ox * worst.oy)) {
|
|
37679
|
+
worst = { ox, oy };
|
|
37680
|
+
}
|
|
37681
|
+
}
|
|
37682
|
+
}
|
|
37683
|
+
if (worst) {
|
|
37684
|
+
errors.push(
|
|
37685
|
+
`rooms "${a.id}" and "${b.id}" overlap by ${worst.ox.toFixed(2)}\xD7${worst.oy.toFixed(2)} m \u2014 move "${b.id}" right-of "${a.id}" or shrink size`
|
|
37686
|
+
);
|
|
37687
|
+
}
|
|
37688
|
+
}
|
|
37689
|
+
}
|
|
37690
|
+
const seams = [];
|
|
37691
|
+
for (let ri = 0; ri < rooms.length; ri++) {
|
|
37692
|
+
const parts = rooms[ri].parts;
|
|
37693
|
+
for (let i = 0; i < parts.length; i++) {
|
|
37694
|
+
for (let j = i + 1; j < parts.length; j++) {
|
|
37695
|
+
const e = rectSharedEdge(parts[i], parts[j]);
|
|
37696
|
+
if (e) seams.push({ vertical: e.vertical, along: e.along, lo: e.lo, hi: e.hi, room: ri });
|
|
37697
|
+
}
|
|
37698
|
+
}
|
|
37699
|
+
}
|
|
37700
|
+
const openings = [];
|
|
37701
|
+
for (const op of ast.openings) {
|
|
37702
|
+
const geom = resolveOpening(op, rooms, byId, u, ast.unit, errors, warnings);
|
|
37703
|
+
if (geom) openings.push(geom);
|
|
37704
|
+
}
|
|
37705
|
+
const items = [];
|
|
37706
|
+
const seqByType = /* @__PURE__ */ new Map();
|
|
37707
|
+
const place = (type, roomIdx, localX, localY, w, h, rotate, label) => {
|
|
37708
|
+
const room = rooms[roomIdx];
|
|
37709
|
+
const seq = (seqByType.get(type) ?? 0) + 1;
|
|
37710
|
+
seqByType.set(type, seq);
|
|
37711
|
+
items.push({ type, x: room.x + localX, y: room.y + localY, w, h, rotate, label, roomId: room.id, seq });
|
|
37712
|
+
};
|
|
37713
|
+
const roomIdxOf = (stmt, roomId, line2) => {
|
|
37714
|
+
if (!roomId) {
|
|
37715
|
+
errors.push(`${stmt}${line2 ? ` (line ${line2})` : ""}: missing "in <room>"`);
|
|
37716
|
+
return void 0;
|
|
37717
|
+
}
|
|
37718
|
+
const idx = byId.get(roomId);
|
|
37719
|
+
if (idx === void 0) {
|
|
37720
|
+
errors.push(`${stmt}: unknown room "${roomId}"`);
|
|
37721
|
+
return void 0;
|
|
37722
|
+
}
|
|
37723
|
+
return idx;
|
|
37724
|
+
};
|
|
37725
|
+
for (const f of ast.furniture) {
|
|
37726
|
+
const def = FLOORPLAN_SYMBOLS[f.type];
|
|
37727
|
+
const idx = roomIdxOf(`furniture ${f.type}`, f.room, f.line);
|
|
37728
|
+
if (idx === void 0) continue;
|
|
37729
|
+
const w = f.size ? f.size.w * u : def.w;
|
|
37730
|
+
const h = f.size ? f.size.h * u : def.h;
|
|
37731
|
+
place(f.type, idx, f.x * u, f.y * u, w, h, f.rotate, f.label);
|
|
37732
|
+
}
|
|
37733
|
+
for (const a of ast.arrays) {
|
|
37734
|
+
const def = FLOORPLAN_SYMBOLS[a.type];
|
|
37735
|
+
const idx = roomIdxOf(`${a.mode} ${a.type}`, a.room, a.line);
|
|
37736
|
+
if (idx === void 0) continue;
|
|
37737
|
+
const room = rooms[idx];
|
|
37738
|
+
const iw = a.itemsize ? a.itemsize.w * u : def.w;
|
|
37739
|
+
const ih = a.itemsize ? a.itemsize.h * u : def.h;
|
|
37740
|
+
const p1 = a.p1 ? { x: a.p1.x * u, y: a.p1.y * u } : { x: 0.5 * u, y: 0.5 * u };
|
|
37741
|
+
const p2 = a.p2 ? { x: a.p2.x * u, y: a.p2.y * u } : { x: room.w - 0.5 * u, y: room.h - 0.5 * u };
|
|
37742
|
+
if (a.mode === "grid" || a.mode === "row") {
|
|
37743
|
+
const nRows = a.mode === "row" ? 1 : Math.max(1, Math.round(a.rows));
|
|
37744
|
+
const nCols = Math.max(1, Math.round(a.cols));
|
|
37745
|
+
const cap2 = Number.isFinite(a.count) ? a.count : nRows * nCols;
|
|
37746
|
+
const spanW = p2.x - p1.x;
|
|
37747
|
+
const spanH = p2.y - p1.y;
|
|
37748
|
+
let placed = 0;
|
|
37749
|
+
for (let r6 = 0; r6 < nRows && placed < cap2; r6++) {
|
|
37750
|
+
for (let col = 0; col < nCols && placed < cap2; col++) {
|
|
37751
|
+
const cx = p1.x + (nCols === 1 ? spanW / 2 : col * spanW / (nCols - 1));
|
|
37752
|
+
const cy = p1.y + (nRows === 1 ? spanH / 2 : r6 * spanH / (nRows - 1));
|
|
37753
|
+
place(a.type, idx, cx - iw / 2, cy - ih / 2, iw, ih, a.rotate);
|
|
37754
|
+
placed++;
|
|
37755
|
+
}
|
|
37756
|
+
}
|
|
37757
|
+
} else {
|
|
37758
|
+
const n = Math.max(1, Number.isFinite(a.count) ? a.count : Math.max(1, Math.round(a.cols)));
|
|
37759
|
+
const cen = a.center ? { x: a.center.x * u, y: a.center.y * u } : { x: room.w / 2, y: room.h * 0.6 };
|
|
37760
|
+
const radius = a.radius !== void 0 ? a.radius * u : Math.min(room.w, room.h) / 3;
|
|
37761
|
+
const a0 = (a.fromDeg ?? 200) * Math.PI / 180;
|
|
37762
|
+
const a1 = (a.toDeg ?? 340) * Math.PI / 180;
|
|
37763
|
+
for (let i = 0; i < n; i++) {
|
|
37764
|
+
const th = a0 + (a1 - a0) * i / Math.max(n - 1, 1);
|
|
37765
|
+
const cx = cen.x + radius * Math.cos(th);
|
|
37766
|
+
const cy = cen.y + radius * Math.sin(th);
|
|
37767
|
+
const facing = th * 180 / Math.PI + 270;
|
|
37768
|
+
place(a.type, idx, cx - iw / 2, cy - ih / 2, iw, ih, facing + a.rotate);
|
|
37769
|
+
}
|
|
37770
|
+
}
|
|
37771
|
+
}
|
|
37772
|
+
const roomOf = /* @__PURE__ */ new Map();
|
|
37773
|
+
for (const r6 of rooms) roomOf.set(r6.id, r6);
|
|
37774
|
+
const warnItems = /* @__PURE__ */ new Set();
|
|
37775
|
+
for (const it of items) {
|
|
37776
|
+
const room = roomOf.get(it.roomId);
|
|
37777
|
+
if (!room) continue;
|
|
37778
|
+
const bb = rotatedAabb(it.x, it.y, it.w, it.h, it.rotate, [0, 0, 0, 0]);
|
|
37779
|
+
const over = Math.max(
|
|
37780
|
+
room.x - bb.minX,
|
|
37781
|
+
bb.maxX - (room.x + room.w),
|
|
37782
|
+
room.y - bb.minY,
|
|
37783
|
+
bb.maxY - (room.y + room.h)
|
|
37784
|
+
);
|
|
37785
|
+
if (over > 0.011) {
|
|
37786
|
+
errors.push(
|
|
37787
|
+
`furniture ${it.type} #${it.seq} extends ${fmtNum(over)} m outside room "${it.roomId}" \u2014 move it or shrink size`
|
|
37788
|
+
);
|
|
37789
|
+
continue;
|
|
37790
|
+
}
|
|
37791
|
+
if (room.parts.length > 1) {
|
|
37792
|
+
const bw = bb.maxX - bb.minX;
|
|
37793
|
+
const bh = bb.maxY - bb.minY;
|
|
37794
|
+
let covered = 0;
|
|
37795
|
+
for (const p of room.parts) {
|
|
37796
|
+
const ox = Math.min(p.x + p.w, bb.maxX) - Math.max(p.x, bb.minX);
|
|
37797
|
+
const oy = Math.min(p.y + p.h, bb.maxY) - Math.max(p.y, bb.minY);
|
|
37798
|
+
if (ox > 0 && oy > 0) covered += ox * oy;
|
|
37799
|
+
}
|
|
37800
|
+
const uncovered = bw * bh - covered;
|
|
37801
|
+
if (uncovered > 0.01) {
|
|
37802
|
+
errors.push(
|
|
37803
|
+
`furniture ${it.type} #${it.seq} sits outside room "${it.roomId}"'s L-shape (${fmtNum(uncovered)} m\xB2 past the notch) \u2014 move it onto a room part`
|
|
37804
|
+
);
|
|
37805
|
+
}
|
|
37806
|
+
}
|
|
37807
|
+
}
|
|
37808
|
+
const envelopes = items.map((it) => {
|
|
37809
|
+
const def = FLOORPLAN_SYMBOLS[it.type];
|
|
37810
|
+
return obbCorners(it.x, it.y, it.w, it.h, it.rotate, def.envelope ?? [0, 0, 0, 0]);
|
|
37811
|
+
});
|
|
37812
|
+
for (let i = 0; i < items.length; i++) {
|
|
37813
|
+
const a = items[i];
|
|
37814
|
+
if (FLOORPLAN_SYMBOLS[a.type].underlay) continue;
|
|
37815
|
+
for (let j = i + 1; j < items.length; j++) {
|
|
37816
|
+
const b = items[j];
|
|
37817
|
+
if (FLOORPLAN_SYMBOLS[b.type].underlay) continue;
|
|
37818
|
+
const pen = obbPenetration(envelopes[i], envelopes[j]);
|
|
37819
|
+
if (pen > 0.011) {
|
|
37820
|
+
warnings.push(
|
|
37821
|
+
`${a.type} #${a.seq} overlaps ${b.type} #${b.seq} by ${fmtNum(pen)} m \u2014 increase spacing or reduce cols`
|
|
37822
|
+
);
|
|
37823
|
+
warnItems.add(i);
|
|
37824
|
+
warnItems.add(j);
|
|
37825
|
+
}
|
|
37826
|
+
}
|
|
37827
|
+
}
|
|
37828
|
+
let minX = Infinity;
|
|
37829
|
+
let minY = Infinity;
|
|
37830
|
+
let maxX = -Infinity;
|
|
37831
|
+
let maxY = -Infinity;
|
|
37832
|
+
for (const r6 of rooms) {
|
|
37833
|
+
minX = Math.min(minX, r6.x);
|
|
37834
|
+
minY = Math.min(minY, r6.y);
|
|
37835
|
+
maxX = Math.max(maxX, r6.x + r6.w);
|
|
37836
|
+
maxY = Math.max(maxY, r6.y + r6.h);
|
|
37837
|
+
}
|
|
37838
|
+
if (rooms.length === 0) {
|
|
37839
|
+
minX = minY = 0;
|
|
37840
|
+
maxX = maxY = 1;
|
|
37841
|
+
errors.push('no rooms defined \u2014 declare at least one: room id "Label" at 0,0 size 4x3');
|
|
37842
|
+
}
|
|
37843
|
+
const dims = [];
|
|
37844
|
+
if (rooms.length > 0) {
|
|
37845
|
+
dims.push({
|
|
37846
|
+
vertical: false,
|
|
37847
|
+
at: minY - FLOORPLAN_CONST.dimMajorOff,
|
|
37848
|
+
lo: minX,
|
|
37849
|
+
hi: maxX,
|
|
37850
|
+
label: formatLength(maxX - minX, ast.unit),
|
|
37851
|
+
minor: false
|
|
37852
|
+
});
|
|
37853
|
+
dims.push({
|
|
37854
|
+
vertical: true,
|
|
37855
|
+
at: minX - FLOORPLAN_CONST.dimMajorOff,
|
|
37856
|
+
lo: minY,
|
|
37857
|
+
hi: maxY,
|
|
37858
|
+
label: formatLength(maxY - minY, ast.unit),
|
|
37859
|
+
minor: false
|
|
37860
|
+
});
|
|
37861
|
+
const topSegs = [];
|
|
37862
|
+
for (const r6 of rooms) {
|
|
37863
|
+
for (const sg of sideSegments(r6, "north")) {
|
|
37864
|
+
if (Math.abs(sg.along - minY) < 0.01) topSegs.push({ lo: sg.lo, hi: sg.hi });
|
|
37865
|
+
}
|
|
37866
|
+
}
|
|
37867
|
+
if (topSegs.length > 1) {
|
|
37868
|
+
for (const sg of topSegs.sort((a, b) => a.lo - b.lo)) {
|
|
37869
|
+
dims.push({
|
|
37870
|
+
vertical: false,
|
|
37871
|
+
at: minY - FLOORPLAN_CONST.dimMinorOff,
|
|
37872
|
+
lo: sg.lo,
|
|
37873
|
+
hi: sg.hi,
|
|
37874
|
+
label: formatLength(sg.hi - sg.lo, ast.unit),
|
|
37875
|
+
minor: true
|
|
37876
|
+
});
|
|
37877
|
+
}
|
|
37878
|
+
}
|
|
37879
|
+
const leftSegs = [];
|
|
37880
|
+
for (const r6 of rooms) {
|
|
37881
|
+
for (const sg of sideSegments(r6, "west")) {
|
|
37882
|
+
if (Math.abs(sg.along - minX) < 0.01) leftSegs.push({ lo: sg.lo, hi: sg.hi });
|
|
37883
|
+
}
|
|
37884
|
+
}
|
|
37885
|
+
if (leftSegs.length > 1) {
|
|
37886
|
+
for (const sg of leftSegs.sort((a, b) => a.lo - b.lo)) {
|
|
37887
|
+
dims.push({
|
|
37888
|
+
vertical: true,
|
|
37889
|
+
at: minX - FLOORPLAN_CONST.dimMinorOff,
|
|
37890
|
+
lo: sg.lo,
|
|
37891
|
+
hi: sg.hi,
|
|
37892
|
+
label: formatLength(sg.hi - sg.lo, ast.unit),
|
|
37893
|
+
minor: true
|
|
37894
|
+
});
|
|
37895
|
+
}
|
|
37896
|
+
}
|
|
37897
|
+
}
|
|
37898
|
+
return {
|
|
37899
|
+
title: ast.title,
|
|
37900
|
+
unit: ast.unit,
|
|
37901
|
+
north: ast.north,
|
|
37902
|
+
rooms,
|
|
37903
|
+
seams,
|
|
37904
|
+
openings,
|
|
37905
|
+
items,
|
|
37906
|
+
dims,
|
|
37907
|
+
bounds: { minX, minY, maxX, maxY },
|
|
37908
|
+
wallT: FLOORPLAN_CONST.wallT,
|
|
37909
|
+
totalAreaM2: rooms.reduce((s, r6) => s + r6.areaM2, 0),
|
|
37910
|
+
errors,
|
|
37911
|
+
warnings,
|
|
37912
|
+
warnItems: [...warnItems]
|
|
37913
|
+
};
|
|
37914
|
+
}
|
|
37915
|
+
function resolveOpening(op, rooms, byId, u, unit, errors, warnings) {
|
|
37916
|
+
let seg = null;
|
|
37917
|
+
let owner = -1;
|
|
37918
|
+
let negRoom;
|
|
37919
|
+
let posRoom;
|
|
37920
|
+
let inward = 1;
|
|
37921
|
+
if (op.between) {
|
|
37922
|
+
const ia = byId.get(op.between[0]);
|
|
37923
|
+
const ib = byId.get(op.between[1]);
|
|
37924
|
+
if (ia === void 0 || ib === void 0) {
|
|
37925
|
+
errors.push(`${op.kind}: unknown room "${ia === void 0 ? op.between[0] : op.between[1]}"`);
|
|
37926
|
+
return null;
|
|
37927
|
+
}
|
|
37928
|
+
const a = rooms[ia];
|
|
37929
|
+
const b = rooms[ib];
|
|
37930
|
+
const found = roomSharedEdge(a, b);
|
|
37931
|
+
if (!found) {
|
|
37932
|
+
const gapX = Math.max(a.x, b.x) - Math.min(a.x + a.w, b.x + b.w);
|
|
37933
|
+
const gapY = Math.max(a.y, b.y) - Math.min(a.y + a.h, b.y + b.h);
|
|
37934
|
+
const axis = gapX >= gapY ? "x" : "y";
|
|
37935
|
+
const gap = Math.max(gapX, gapY);
|
|
37936
|
+
errors.push(
|
|
37937
|
+
gap > 0 ? `${op.kind} between "${a.id}" and "${b.id}": rooms share no wall (gap ${fmtNum(gap)} m on ${axis}-axis)` : `${op.kind} between "${a.id}" and "${b.id}": rooms share no wall`
|
|
37938
|
+
);
|
|
37939
|
+
return null;
|
|
37940
|
+
}
|
|
37941
|
+
seg = found.edge;
|
|
37942
|
+
owner = ia;
|
|
37943
|
+
if (seg.vertical) {
|
|
37944
|
+
const aIsNeg = found.aPart.x + found.aPart.w / 2 < seg.along;
|
|
37945
|
+
negRoom = aIsNeg ? ia : ib;
|
|
37946
|
+
posRoom = aIsNeg ? ib : ia;
|
|
37947
|
+
inward = aIsNeg ? -1 : 1;
|
|
37948
|
+
} else {
|
|
37949
|
+
const aIsNeg = found.aPart.y + found.aPart.h / 2 < seg.along;
|
|
37950
|
+
negRoom = aIsNeg ? ia : ib;
|
|
37951
|
+
posRoom = aIsNeg ? ib : ia;
|
|
37952
|
+
inward = aIsNeg ? -1 : 1;
|
|
37953
|
+
}
|
|
37954
|
+
} else {
|
|
37955
|
+
const idx = byId.get(op.room);
|
|
37956
|
+
if (idx === void 0) {
|
|
37957
|
+
errors.push(`${op.kind}: unknown room "${op.room}"`);
|
|
37958
|
+
return null;
|
|
37959
|
+
}
|
|
37960
|
+
owner = idx;
|
|
37961
|
+
const r6 = rooms[idx];
|
|
37962
|
+
const side = op.side;
|
|
37963
|
+
const segs = sideSegments(r6, side);
|
|
37964
|
+
if (segs.length === 0) {
|
|
37965
|
+
errors.push(`${op.kind} on "${r6.id}" ${side}: that side has no exterior wall segment`);
|
|
37966
|
+
return null;
|
|
37967
|
+
}
|
|
37968
|
+
const total = segs.reduce((s, sg) => s + (sg.hi - sg.lo), 0);
|
|
37969
|
+
const pct2 = Math.min(100, Math.max(0, op.pct));
|
|
37970
|
+
let target = total * pct2 / 100;
|
|
37971
|
+
let chosen = segs[segs.length - 1];
|
|
37972
|
+
for (const sg of segs) {
|
|
37973
|
+
const len = sg.hi - sg.lo;
|
|
37974
|
+
if (target <= len) {
|
|
37975
|
+
chosen = sg;
|
|
37976
|
+
break;
|
|
37977
|
+
}
|
|
37978
|
+
target -= len;
|
|
37979
|
+
}
|
|
37980
|
+
const within = Math.min(1, Math.max(0, target / (chosen.hi - chosen.lo)));
|
|
37981
|
+
op = { ...op, pct: within * 100 };
|
|
37982
|
+
seg = { vertical: side === "west" || side === "east", along: chosen.along, lo: chosen.lo, hi: chosen.hi };
|
|
37983
|
+
switch (side) {
|
|
37984
|
+
case "north":
|
|
37985
|
+
inward = 1;
|
|
37986
|
+
posRoom = idx;
|
|
37987
|
+
break;
|
|
37988
|
+
case "south":
|
|
37989
|
+
inward = -1;
|
|
37990
|
+
negRoom = idx;
|
|
37991
|
+
break;
|
|
37992
|
+
case "west":
|
|
37993
|
+
inward = 1;
|
|
37994
|
+
posRoom = idx;
|
|
37995
|
+
break;
|
|
37996
|
+
case "east":
|
|
37997
|
+
inward = -1;
|
|
37998
|
+
negRoom = idx;
|
|
37999
|
+
break;
|
|
38000
|
+
}
|
|
38001
|
+
}
|
|
38002
|
+
const jamb = FLOORPLAN_CONST.jamb;
|
|
38003
|
+
const segLen = seg.hi - seg.lo;
|
|
38004
|
+
const avail = segLen - 2 * jamb;
|
|
38005
|
+
let wd = op.width * u;
|
|
38006
|
+
if (wd > avail) {
|
|
38007
|
+
warnings.push(
|
|
38008
|
+
`${op.kind}${op.room ? ` on "${op.room}" ${op.side}` : op.between ? ` between "${op.between[0]}" and "${op.between[1]}"` : ""}: width ${formatLength(wd, unit)} clamped to ${formatLength(avail, unit)} to fit the wall segment`
|
|
38009
|
+
);
|
|
38010
|
+
wd = avail;
|
|
38011
|
+
}
|
|
38012
|
+
const pct = Math.min(100, Math.max(0, op.pct));
|
|
38013
|
+
const c = seg.lo + segLen * pct / 100;
|
|
38014
|
+
const lo = Math.max(seg.lo + jamb, Math.min(c - wd / 2, seg.hi - jamb - wd));
|
|
38015
|
+
const hi = lo + wd;
|
|
38016
|
+
const arcDir = op.kind === "door" && op.swing === "out" ? inward === 1 ? -1 : 1 : inward;
|
|
38017
|
+
return {
|
|
38018
|
+
kind: op.kind,
|
|
38019
|
+
doorType: op.doorType,
|
|
38020
|
+
windowType: op.windowType,
|
|
38021
|
+
vertical: seg.vertical,
|
|
38022
|
+
along: seg.along,
|
|
38023
|
+
lo,
|
|
38024
|
+
hi,
|
|
38025
|
+
inward: arcDir,
|
|
38026
|
+
hinge: op.hinge,
|
|
38027
|
+
negRoom,
|
|
38028
|
+
posRoom,
|
|
38029
|
+
owner
|
|
38030
|
+
};
|
|
38031
|
+
}
|
|
38032
|
+
|
|
38033
|
+
// src/diagrams/floorplan/renderer.ts
|
|
38034
|
+
var r24 = (n) => Math.round(n * 100) / 100;
|
|
38035
|
+
function buildCss13(t) {
|
|
38036
|
+
return `
|
|
38037
|
+
.sx-fp { font-family: ${chunkCAAMBDEN_cjs.DEFAULT_FONT_FAMILY}; }
|
|
38038
|
+
.sx-fp-title { font: ${chunkCAAMBDEN_cjs.TITLE.weight} ${chunkCAAMBDEN_cjs.TITLE.size}px sans-serif; fill: ${t.text}; }
|
|
38039
|
+
.sx-fp-wall { fill: ${t.wallFill}; stroke: none; }
|
|
38040
|
+
.sx-fp-furn { fill: ${t.furnFill}; stroke: ${t.furnStroke}; stroke-width: 1.2; }
|
|
38041
|
+
.sx-fp-furn-nofill { fill: none; stroke: ${t.furnStroke}; stroke-width: 1.2; }
|
|
38042
|
+
.sx-fp-furn-line { fill: none; stroke: ${t.furnStroke}; stroke-width: 1; }
|
|
38043
|
+
.sx-fp-furn-dash { fill: none; stroke: ${t.furnStroke}; stroke-width: 1; stroke-dasharray: 4 3; }
|
|
38044
|
+
.sx-fp-furn-dot { fill: ${t.furnStroke}; stroke: none; }
|
|
38045
|
+
.sx-fp-furn-solid { fill: ${t.furnSolid}; stroke: none; }
|
|
38046
|
+
.sx-fp-board-inner { fill: ${t.boardInner}; stroke: none; }
|
|
38047
|
+
.sx-fp-chair { fill: ${t.chairFill}; stroke: ${t.furnStroke}; stroke-width: 1; }
|
|
38048
|
+
.sx-fp-rug { fill: none; stroke: ${t.rugStroke}; stroke-width: 1.2; stroke-dasharray: 5 4; }
|
|
38049
|
+
.sx-fp-hatch { fill: none; stroke: ${t.hatchStroke}; stroke-width: 1; }
|
|
38050
|
+
.sx-fp-furn-text { font-weight: 600; font-family: sans-serif; fill: ${t.furnLabel}; paint-order: stroke; stroke: ${t.floorFill}; stroke-width: 2.5px; stroke-linejoin: round; }
|
|
38051
|
+
.sx-fp-furn-label { font: 11px sans-serif; fill: ${t.furnLabel}; paint-order: stroke; stroke: ${t.floorFill}; stroke-width: 3px; stroke-linejoin: round; }
|
|
38052
|
+
.sx-fp-door-leaf { fill: none; stroke: ${t.doorLeaf}; stroke-width: 1.6; }
|
|
38053
|
+
.sx-fp-door-arc { fill: none; stroke: ${t.doorArc}; stroke-width: 1; }
|
|
38054
|
+
.sx-fp-window { fill: none; stroke: ${t.windowStroke}; stroke-width: 1.3; }
|
|
38055
|
+
.sx-fp-jamb { fill: none; stroke: ${t.furnStroke}; stroke-width: 1.2; }
|
|
38056
|
+
.sx-fp-room-name { font: 600 13.5px sans-serif; fill: ${t.roomName}; paint-order: stroke; stroke: ${t.floorFill}; stroke-width: 3px; stroke-linejoin: round; }
|
|
38057
|
+
.sx-fp-room-area { font: 11px sans-serif; fill: ${t.roomArea}; paint-order: stroke; stroke: ${t.floorFill}; stroke-width: 3px; stroke-linejoin: round; }
|
|
38058
|
+
.sx-fp-stair-break { fill: none; stroke: ${t.furnStroke}; stroke-width: 1.6; }
|
|
38059
|
+
.sx-fp-compass { fill: none; stroke: ${t.dimStroke}; stroke-width: 1.2; }
|
|
38060
|
+
.sx-fp-compass-n { font: 700 11px sans-serif; fill: ${t.dimText}; }
|
|
38061
|
+
.sx-fp-dim { fill: none; stroke: ${t.dimStroke}; stroke-width: 1; }
|
|
38062
|
+
.sx-fp-dim-text { font: 10.5px sans-serif; fill: ${t.dimText}; }
|
|
38063
|
+
.sx-fp-dim-text-minor { font: 9px sans-serif; fill: ${t.dimText}; }
|
|
38064
|
+
.sx-fp-warn-item { fill: none; stroke: ${t.negative}; stroke-width: 1.5; stroke-dasharray: 4 3; }
|
|
38065
|
+
.sx-fp-warn { font: 11px ui-monospace, Menlo, monospace; fill: ${t.warn}; }
|
|
38066
|
+
.sx-fp-error-box { fill: ${t.bg}; stroke: ${t.negative}; stroke-width: 1.5; }
|
|
38067
|
+
.sx-fp-error-title { font: 700 13px ui-monospace, Menlo, monospace; fill: ${t.negative}; }
|
|
38068
|
+
.sx-fp-error-line { font: 12px ui-monospace, Menlo, monospace; fill: ${t.negative}; }
|
|
38069
|
+
`.trim();
|
|
38070
|
+
}
|
|
38071
|
+
function renderErrorPanel(lay, t) {
|
|
38072
|
+
const lines = lay.errors;
|
|
38073
|
+
const w = Math.max(560, ...lines.map((l) => l.length * 6.6 + 48));
|
|
38074
|
+
const h = 56 + lines.length * 19;
|
|
38075
|
+
return chunk3WNW5Y7P_cjs.svgRoot(
|
|
38076
|
+
{ viewBox: `0 0 ${r24(w)} ${h}`, class: "sx-fp", role: "img" },
|
|
38077
|
+
[
|
|
38078
|
+
chunk3WNW5Y7P_cjs.title(lay.title),
|
|
38079
|
+
chunk3WNW5Y7P_cjs.desc(`Floor plan validation failed with ${lines.length} error${lines.length === 1 ? "" : "s"}.`),
|
|
38080
|
+
chunk3WNW5Y7P_cjs.el("style", {}, buildCss13(t)),
|
|
38081
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-error-box", x: 1, y: 1, width: r24(w - 2), height: h - 2, rx: 6 }),
|
|
38082
|
+
chunk3WNW5Y7P_cjs.text({ class: "sx-fp-error-title", x: 16, y: 26 }, `floorplan: ${lines.length} validation error${lines.length === 1 ? "" : "s"}`),
|
|
38083
|
+
...lines.map((e, i) => chunk3WNW5Y7P_cjs.text({ class: "sx-fp-error-line", x: 16, y: 50 + i * 19 }, `\u26A0 ${e}`))
|
|
38084
|
+
]
|
|
38085
|
+
);
|
|
38086
|
+
}
|
|
38087
|
+
function gapFill(lay, t, roomIdx) {
|
|
38088
|
+
if (roomIdx === void 0) return t.bg;
|
|
38089
|
+
return lay.rooms[roomIdx]?.fill ?? t.floorFill;
|
|
38090
|
+
}
|
|
38091
|
+
function punchGap(o, lay, c) {
|
|
38092
|
+
const tpx = c.px(c.wallT);
|
|
38093
|
+
const negFill = gapFill(lay, c.t, o.negRoom);
|
|
38094
|
+
const posFill = gapFill(lay, c.t, o.posRoom);
|
|
38095
|
+
if (o.vertical) {
|
|
38096
|
+
const x2 = c.X(o.along);
|
|
38097
|
+
const y2 = c.Y(o.lo);
|
|
38098
|
+
const h = c.px(o.hi - o.lo);
|
|
38099
|
+
return chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-gap", fill: negFill, x: r24(x2 - tpx / 2 - 0.5), y: y2, width: r24(tpx / 2 + 0.5), height: h }) + chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-gap", fill: posFill, x: x2, y: y2, width: r24(tpx / 2 + 0.5), height: h });
|
|
38100
|
+
}
|
|
38101
|
+
const y = c.Y(o.along);
|
|
38102
|
+
const x = c.X(o.lo);
|
|
38103
|
+
const w = c.px(o.hi - o.lo);
|
|
38104
|
+
return chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-gap", fill: negFill, x, y: r24(y - tpx / 2 - 0.5), width: w, height: r24(tpx / 2 + 0.5) }) + chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-gap", fill: posFill, x, y, width: w, height: r24(tpx / 2 + 0.5) });
|
|
38105
|
+
}
|
|
38106
|
+
function windowSymbol(o, c) {
|
|
38107
|
+
const tpx = c.px(c.wallT);
|
|
38108
|
+
const parts = [];
|
|
38109
|
+
const outward = o.inward === 1 ? -1 : 1;
|
|
38110
|
+
if (o.vertical) {
|
|
38111
|
+
const x = c.X(o.along);
|
|
38112
|
+
const mid = c.Y((o.lo + o.hi) / 2);
|
|
38113
|
+
if (o.windowType === "sliding") {
|
|
38114
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-window", x1: r24(x - tpx * 0.22), y1: c.Y(o.lo), x2: r24(x - tpx * 0.22), y2: mid }));
|
|
38115
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-window", x1: r24(x + tpx * 0.22), y1: mid, x2: r24(x + tpx * 0.22), y2: c.Y(o.hi) }));
|
|
38116
|
+
} else {
|
|
38117
|
+
for (const k of [-1, 0, 1]) {
|
|
38118
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-window", x1: r24(x + k * tpx * 0.38), y1: c.Y(o.lo), x2: r24(x + k * tpx * 0.38), y2: c.Y(o.hi) }));
|
|
38119
|
+
}
|
|
38120
|
+
}
|
|
38121
|
+
for (const yy of [o.lo, o.hi]) {
|
|
38122
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-window", x1: r24(x - tpx / 2), y1: c.Y(yy), x2: r24(x + tpx / 2), y2: c.Y(yy) }));
|
|
38123
|
+
}
|
|
38124
|
+
if (o.windowType === "casement") {
|
|
38125
|
+
const wd = c.px(o.hi - o.lo);
|
|
38126
|
+
const leafX = r24(x + outward * wd);
|
|
38127
|
+
const sweep = outward === 1 ? 1 : 0;
|
|
38128
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-door-leaf", x1: x, y1: c.Y(o.lo), x2: leafX, y2: c.Y(o.lo) }));
|
|
38129
|
+
parts.push(chunk3WNW5Y7P_cjs.path({ class: "sx-fp-door-arc", d: `M ${leafX} ${c.Y(o.lo)} A ${wd} ${wd} 0 0 ${sweep} ${x} ${r24(c.Y(o.lo) + wd)}` }));
|
|
38130
|
+
}
|
|
38131
|
+
if (o.windowType === "bay") {
|
|
38132
|
+
const proj = c.px(0.45) * outward;
|
|
38133
|
+
const splay = c.px(0.3);
|
|
38134
|
+
const x0 = r24(x + outward * tpx / 2);
|
|
38135
|
+
parts.push(
|
|
38136
|
+
chunk3WNW5Y7P_cjs.path({
|
|
38137
|
+
class: "sx-fp-window",
|
|
38138
|
+
d: `M ${x0} ${c.Y(o.lo)} L ${r24(x0 + proj)} ${r24(c.Y(o.lo) + splay)} L ${r24(x0 + proj)} ${r24(c.Y(o.hi) - splay)} L ${x0} ${c.Y(o.hi)}`
|
|
38139
|
+
})
|
|
38140
|
+
);
|
|
38141
|
+
}
|
|
38142
|
+
} else {
|
|
38143
|
+
const y = c.Y(o.along);
|
|
38144
|
+
const mid = c.X((o.lo + o.hi) / 2);
|
|
38145
|
+
if (o.windowType === "sliding") {
|
|
38146
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-window", x1: c.X(o.lo), y1: r24(y - tpx * 0.22), x2: mid, y2: r24(y - tpx * 0.22) }));
|
|
38147
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-window", x1: mid, y1: r24(y + tpx * 0.22), x2: c.X(o.hi), y2: r24(y + tpx * 0.22) }));
|
|
38148
|
+
} else {
|
|
38149
|
+
for (const k of [-1, 0, 1]) {
|
|
38150
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-window", x1: c.X(o.lo), y1: r24(y + k * tpx * 0.38), x2: c.X(o.hi), y2: r24(y + k * tpx * 0.38) }));
|
|
38151
|
+
}
|
|
38152
|
+
}
|
|
38153
|
+
for (const xx of [o.lo, o.hi]) {
|
|
38154
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-window", x1: c.X(xx), y1: r24(y - tpx / 2), x2: c.X(xx), y2: r24(y + tpx / 2) }));
|
|
38155
|
+
}
|
|
38156
|
+
if (o.windowType === "casement") {
|
|
38157
|
+
const wd = c.px(o.hi - o.lo);
|
|
38158
|
+
const leafY = r24(y + outward * wd);
|
|
38159
|
+
const sweep = outward === 1 ? 0 : 1;
|
|
38160
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-door-leaf", x1: c.X(o.lo), y1: y, x2: c.X(o.lo), y2: leafY }));
|
|
38161
|
+
parts.push(chunk3WNW5Y7P_cjs.path({ class: "sx-fp-door-arc", d: `M ${c.X(o.lo)} ${leafY} A ${wd} ${wd} 0 0 ${sweep} ${r24(c.X(o.lo) + wd)} ${y}` }));
|
|
38162
|
+
}
|
|
38163
|
+
if (o.windowType === "bay") {
|
|
38164
|
+
const proj = c.px(0.45) * outward;
|
|
38165
|
+
const splay = c.px(0.3);
|
|
38166
|
+
const y0 = r24(y + outward * tpx / 2);
|
|
38167
|
+
parts.push(
|
|
38168
|
+
chunk3WNW5Y7P_cjs.path({
|
|
38169
|
+
class: "sx-fp-window",
|
|
38170
|
+
d: `M ${c.X(o.lo)} ${y0} L ${r24(c.X(o.lo) + splay)} ${r24(y0 + proj)} L ${r24(c.X(o.hi) - splay)} ${r24(y0 + proj)} L ${c.X(o.hi)} ${y0}`
|
|
38171
|
+
})
|
|
38172
|
+
);
|
|
38173
|
+
}
|
|
38174
|
+
}
|
|
38175
|
+
return parts.join("");
|
|
38176
|
+
}
|
|
38177
|
+
function jambLines(o, c) {
|
|
38178
|
+
const tpx = c.px(c.wallT);
|
|
38179
|
+
if (o.vertical) {
|
|
38180
|
+
const x = c.X(o.along);
|
|
38181
|
+
return [o.lo, o.hi].map((yy) => chunk3WNW5Y7P_cjs.line({ class: "sx-fp-jamb", x1: r24(x - tpx / 2), y1: c.Y(yy), x2: r24(x + tpx / 2), y2: c.Y(yy) })).join("");
|
|
38182
|
+
}
|
|
38183
|
+
const y = c.Y(o.along);
|
|
38184
|
+
return [o.lo, o.hi].map((xx) => chunk3WNW5Y7P_cjs.line({ class: "sx-fp-jamb", x1: c.X(xx), y1: r24(y - tpx / 2), x2: c.X(xx), y2: r24(y + tpx / 2) })).join("");
|
|
38185
|
+
}
|
|
38186
|
+
function swingLeaf(o, c, hingeAtLo, widthM) {
|
|
38187
|
+
const dir = o.inward;
|
|
38188
|
+
const rpx = c.px(widthM);
|
|
38189
|
+
if (o.vertical) {
|
|
38190
|
+
const x = c.X(o.along);
|
|
38191
|
+
const hy = hingeAtLo ? c.Y(o.lo) : c.Y(o.hi);
|
|
38192
|
+
const sy = hingeAtLo ? 1 : -1;
|
|
38193
|
+
const leafX = r24(x + dir * rpx);
|
|
38194
|
+
const sweep2 = dir === 1 === hingeAtLo ? 1 : 0;
|
|
38195
|
+
return chunk3WNW5Y7P_cjs.line({ class: "sx-fp-door-leaf", x1: x, y1: hy, x2: leafX, y2: hy }) + chunk3WNW5Y7P_cjs.path({ class: "sx-fp-door-arc", d: `M ${leafX} ${hy} A ${rpx} ${rpx} 0 0 ${sweep2} ${x} ${r24(hy + sy * rpx)}` });
|
|
38196
|
+
}
|
|
38197
|
+
const y = c.Y(o.along);
|
|
38198
|
+
const hx = hingeAtLo ? c.X(o.lo) : c.X(o.hi);
|
|
38199
|
+
const sx = hingeAtLo ? 1 : -1;
|
|
38200
|
+
const leafY = r24(y + dir * rpx);
|
|
38201
|
+
const sweep = dir === 1 !== hingeAtLo ? 1 : 0;
|
|
38202
|
+
return chunk3WNW5Y7P_cjs.line({ class: "sx-fp-door-leaf", x1: hx, y1: y, x2: hx, y2: leafY }) + chunk3WNW5Y7P_cjs.path({ class: "sx-fp-door-arc", d: `M ${hx} ${leafY} A ${rpx} ${rpx} 0 0 ${sweep} ${r24(hx + sx * rpx)} ${y}` });
|
|
38203
|
+
}
|
|
38204
|
+
function doorSymbol(o, c) {
|
|
38205
|
+
const wd = o.hi - o.lo;
|
|
38206
|
+
if (o.doorType === "double") {
|
|
38207
|
+
const half = { ...o };
|
|
38208
|
+
const mid = (o.lo + o.hi) / 2;
|
|
38209
|
+
const left = { ...half, hi: mid };
|
|
38210
|
+
const right = { ...half, lo: mid };
|
|
38211
|
+
return jambLines(o, c) + swingLeaf(left, c, true, wd / 2) + swingLeaf(right, c, false, wd / 2);
|
|
38212
|
+
}
|
|
38213
|
+
if (o.doorType === "bifold") {
|
|
38214
|
+
const peak = c.px((o.hi - o.lo) * 0.22) * o.inward;
|
|
38215
|
+
const q1 = o.lo + (o.hi - o.lo) * 0.25;
|
|
38216
|
+
const mid = (o.lo + o.hi) / 2;
|
|
38217
|
+
const q3 = o.lo + (o.hi - o.lo) * 0.75;
|
|
38218
|
+
const parts = [jambLines(o, c)];
|
|
38219
|
+
if (o.vertical) {
|
|
38220
|
+
const x = c.X(o.along);
|
|
38221
|
+
parts.push(
|
|
38222
|
+
chunk3WNW5Y7P_cjs.path({
|
|
38223
|
+
class: "sx-fp-door-leaf",
|
|
38224
|
+
d: `M ${x} ${c.Y(o.lo)} L ${r24(x + peak)} ${c.Y(q1)} L ${x} ${c.Y(mid)} L ${r24(x + peak)} ${c.Y(q3)} L ${x} ${c.Y(o.hi)}`
|
|
38225
|
+
})
|
|
38226
|
+
);
|
|
38227
|
+
} else {
|
|
38228
|
+
const y = c.Y(o.along);
|
|
38229
|
+
parts.push(
|
|
38230
|
+
chunk3WNW5Y7P_cjs.path({
|
|
38231
|
+
class: "sx-fp-door-leaf",
|
|
38232
|
+
d: `M ${c.X(o.lo)} ${y} L ${c.X(q1)} ${r24(y + peak)} L ${c.X(mid)} ${y} L ${c.X(q3)} ${r24(y + peak)} L ${c.X(o.hi)} ${y}`
|
|
38233
|
+
})
|
|
38234
|
+
);
|
|
38235
|
+
}
|
|
38236
|
+
return parts.join("");
|
|
38237
|
+
}
|
|
38238
|
+
if (o.doorType === "sliding" || o.doorType === "pocket") {
|
|
38239
|
+
const off = c.px(c.wallT) * 0.28;
|
|
38240
|
+
const mid = (o.lo + o.hi) / 2;
|
|
38241
|
+
const parts = [jambLines(o, c)];
|
|
38242
|
+
if (o.vertical) {
|
|
38243
|
+
const x = c.X(o.along);
|
|
38244
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-door-leaf", x1: r24(x - off), y1: c.Y(o.lo), x2: r24(x - off), y2: c.Y(mid) }));
|
|
38245
|
+
if (o.doorType === "sliding") {
|
|
38246
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-door-leaf", x1: r24(x + off), y1: c.Y(mid), x2: r24(x + off), y2: c.Y(o.hi) }));
|
|
38247
|
+
}
|
|
38248
|
+
} else {
|
|
38249
|
+
const y = c.Y(o.along);
|
|
38250
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-door-leaf", x1: c.X(o.lo), y1: r24(y - off), x2: c.X(mid), y2: r24(y - off) }));
|
|
38251
|
+
if (o.doorType === "sliding") {
|
|
38252
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-fp-door-leaf", x1: c.X(mid), y1: r24(y + off), x2: c.X(o.hi), y2: r24(y + off) }));
|
|
38253
|
+
}
|
|
38254
|
+
}
|
|
38255
|
+
return parts.join("");
|
|
38256
|
+
}
|
|
38257
|
+
return jambLines(o, c) + swingLeaf(o, c, o.hinge !== "right", wd);
|
|
38258
|
+
}
|
|
38259
|
+
function renderDim(d, c) {
|
|
38260
|
+
const cls = d.minor ? "sx-fp-dim-text-minor" : "sx-fp-dim-text";
|
|
38261
|
+
const tick = 3.6;
|
|
38262
|
+
if (!d.vertical) {
|
|
38263
|
+
const y = c.Y(d.at);
|
|
38264
|
+
const x1 = c.X(d.lo);
|
|
38265
|
+
const x2 = c.X(d.hi);
|
|
38266
|
+
return chunk3WNW5Y7P_cjs.line({ class: "sx-fp-dim", x1, y1: y, x2, y2: y }) + chunk3WNW5Y7P_cjs.line({ class: "sx-fp-dim", x1: r24(x1 - tick), y1: r24(y + tick), x2: r24(x1 + tick), y2: r24(y - tick) }) + chunk3WNW5Y7P_cjs.line({ class: "sx-fp-dim", x1: r24(x2 - tick), y1: r24(y + tick), x2: r24(x2 + tick), y2: r24(y - tick) }) + chunk3WNW5Y7P_cjs.text({ class: cls, x: r24((x1 + x2) / 2), y: r24(y - 4), "text-anchor": "middle" }, d.label);
|
|
38267
|
+
}
|
|
38268
|
+
const x = c.X(d.at);
|
|
38269
|
+
const y1 = c.Y(d.lo);
|
|
38270
|
+
const y2 = c.Y(d.hi);
|
|
38271
|
+
const mid = r24((y1 + y2) / 2);
|
|
38272
|
+
return chunk3WNW5Y7P_cjs.line({ class: "sx-fp-dim", x1: x, y1, x2: x, y2 }) + chunk3WNW5Y7P_cjs.line({ class: "sx-fp-dim", x1: r24(x - tick), y1: r24(y1 + tick), x2: r24(x + tick), y2: r24(y1 - tick) }) + chunk3WNW5Y7P_cjs.line({ class: "sx-fp-dim", x1: r24(x - tick), y1: r24(y2 + tick), x2: r24(x + tick), y2: r24(y2 - tick) }) + chunk3WNW5Y7P_cjs.text(
|
|
38273
|
+
{ class: cls, x: r24(x - 5), y: mid, "text-anchor": "middle", transform: `rotate(-90 ${r24(x - 5)} ${mid})` },
|
|
38274
|
+
d.label
|
|
38275
|
+
);
|
|
38276
|
+
}
|
|
38277
|
+
function renderFloorplanLayout(lay, config) {
|
|
38278
|
+
const t = chunkCAAMBDEN_cjs.resolveFloorplanTheme(config?.theme ?? "default");
|
|
38279
|
+
if (lay.errors.length > 0) return renderErrorPanel(lay, t);
|
|
38280
|
+
const scale = FLOORPLAN_CONST.scale;
|
|
38281
|
+
const px = (m) => r24(m * scale);
|
|
38282
|
+
const band = FLOORPLAN_CONST.dimBand + FLOORPLAN_CONST.pad;
|
|
38283
|
+
let outward = 0;
|
|
38284
|
+
for (const o of lay.openings) {
|
|
38285
|
+
if (o.kind !== "window") continue;
|
|
38286
|
+
if (o.windowType === "casement") outward = Math.max(outward, o.hi - o.lo + 0.1);
|
|
38287
|
+
if (o.windowType === "bay") outward = Math.max(outward, 0.6);
|
|
38288
|
+
}
|
|
38289
|
+
const tail = FLOORPLAN_CONST.pad + lay.wallT + outward;
|
|
38290
|
+
const ox = -lay.bounds.minX + band;
|
|
38291
|
+
const oy = -lay.bounds.minY + band;
|
|
38292
|
+
const X = (m) => px(m + ox);
|
|
38293
|
+
const Y = (m) => px(m + oy);
|
|
38294
|
+
const ctx = { X, Y, px, t, wallT: lay.wallT };
|
|
38295
|
+
const titleH = chunkCAAMBDEN_cjs.TITLE.bandH;
|
|
38296
|
+
const warnH = lay.warnings.length ? lay.warnings.length * 17 + 10 : 0;
|
|
38297
|
+
const W2 = px(lay.bounds.maxX - lay.bounds.minX + band + tail);
|
|
38298
|
+
const H2 = px(lay.bounds.maxY - lay.bounds.minY + band + tail) + titleH + warnH;
|
|
38299
|
+
const titleX = r24(X((lay.bounds.minX + lay.bounds.maxX) / 2));
|
|
38300
|
+
const floors = [];
|
|
38301
|
+
const furniture = [];
|
|
38302
|
+
const walls = [];
|
|
38303
|
+
const openings = [];
|
|
38304
|
+
const labels = [];
|
|
38305
|
+
const dims = [];
|
|
38306
|
+
for (const r6 of lay.rooms) {
|
|
38307
|
+
floors.push(
|
|
38308
|
+
chunk3WNW5Y7P_cjs.group(
|
|
38309
|
+
{ class: "sx-fp-floor", "data-room": r6.id },
|
|
38310
|
+
r6.parts.map(
|
|
38311
|
+
(p) => chunk3WNW5Y7P_cjs.rect({
|
|
38312
|
+
fill: r6.fill ?? t.floorFill,
|
|
38313
|
+
x: X(p.x),
|
|
38314
|
+
y: Y(p.y),
|
|
38315
|
+
width: px(p.w),
|
|
38316
|
+
height: px(p.h)
|
|
38317
|
+
})
|
|
38318
|
+
)
|
|
38319
|
+
)
|
|
38320
|
+
);
|
|
38321
|
+
if (!r6.nolabel) {
|
|
38322
|
+
const main = r6.parts.reduce((a, b) => b.w * b.h > a.w * a.h ? b : a);
|
|
38323
|
+
const cx = X(main.x + main.w / 2);
|
|
38324
|
+
const cy = Y(main.y + main.h / 2);
|
|
38325
|
+
labels.push(chunk3WNW5Y7P_cjs.text({ class: "sx-fp-room-name", x: cx, y: r24(cy - 3), "text-anchor": "middle" }, r6.label));
|
|
38326
|
+
labels.push(chunk3WNW5Y7P_cjs.text({ class: "sx-fp-room-area", x: cx, y: r24(cy + 13), "text-anchor": "middle" }, r6.areaText));
|
|
38327
|
+
}
|
|
38328
|
+
}
|
|
38329
|
+
const warnSet = new Set(lay.warnItems);
|
|
38330
|
+
lay.items.forEach((it, idx) => {
|
|
38331
|
+
const def = FLOORPLAN_SYMBOLS[it.type];
|
|
38332
|
+
const wpx = px(it.w);
|
|
38333
|
+
const hpx = px(it.h);
|
|
38334
|
+
const cx = r24(X(it.x) + wpx / 2);
|
|
38335
|
+
const cy = r24(Y(it.y) + hpx / 2);
|
|
38336
|
+
const rot = Math.round(it.rotate * 10) / 10;
|
|
38337
|
+
const children = [def.draw({ w: it.w, h: it.h, px, label: it.label })];
|
|
38338
|
+
if (warnSet.has(idx)) {
|
|
38339
|
+
children.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-warn-item", x: -1, y: -1, width: r24(wpx + 2), height: r24(hpx + 2) }));
|
|
38340
|
+
}
|
|
38341
|
+
furniture.push(
|
|
38342
|
+
chunk3WNW5Y7P_cjs.group(
|
|
38343
|
+
{
|
|
38344
|
+
class: "sx-fp-item",
|
|
38345
|
+
"data-furniture": it.type,
|
|
38346
|
+
transform: `translate(${cx},${cy})${rot ? ` rotate(${rot})` : ""} translate(${r24(-wpx / 2)},${r24(-hpx / 2)})`
|
|
38347
|
+
},
|
|
38348
|
+
children
|
|
38349
|
+
)
|
|
38350
|
+
);
|
|
38351
|
+
if (it.label && !def.consumesLabel) {
|
|
38352
|
+
labels.push(chunk3WNW5Y7P_cjs.text({ class: "sx-fp-furn-label", x: cx, y: r24(cy + 4), "text-anchor": "middle" }, it.label));
|
|
38353
|
+
}
|
|
38354
|
+
});
|
|
38355
|
+
const tw = lay.wallT;
|
|
38356
|
+
for (const r6 of lay.rooms) {
|
|
38357
|
+
for (const p of r6.parts) {
|
|
38358
|
+
walls.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-wall", x: r24(X(p.x) - px(tw / 2)), y: r24(Y(p.y) - px(tw / 2)), width: r24(px(p.w + tw)), height: px(tw) }));
|
|
38359
|
+
walls.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-wall", x: r24(X(p.x) - px(tw / 2)), y: r24(Y(p.y + p.h) - px(tw / 2)), width: r24(px(p.w + tw)), height: px(tw) }));
|
|
38360
|
+
walls.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-wall", x: r24(X(p.x) - px(tw / 2)), y: r24(Y(p.y) - px(tw / 2)), width: px(tw), height: r24(px(p.h + tw)) }));
|
|
38361
|
+
walls.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-wall", x: r24(X(p.x + p.w) - px(tw / 2)), y: r24(Y(p.y) - px(tw / 2)), width: px(tw), height: r24(px(p.h + tw)) }));
|
|
38362
|
+
}
|
|
38363
|
+
}
|
|
38364
|
+
for (const s of lay.seams) {
|
|
38365
|
+
const fill = lay.rooms[s.room]?.fill ?? t.floorFill;
|
|
38366
|
+
const tpx = px(tw);
|
|
38367
|
+
if (s.vertical) {
|
|
38368
|
+
openings.push(
|
|
38369
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-gap", fill, x: r24(X(s.along) - tpx / 2 - 0.5), y: Y(s.lo), width: r24(tpx + 1), height: px(s.hi - s.lo) })
|
|
38370
|
+
);
|
|
38371
|
+
} else {
|
|
38372
|
+
openings.push(
|
|
38373
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-fp-gap", fill, x: X(s.lo), y: r24(Y(s.along) - tpx / 2 - 0.5), width: px(s.hi - s.lo), height: r24(tpx + 1) })
|
|
38374
|
+
);
|
|
38375
|
+
}
|
|
38376
|
+
}
|
|
38377
|
+
for (const o of lay.openings) {
|
|
38378
|
+
openings.push(punchGap(o, lay, ctx));
|
|
38379
|
+
if (o.kind === "window") openings.push(windowSymbol(o, ctx));
|
|
38380
|
+
else if (o.kind === "door") openings.push(doorSymbol(o, ctx));
|
|
38381
|
+
else openings.push(jambLines(o, ctx));
|
|
38382
|
+
}
|
|
38383
|
+
for (const d of lay.dims) dims.push(renderDim(d, ctx));
|
|
38384
|
+
if (lay.north !== void 0) {
|
|
38385
|
+
const ncx = r24(X(lay.bounds.maxX) + px(0.55));
|
|
38386
|
+
const ncy = r24(Y(lay.bounds.minY) - px(0.62));
|
|
38387
|
+
const rr = px(0.32);
|
|
38388
|
+
const rot = Math.round(lay.north * 10) / 10;
|
|
38389
|
+
dims.push(
|
|
38390
|
+
chunk3WNW5Y7P_cjs.group({ class: "sx-fp-compass-g", transform: rot ? `rotate(${rot} ${ncx} ${ncy})` : "" }, [
|
|
38391
|
+
chunk3WNW5Y7P_cjs.el("circle", { class: "sx-fp-compass", cx: ncx, cy: ncy, r: rr }),
|
|
38392
|
+
chunk3WNW5Y7P_cjs.line({ class: "sx-fp-compass", x1: ncx, y1: r24(ncy + rr * 0.7), x2: ncx, y2: r24(ncy - rr * 0.55) }),
|
|
38393
|
+
chunk3WNW5Y7P_cjs.el("polygon", {
|
|
38394
|
+
class: "sx-fp-compass",
|
|
38395
|
+
fill: t.dimText,
|
|
38396
|
+
points: `${ncx},${r24(ncy - rr * 0.85)} ${r24(ncx - rr * 0.22)},${r24(ncy - rr * 0.3)} ${r24(ncx + rr * 0.22)},${r24(ncy - rr * 0.3)}`
|
|
38397
|
+
}),
|
|
38398
|
+
chunk3WNW5Y7P_cjs.text({ class: "sx-fp-compass-n", x: r24(ncx + rr + 4), y: r24(ncy - rr * 0.45), "text-anchor": "start" }, "N")
|
|
38399
|
+
])
|
|
38400
|
+
);
|
|
38401
|
+
}
|
|
38402
|
+
const warnBlock = [];
|
|
38403
|
+
if (lay.warnings.length) {
|
|
38404
|
+
const y0 = H2 - warnH + 4;
|
|
38405
|
+
lay.warnings.forEach((w, i) => {
|
|
38406
|
+
warnBlock.push(chunk3WNW5Y7P_cjs.text({ class: "sx-fp-warn", x: 10, y: r24(y0 + i * 17 + 10) }, `\u26A0 ${w}`));
|
|
38407
|
+
});
|
|
38408
|
+
}
|
|
38409
|
+
const nRooms = lay.rooms.length;
|
|
38410
|
+
const descText = `${nRooms} room${nRooms === 1 ? "" : "s"}, ${formatArea(lay.totalAreaM2, lay.unit)} total. ${lay.items.length} furniture item${lay.items.length === 1 ? "" : "s"}.` + (lay.warnings.length ? ` Warnings: ${lay.warnings.join("; ")}.` : "");
|
|
38411
|
+
return chunk3WNW5Y7P_cjs.svgRoot(
|
|
38412
|
+
{ viewBox: `0 0 ${W2} ${H2}`, class: "sx-fp", role: "img" },
|
|
38413
|
+
[
|
|
38414
|
+
chunk3WNW5Y7P_cjs.title(lay.title),
|
|
38415
|
+
chunk3WNW5Y7P_cjs.desc(descText),
|
|
38416
|
+
chunk3WNW5Y7P_cjs.el("style", {}, buildCss13(t)),
|
|
38417
|
+
chunk3WNW5Y7P_cjs.rect({ fill: t.bg, x: 0, y: 0, width: W2, height: H2 }),
|
|
38418
|
+
chunk3WNW5Y7P_cjs.text({ class: "sx-fp-title", x: titleX, y: chunkCAAMBDEN_cjs.TITLE.y, "text-anchor": "middle" }, lay.title),
|
|
38419
|
+
chunk3WNW5Y7P_cjs.group({ transform: `translate(0,${titleH})` }, [
|
|
38420
|
+
chunk3WNW5Y7P_cjs.group({ class: "sx-fp-floors" }, floors),
|
|
38421
|
+
chunk3WNW5Y7P_cjs.group({ class: "sx-fp-furniture" }, furniture),
|
|
38422
|
+
chunk3WNW5Y7P_cjs.group({ class: "sx-fp-walls" }, walls),
|
|
38423
|
+
chunk3WNW5Y7P_cjs.group({ class: "sx-fp-openings" }, openings),
|
|
38424
|
+
chunk3WNW5Y7P_cjs.group({ class: "sx-fp-labels" }, labels),
|
|
38425
|
+
chunk3WNW5Y7P_cjs.group({ class: "sx-fp-dims" }, dims)
|
|
38426
|
+
]),
|
|
38427
|
+
...warnBlock
|
|
38428
|
+
]
|
|
38429
|
+
);
|
|
38430
|
+
}
|
|
38431
|
+
function renderFloorplan(text2, config) {
|
|
38432
|
+
return renderFloorplanLayout(layoutFloorplan(parseFloorplan(text2)), config);
|
|
38433
|
+
}
|
|
38434
|
+
|
|
38435
|
+
// src/diagrams/floorplan/index.ts
|
|
38436
|
+
var floorplan = {
|
|
38437
|
+
type: "floorplan",
|
|
38438
|
+
detect(text2) {
|
|
38439
|
+
for (const raw of text2.split(/\r?\n/)) {
|
|
38440
|
+
const t = raw.trim();
|
|
38441
|
+
if (!t) continue;
|
|
38442
|
+
if (t.startsWith("#") || t.startsWith("//")) continue;
|
|
38443
|
+
return /^floorplan\b/i.test(t);
|
|
38444
|
+
}
|
|
38445
|
+
return false;
|
|
38446
|
+
},
|
|
38447
|
+
parse: parseFloorplan,
|
|
38448
|
+
render(text2, config) {
|
|
38449
|
+
return renderFloorplan(text2, config);
|
|
38450
|
+
},
|
|
38451
|
+
lint(text2) {
|
|
38452
|
+
try {
|
|
38453
|
+
const lay = layoutFloorplan(parseFloorplan(text2));
|
|
38454
|
+
return [
|
|
38455
|
+
...lay.errors.map(
|
|
38456
|
+
(message) => ({
|
|
38457
|
+
severity: "error",
|
|
38458
|
+
code: "floorplan/validation",
|
|
38459
|
+
message,
|
|
38460
|
+
fatal: false
|
|
38461
|
+
})
|
|
38462
|
+
),
|
|
38463
|
+
...lay.warnings.map(
|
|
38464
|
+
(message) => ({
|
|
38465
|
+
severity: "warning",
|
|
38466
|
+
code: "floorplan/warning",
|
|
38467
|
+
message,
|
|
38468
|
+
fatal: false
|
|
38469
|
+
})
|
|
38470
|
+
)
|
|
38471
|
+
];
|
|
38472
|
+
} catch {
|
|
38473
|
+
return [];
|
|
38474
|
+
}
|
|
38475
|
+
}
|
|
38476
|
+
};
|
|
38477
|
+
|
|
35927
38478
|
// src/core/api.ts
|
|
35928
38479
|
var plugins = [
|
|
35929
|
-
|
|
35930
|
-
|
|
35931
|
-
|
|
35932
|
-
|
|
35933
|
-
|
|
35934
|
-
|
|
35935
|
-
|
|
35936
|
-
|
|
35937
|
-
|
|
35938
|
-
|
|
35939
|
-
|
|
35940
|
-
|
|
35941
|
-
|
|
35942
|
-
|
|
35943
|
-
|
|
38480
|
+
chunkMZWVJFTV_cjs.genogram,
|
|
38481
|
+
chunkY4OBXYGW_cjs.ecomap,
|
|
38482
|
+
chunkAEZVCGH4_cjs.pedigree,
|
|
38483
|
+
chunkFFAJQ36U_cjs.phylo,
|
|
38484
|
+
chunkC2BNO3CI_cjs.sociogram,
|
|
38485
|
+
chunkJHJJT5H5_cjs.timing,
|
|
38486
|
+
chunkVG5LP5A4_cjs.logic,
|
|
38487
|
+
chunkATE7LD6I_cjs.circuit,
|
|
38488
|
+
chunkO6A2GJLI_cjs.blockdiagram,
|
|
38489
|
+
chunkIU26USXA_cjs.ladder,
|
|
38490
|
+
chunkJYAL26WQ_cjs.sld,
|
|
38491
|
+
chunkIOD2EFMX_cjs.entity,
|
|
38492
|
+
chunk6W6RFZND_cjs.fishbone,
|
|
38493
|
+
chunkBXS53MLV_cjs.venn,
|
|
38494
|
+
chunkTFNH2NLJ_cjs.flowchart,
|
|
35944
38495
|
mindmap,
|
|
35945
38496
|
matrix,
|
|
35946
|
-
|
|
38497
|
+
chunkVOFND6ZQ_cjs.orgchart,
|
|
35947
38498
|
decisiontree,
|
|
35948
38499
|
timeline,
|
|
35949
38500
|
state,
|
|
@@ -35970,7 +38521,8 @@ var plugins = [
|
|
|
35970
38521
|
epc,
|
|
35971
38522
|
idef0,
|
|
35972
38523
|
threatmodel,
|
|
35973
|
-
welding
|
|
38524
|
+
welding,
|
|
38525
|
+
floorplan
|
|
35974
38526
|
];
|
|
35975
38527
|
function detectPlugin(text2, config) {
|
|
35976
38528
|
if (config?.type) {
|
|
@@ -35981,7 +38533,7 @@ function detectPlugin(text2, config) {
|
|
|
35981
38533
|
if (plugin.detect(text2)) return plugin;
|
|
35982
38534
|
}
|
|
35983
38535
|
throw new Error(
|
|
35984
|
-
"Cannot detect diagram type. Start your text with 'genogram', 'ecomap', 'pedigree', 'phylo', 'sociogram', 'timing', 'logic', 'circuit', 'blockdiagram', 'ladder', 'sld', 'entity-structure', 'fishbone', 'venn', 'flowchart', 'mindmap', 'matrix', 'orgchart', 'state', 'pid', 'erd', 'breadboard', 'bpmn', 'fbd', 'sfc', 'prisma', 'usecase', 'pert', 'sequence', 'petri', 'network', 'umlclass', 'faulttree', or '
|
|
38536
|
+
"Cannot detect diagram type. Start your text with 'genogram', 'ecomap', 'pedigree', 'phylo', 'sociogram', 'timing', 'logic', 'circuit', 'blockdiagram', 'ladder', 'sld', 'entity-structure', 'fishbone', 'venn', 'flowchart', 'mindmap', 'matrix', 'orgchart', 'state', 'pid', 'erd', 'breadboard', 'bpmn', 'fbd', 'sfc', 'prisma', 'usecase', 'pert', 'sequence', 'petri', 'network', 'umlclass', 'faulttree', 'bowtie', or 'floorplan'."
|
|
35985
38537
|
);
|
|
35986
38538
|
}
|
|
35987
38539
|
function stripCodeFences(text2) {
|
|
@@ -36118,6 +38670,7 @@ function renderWithPlugin(prepared, plugin, config) {
|
|
|
36118
38670
|
return plugin.render(prepared, renderConfig);
|
|
36119
38671
|
}
|
|
36120
38672
|
|
|
38673
|
+
exports.FLOORPLAN_SYMBOLS = FLOORPLAN_SYMBOLS;
|
|
36121
38674
|
exports.GEOMETRY = GEOMETRY;
|
|
36122
38675
|
exports.bowtie = bowtie2;
|
|
36123
38676
|
exports.causalloop = causalloop;
|
|
@@ -36149,5 +38702,5 @@ exports.timeline = timeline;
|
|
|
36149
38702
|
exports.umlclass = umlclass;
|
|
36150
38703
|
exports.usecase = usecase;
|
|
36151
38704
|
exports.welding = welding;
|
|
36152
|
-
//# sourceMappingURL=chunk-
|
|
36153
|
-
//# sourceMappingURL=chunk-
|
|
38705
|
+
//# sourceMappingURL=chunk-AHSSFGDJ.cjs.map
|
|
38706
|
+
//# sourceMappingURL=chunk-AHSSFGDJ.cjs.map
|