schematex 0.6.8 → 0.6.10
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 +0 -17
- package/dist/ai/ai-sdk.cjs +7 -7
- package/dist/ai/ai-sdk.d.cts +1 -1
- package/dist/ai/ai-sdk.d.ts +1 -1
- package/dist/ai/ai-sdk.js +2 -2
- package/dist/ai/index.cjs +13 -13
- package/dist/ai/index.js +2 -2
- package/dist/browser.cjs +8 -8
- package/dist/browser.js +2 -2
- package/dist/{chunk-AGBY7KLL.cjs → chunk-3YRYBTLG.cjs} +62 -46
- package/dist/chunk-3YRYBTLG.cjs.map +1 -0
- package/dist/{chunk-J2TT7PGI.js → chunk-6AWASOFO.js} +62 -46
- package/dist/chunk-6AWASOFO.js.map +1 -0
- package/dist/{chunk-EDXDFKYO.cjs → chunk-DZGA25O5.cjs} +7 -7
- package/dist/{chunk-EDXDFKYO.cjs.map → chunk-DZGA25O5.cjs.map} +1 -1
- package/dist/{chunk-QZ2OBNAS.js → chunk-X4P4HKHP.js} +5 -5
- package/dist/{chunk-QZ2OBNAS.js.map → chunk-X4P4HKHP.js.map} +1 -1
- package/dist/index.cjs +23 -23
- package/dist/index.js +2 -2
- package/dist/react.cjs +2 -2
- package/dist/react.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-AGBY7KLL.cjs.map +0 -1
- package/dist/chunk-J2TT7PGI.js.map +0 -1
package/README.md
CHANGED
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
36
|
-
<<<<<<< Updated upstream
|
|
37
36
|
**Schematex** is the open-source rendering engine for the diagrams professionals actually use — medical, electrical, legal, and analytical. **36 diagram families** spanning medicine, engineering, law, and analysis:
|
|
38
37
|
|
|
39
38
|
- 👪 **Relationships** — genograms, ecomaps, pedigrees, sociograms, phylogenetic trees
|
|
@@ -43,18 +42,6 @@
|
|
|
43
42
|
- 🏢 **Corporate & Legal** — entity structures, cap tables, org charts
|
|
44
43
|
- 🐟 **Causality & Analysis** — fishbone / Ishikawa, decision trees (Howard-Raiffa EV · CART/sklearn · taxonomy), Venn / Euler
|
|
45
44
|
- 🛡️ **Risk & Reliability** — **fault trees** (NUREG-0492 / IEC 61025) that *compute* MOCUS minimal cut sets + P(top), **bowtie** barrier-based risk (CCPS / Energy Institute 2018)
|
|
46
|
-
=======
|
|
47
|
-
**Schematex** is the open-source rendering engine for the diagrams professionals actually use — medical, electrical, legal, and analytical. 36 diagram families across eleven domains:
|
|
48
|
-
|
|
49
|
-
- 👪 **Relationships** — genograms, ecomaps, pedigrees, sociograms, phylogenetic trees
|
|
50
|
-
- ⚡ **Electrical & Industrial** — ladder logic, single-line diagrams, circuit schematics, logic gates, timing, block diagrams, **FBD**, **SFC**, breadboard, **P&ID** (ISA-5.1)
|
|
51
|
-
- 🏢 **Corporate & Legal** — entity structures, cap tables
|
|
52
|
-
- 🐟 **Causality & Analysis** — fishbone / Ishikawa, decision trees (Howard-Raiffa EV · CART/sklearn · taxonomy)
|
|
53
|
-
- 🧩 **Software & UML** — **UML class diagrams** (UML 2.5.1 §9–§11), **use case diagrams** (§18), **sequence diagrams** (§17 — all 12 combined fragments + `ref`), UML 2.5 / Harel **state diagrams**
|
|
54
|
-
- 🔄 **Behavior modeling** — **BPMN 2.0** (OMG)
|
|
55
|
-
- 🗄️ **Data modeling** — ERD crow's-foot notation
|
|
56
|
-
- 🛡️ **Risk & Reliability** — **Fault Tree Analysis** (NUREG-0492 / IEC 61025) with minimal cut sets + P(top), and **bowtie risk diagrams** (CCPS / Energy Institute 2018)
|
|
57
|
-
>>>>>>> Stashed changes
|
|
58
45
|
- 🗓️ **Project management** — **PERT / CPM** networks (PMBOK 7) that *compute* the schedule: ES/EF/LS/LF, slack, critical path, three-point estimation, swimlanes, time-scaled layout
|
|
59
46
|
- 🖧 **Network & Infrastructure** — **network topology** diagrams (Cisco-convention icons) with device/link/port integrity, IP-CCTV camera systems, three-tier campus, spine-leaf fabric, subnets & VLANs
|
|
60
47
|
- ◉ **Concurrency** — **Petri nets** (Murata 1989 / ISO-IEC 15909) that *compute* enablement and fire token sequences
|
|
@@ -95,11 +82,7 @@ import { render } from 'schematex/genogram';
|
|
|
95
82
|
|
|
96
83
|
## Gallery
|
|
97
84
|
|
|
98
|
-
<<<<<<< Updated upstream
|
|
99
85
|
All 36 diagram types share one unified pipeline. A selection is shown below — **try any of them live at [schematex.dev/playground](https://schematex.dev/playground).**
|
|
100
|
-
=======
|
|
101
|
-
36 diagram types, one unified pipeline. **Try any of these live at [schematex.dev/playground](https://schematex.dev/playground).**
|
|
102
|
-
>>>>>>> Stashed changes
|
|
103
86
|
|
|
104
87
|
### 👪 Genogram — *McGoldrick family-systems standard*
|
|
105
88
|
|
package/dist/ai/ai-sdk.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkDZGA25O5_cjs = require('../chunk-DZGA25O5.cjs');
|
|
4
|
+
require('../chunk-3YRYBTLG.cjs');
|
|
5
5
|
require('../chunk-UHPGWO77.cjs');
|
|
6
6
|
require('../chunk-J3EPFZPX.cjs');
|
|
7
7
|
require('../chunk-SHMG7BVF.cjs');
|
|
@@ -31,7 +31,7 @@ var schematexTools = {
|
|
|
31
31
|
listDiagrams: ai.tool({
|
|
32
32
|
description: "List every Schematex diagram type with a tagline, 'use when' hint, domain cluster, and authoritative standard. Call this first to discover what's available.",
|
|
33
33
|
inputSchema: zod.z.object({}),
|
|
34
|
-
execute: async () =>
|
|
34
|
+
execute: async () => chunkDZGA25O5_cjs.listDiagrams()
|
|
35
35
|
}),
|
|
36
36
|
getSyntax: ai.tool({
|
|
37
37
|
description: "Return syntax for one diagram type. Default `detail: canonical` is the compact first-shot generation path: canonical header, preferred forms, rules, and repair checks. Request `detail: reference` only for advanced forms or imported adapters after choosing a type.",
|
|
@@ -46,7 +46,7 @@ var schematexTools = {
|
|
|
46
46
|
execute: async ({
|
|
47
47
|
type,
|
|
48
48
|
detail
|
|
49
|
-
}) =>
|
|
49
|
+
}) => chunkDZGA25O5_cjs.getSyntax(type, { detail })
|
|
50
50
|
}),
|
|
51
51
|
getExamples: ai.tool({
|
|
52
52
|
description: "Return curated real-world DSL examples for a diagram type, each with scenario notes and tags. Use as few-shot context before generating DSL.",
|
|
@@ -56,7 +56,7 @@ var schematexTools = {
|
|
|
56
56
|
preferFeatured: zod.z.boolean().optional().describe("Rank featured examples first."),
|
|
57
57
|
maxComplexity: zod.z.number().int().min(1).max(5).optional().describe("Only return examples with complexity <= this value (1=simplest).")
|
|
58
58
|
}),
|
|
59
|
-
execute: async (args) =>
|
|
59
|
+
execute: async (args) => chunkDZGA25O5_cjs.getExamples(args.type, {
|
|
60
60
|
limit: args.limit,
|
|
61
61
|
preferFeatured: args.preferFeatured,
|
|
62
62
|
maxComplexity: args.maxComplexity
|
|
@@ -70,7 +70,7 @@ var schematexTools = {
|
|
|
70
70
|
),
|
|
71
71
|
dsl: zod.z.string().describe("The DSL source text to validate.")
|
|
72
72
|
}),
|
|
73
|
-
execute: async ({ type, dsl }) =>
|
|
73
|
+
execute: async ({ type, dsl }) => chunkDZGA25O5_cjs.validateDsl(type, dsl)
|
|
74
74
|
}),
|
|
75
75
|
renderDsl: ai.tool({
|
|
76
76
|
description: "Render Schematex DSL to an SVG string. Returns { ok: true, svg } or { ok: false, errors }. Use when the caller needs the actual diagram output, not just validation.",
|
|
@@ -85,7 +85,7 @@ var schematexTools = {
|
|
|
85
85
|
dsl,
|
|
86
86
|
theme,
|
|
87
87
|
padding
|
|
88
|
-
}) =>
|
|
88
|
+
}) => chunkDZGA25O5_cjs.renderDsl(type, dsl, { theme, padding })
|
|
89
89
|
})
|
|
90
90
|
};
|
|
91
91
|
|
package/dist/ai/ai-sdk.d.cts
CHANGED
|
@@ -7,7 +7,7 @@ declare const schematexTools: {
|
|
|
7
7
|
readonly listDiagrams: ai.Tool<{}, DiagramListItem[]>;
|
|
8
8
|
readonly getSyntax: ai.Tool<{
|
|
9
9
|
type: string;
|
|
10
|
-
detail?: "
|
|
10
|
+
detail?: "canonical" | "reference" | undefined;
|
|
11
11
|
}, GetSyntaxResult>;
|
|
12
12
|
readonly getExamples: ai.Tool<{
|
|
13
13
|
type: string;
|
package/dist/ai/ai-sdk.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare const schematexTools: {
|
|
|
7
7
|
readonly listDiagrams: ai.Tool<{}, DiagramListItem[]>;
|
|
8
8
|
readonly getSyntax: ai.Tool<{
|
|
9
9
|
type: string;
|
|
10
|
-
detail?: "
|
|
10
|
+
detail?: "canonical" | "reference" | undefined;
|
|
11
11
|
}, GetSyntaxResult>;
|
|
12
12
|
readonly getExamples: ai.Tool<{
|
|
13
13
|
type: string;
|
package/dist/ai/ai-sdk.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { renderDsl, validateDsl, getExamples, getSyntax, listDiagrams } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
import { renderDsl, validateDsl, getExamples, getSyntax, listDiagrams } from '../chunk-X4P4HKHP.js';
|
|
2
|
+
import '../chunk-6AWASOFO.js';
|
|
3
3
|
import '../chunk-MPCSWRZC.js';
|
|
4
4
|
import '../chunk-2TUZ3QJA.js';
|
|
5
5
|
import '../chunk-C7V57V6O.js';
|
package/dist/ai/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkDZGA25O5_cjs = require('../chunk-DZGA25O5.cjs');
|
|
4
|
+
require('../chunk-3YRYBTLG.cjs');
|
|
5
5
|
require('../chunk-UHPGWO77.cjs');
|
|
6
6
|
require('../chunk-J3EPFZPX.cjs');
|
|
7
7
|
require('../chunk-SHMG7BVF.cjs');
|
|
@@ -29,47 +29,47 @@ require('../chunk-3WNW5Y7P.cjs');
|
|
|
29
29
|
|
|
30
30
|
Object.defineProperty(exports, "DIAGRAM_REGISTRY", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunkDZGA25O5_cjs.DIAGRAM_REGISTRY; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "DIAGRAM_SINCE", {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunkDZGA25O5_cjs.DIAGRAM_SINCE; }
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "getAllDiagramTypes", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkDZGA25O5_cjs.getAllDiagramTypes; }
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "getDiagramMeta", {
|
|
43
43
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
44
|
+
get: function () { return chunkDZGA25O5_cjs.getDiagramMeta; }
|
|
45
45
|
});
|
|
46
46
|
Object.defineProperty(exports, "getDiagramSince", {
|
|
47
47
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunkDZGA25O5_cjs.getDiagramSince; }
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "getExamples", {
|
|
51
51
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunkDZGA25O5_cjs.getExamples; }
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "getSyntax", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunkDZGA25O5_cjs.getSyntax; }
|
|
57
57
|
});
|
|
58
58
|
Object.defineProperty(exports, "listDiagrams", {
|
|
59
59
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkDZGA25O5_cjs.listDiagrams; }
|
|
61
61
|
});
|
|
62
62
|
Object.defineProperty(exports, "renderDsl", {
|
|
63
63
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
64
|
+
get: function () { return chunkDZGA25O5_cjs.renderDsl; }
|
|
65
65
|
});
|
|
66
66
|
Object.defineProperty(exports, "resolveDiagramType", {
|
|
67
67
|
enumerable: true,
|
|
68
|
-
get: function () { return
|
|
68
|
+
get: function () { return chunkDZGA25O5_cjs.resolveDiagramType; }
|
|
69
69
|
});
|
|
70
70
|
Object.defineProperty(exports, "validateDsl", {
|
|
71
71
|
enumerable: true,
|
|
72
|
-
get: function () { return
|
|
72
|
+
get: function () { return chunkDZGA25O5_cjs.validateDsl; }
|
|
73
73
|
});
|
|
74
74
|
//# sourceMappingURL=index.cjs.map
|
|
75
75
|
//# sourceMappingURL=index.cjs.map
|
package/dist/ai/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { DIAGRAM_REGISTRY, DIAGRAM_SINCE, getAllDiagramTypes, getDiagramMeta, getDiagramSince, getExamples, getSyntax, listDiagrams, renderDsl, resolveDiagramType, validateDsl } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { DIAGRAM_REGISTRY, DIAGRAM_SINCE, getAllDiagramTypes, getDiagramMeta, getDiagramSince, getExamples, getSyntax, listDiagrams, renderDsl, resolveDiagramType, validateDsl } from '../chunk-X4P4HKHP.js';
|
|
2
|
+
import '../chunk-6AWASOFO.js';
|
|
3
3
|
import '../chunk-MPCSWRZC.js';
|
|
4
4
|
import '../chunk-2TUZ3QJA.js';
|
|
5
5
|
import '../chunk-C7V57V6O.js';
|
package/dist/browser.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3YRYBTLG_cjs = require('./chunk-3YRYBTLG.cjs');
|
|
4
4
|
require('./chunk-UHPGWO77.cjs');
|
|
5
5
|
require('./chunk-J3EPFZPX.cjs');
|
|
6
6
|
require('./chunk-SHMG7BVF.cjs');
|
|
@@ -26,10 +26,10 @@ require('./chunk-3WNW5Y7P.cjs');
|
|
|
26
26
|
|
|
27
27
|
// src/browser.ts
|
|
28
28
|
function renderToElement(text, config) {
|
|
29
|
-
return svgStringToElement(
|
|
29
|
+
return svgStringToElement(chunk3YRYBTLG_cjs.render(text, config));
|
|
30
30
|
}
|
|
31
31
|
function renderPreviewToElement(text, config) {
|
|
32
|
-
return svgStringToElement(
|
|
32
|
+
return svgStringToElement(chunk3YRYBTLG_cjs.renderPreview(text, config));
|
|
33
33
|
}
|
|
34
34
|
function svgStringToElement(svgString) {
|
|
35
35
|
const parser = new DOMParser();
|
|
@@ -42,23 +42,23 @@ function svgStringToElement(svgString) {
|
|
|
42
42
|
return el;
|
|
43
43
|
}
|
|
44
44
|
function renderToContainer(text, container, config) {
|
|
45
|
-
container.innerHTML =
|
|
45
|
+
container.innerHTML = chunk3YRYBTLG_cjs.render(text, config);
|
|
46
46
|
}
|
|
47
47
|
function renderPreviewToContainer(text, container, config) {
|
|
48
|
-
container.innerHTML =
|
|
48
|
+
container.innerHTML = chunk3YRYBTLG_cjs.renderPreview(text, config);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
Object.defineProperty(exports, "render", {
|
|
52
52
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunk3YRYBTLG_cjs.render; }
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "renderPreview", {
|
|
56
56
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunk3YRYBTLG_cjs.renderPreview; }
|
|
58
58
|
});
|
|
59
59
|
Object.defineProperty(exports, "renderResult", {
|
|
60
60
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
61
|
+
get: function () { return chunk3YRYBTLG_cjs.renderResult; }
|
|
62
62
|
});
|
|
63
63
|
exports.renderPreviewToContainer = renderPreviewToContainer;
|
|
64
64
|
exports.renderPreviewToElement = renderPreviewToElement;
|
package/dist/browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { render, renderPreview } from './chunk-
|
|
2
|
-
export { render, renderPreview, renderResult } from './chunk-
|
|
1
|
+
import { render, renderPreview } from './chunk-6AWASOFO.js';
|
|
2
|
+
export { render, renderPreview, renderResult } from './chunk-6AWASOFO.js';
|
|
3
3
|
import './chunk-MPCSWRZC.js';
|
|
4
4
|
import './chunk-2TUZ3QJA.js';
|
|
5
5
|
import './chunk-C7V57V6O.js';
|
|
@@ -5171,6 +5171,22 @@ function layoutPid(ast) {
|
|
|
5171
5171
|
equipById.set(equip.id, layoutEq);
|
|
5172
5172
|
cursorX += geo.width + EQUIP_GAP_X;
|
|
5173
5173
|
}
|
|
5174
|
+
const lineMidById = /* @__PURE__ */ new Map();
|
|
5175
|
+
for (const ln of ast.lines) {
|
|
5176
|
+
const from = equipById.get(ln.from.id);
|
|
5177
|
+
const to = equipById.get(ln.to.id);
|
|
5178
|
+
if (!from || !to) continue;
|
|
5179
|
+
const fa = getAnchor(from, ln.from.port, "out");
|
|
5180
|
+
const ta = getAnchor(to, ln.to.port, "in");
|
|
5181
|
+
lineMidById.set(ln.id, { x: (fa.x + ta.x) / 2, y: (fa.y + ta.y) / 2 });
|
|
5182
|
+
}
|
|
5183
|
+
const targetX = (tgt, fallback) => {
|
|
5184
|
+
const eq = equipById.get(tgt);
|
|
5185
|
+
if (eq) return eq.cx;
|
|
5186
|
+
const lm = lineMidById.get(tgt);
|
|
5187
|
+
if (lm) return lm.x;
|
|
5188
|
+
return fallback;
|
|
5189
|
+
};
|
|
5174
5190
|
const instruments = [];
|
|
5175
5191
|
const instById = /* @__PURE__ */ new Map();
|
|
5176
5192
|
const crBandY = PADDING + TITLE_AREA + 40;
|
|
@@ -5180,20 +5196,17 @@ function layoutPid(ast) {
|
|
|
5180
5196
|
let cy = 0;
|
|
5181
5197
|
if (inst.category.startsWith("cr_")) {
|
|
5182
5198
|
const tgt = inst.controls ?? inst.measures ?? "";
|
|
5183
|
-
|
|
5184
|
-
cx = tgtEq ? tgtEq.cx : PADDING + 80 + crSlot * (INST_RADIUS * 2 + 28);
|
|
5199
|
+
cx = targetX(tgt, PADDING + 80 + crSlot * (INST_RADIUS * 2 + 28));
|
|
5185
5200
|
cy = crBandY;
|
|
5186
5201
|
crSlot += 1;
|
|
5187
5202
|
} else if (inst.category.startsWith("local_")) {
|
|
5188
5203
|
cy = rowY + maxH / 2 + INST_OFFSET + INST_RADIUS;
|
|
5189
5204
|
const tgt = inst.measures ?? inst.controls ?? "";
|
|
5190
|
-
|
|
5191
|
-
cx = tgtEq ? tgtEq.cx : PADDING + 80;
|
|
5205
|
+
cx = targetX(tgt, PADDING + 80);
|
|
5192
5206
|
} else {
|
|
5193
5207
|
cy = rowY + maxH / 2 + INST_OFFSET;
|
|
5194
5208
|
const tgt = inst.measures ?? inst.controls ?? "";
|
|
5195
|
-
|
|
5196
|
-
cx = tgtEq ? tgtEq.cx : PADDING + 80;
|
|
5209
|
+
cx = targetX(tgt, PADDING + 80);
|
|
5197
5210
|
}
|
|
5198
5211
|
const lay = {
|
|
5199
5212
|
inst,
|
|
@@ -5204,13 +5217,14 @@ function layoutPid(ast) {
|
|
|
5204
5217
|
instruments.push(lay);
|
|
5205
5218
|
instById.set(inst.tag, lay);
|
|
5206
5219
|
}
|
|
5207
|
-
const
|
|
5220
|
+
const INST_FANOUT = INST_RADIUS * 2 + 12;
|
|
5221
|
+
const sameYRow = (a, b) => Math.abs(a.cy - b.cy) < INST_RADIUS;
|
|
5208
5222
|
const sortedByX = [...instruments].sort((a, b) => a.cx - b.cx);
|
|
5209
5223
|
for (let i = 1; i < sortedByX.length; i++) {
|
|
5210
5224
|
const prev = sortedByX[i - 1];
|
|
5211
5225
|
const cur = sortedByX[i];
|
|
5212
|
-
if (
|
|
5213
|
-
cur.cx = prev.cx +
|
|
5226
|
+
if (sameYRow(prev, cur) && cur.cx < prev.cx + INST_FANOUT) {
|
|
5227
|
+
cur.cx = prev.cx + INST_FANOUT;
|
|
5214
5228
|
}
|
|
5215
5229
|
}
|
|
5216
5230
|
const lines = [];
|
|
@@ -5300,6 +5314,7 @@ var STYLE2 = `
|
|
|
5300
5314
|
.lt-inst-local-line { stroke: #1d1d1d; stroke-width: 1; stroke-dasharray: 2 2; }
|
|
5301
5315
|
.lt-pid-valve-body { fill: #ffffff; stroke: #1d1d1d; stroke-width: 1.4; }
|
|
5302
5316
|
|
|
5317
|
+
.lt-pid-line-path { fill: none; }
|
|
5303
5318
|
.lt-pid-line-tag-bg { fill: #ffffff; stroke: #1d1d1d; stroke-width: 0.6; }
|
|
5304
5319
|
.lt-pid-line-tag-text { font: 9px ui-monospace, monospace; fill: #1d1d1d; }
|
|
5305
5320
|
|
|
@@ -5310,15 +5325,37 @@ var STYLE2 = `
|
|
|
5310
5325
|
.lt-pid-unknown-type { font: 9px ui-monospace, monospace; fill: #6a6a6a; }
|
|
5311
5326
|
`;
|
|
5312
5327
|
var ARROW_ID = "lt-pid-arrow";
|
|
5328
|
+
var LINE_CLASS = {
|
|
5329
|
+
process: "lt-pid-process",
|
|
5330
|
+
process_minor: "lt-pid-process-min",
|
|
5331
|
+
pneumatic: "lt-pid-pneumatic",
|
|
5332
|
+
electric: "lt-pid-electric",
|
|
5333
|
+
hydraulic: "lt-pid-hydraulic",
|
|
5334
|
+
capillary: "lt-pid-capillary",
|
|
5335
|
+
software: "lt-pid-software",
|
|
5336
|
+
mechanical: "lt-pid-mechanical"
|
|
5337
|
+
};
|
|
5338
|
+
var SIGNAL_LINE_TYPES = /* @__PURE__ */ new Set([
|
|
5339
|
+
"pneumatic",
|
|
5340
|
+
"electric",
|
|
5341
|
+
"hydraulic",
|
|
5342
|
+
"capillary",
|
|
5343
|
+
"software",
|
|
5344
|
+
"mechanical"
|
|
5345
|
+
]);
|
|
5313
5346
|
function lineClass(t) {
|
|
5314
|
-
return `lt-pid-${t.replace(
|
|
5347
|
+
return LINE_CLASS[t] ?? `lt-pid-${String(t).replace(/_/g, "-")}`;
|
|
5348
|
+
}
|
|
5349
|
+
function isSignalLine(l) {
|
|
5350
|
+
return SIGNAL_LINE_TYPES.has(l.line.lineType);
|
|
5315
5351
|
}
|
|
5316
5352
|
function renderLine(l) {
|
|
5317
5353
|
const cls = lineClass(l.line.lineType);
|
|
5318
5354
|
const parts = [
|
|
5319
5355
|
chunk3WNW5Y7P_cjs.path({
|
|
5320
5356
|
d: l.path,
|
|
5321
|
-
class
|
|
5357
|
+
// Type class + a shared no-fill guard class on every line path.
|
|
5358
|
+
class: `${cls} lt-pid-line-path`,
|
|
5322
5359
|
"data-line-id": l.line.id,
|
|
5323
5360
|
"data-service": l.line.service ?? ""
|
|
5324
5361
|
})
|
|
@@ -5485,9 +5522,16 @@ function renderLayout2(layout) {
|
|
|
5485
5522
|
chunk3WNW5Y7P_cjs.el("style", {}, STYLE2)
|
|
5486
5523
|
]),
|
|
5487
5524
|
titleNode,
|
|
5525
|
+
// Z-order: process pipes behind equipment; signal lines + instruments above.
|
|
5526
|
+
chunk3WNW5Y7P_cjs.group(
|
|
5527
|
+
{ class: "lt-pid-lines lt-pid-process-lines" },
|
|
5528
|
+
layout.lines.filter((l) => !isSignalLine(l)).map(renderLine)
|
|
5529
|
+
),
|
|
5488
5530
|
chunk3WNW5Y7P_cjs.group({ class: "lt-pid-equipment" }, equipNodes),
|
|
5489
|
-
chunk3WNW5Y7P_cjs.group(
|
|
5490
|
-
|
|
5531
|
+
chunk3WNW5Y7P_cjs.group(
|
|
5532
|
+
{ class: "lt-pid-lines lt-pid-signal-lines" },
|
|
5533
|
+
[...layout.lines.filter(isSignalLine).map(renderLine), ...autoSignals]
|
|
5534
|
+
),
|
|
5491
5535
|
chunk3WNW5Y7P_cjs.group({ class: "lt-pid-instruments" }, instNodes)
|
|
5492
5536
|
]
|
|
5493
5537
|
);
|
|
@@ -14907,7 +14951,6 @@ function layoutUmlClass(ast) {
|
|
|
14907
14951
|
n.box.layer = n.rank;
|
|
14908
14952
|
}
|
|
14909
14953
|
}
|
|
14910
|
-
applyDirectionTransform(direction, nodes, boxes);
|
|
14911
14954
|
normaliseCoords(nodes, boxes);
|
|
14912
14955
|
const packages = layoutPackages(ast, boxByID);
|
|
14913
14956
|
shiftForPackages(nodes, boxes, packages);
|
|
@@ -14915,29 +14958,6 @@ function layoutUmlClass(ast) {
|
|
|
14915
14958
|
const { edges, trees } = routeEdges(chains, nodes, boxByID, vertical);
|
|
14916
14959
|
return { ast, boxes, packages, edges, trees, width, height };
|
|
14917
14960
|
}
|
|
14918
|
-
function applyDirectionTransform(direction, nodes, boxes) {
|
|
14919
|
-
if (direction === "tb") return;
|
|
14920
|
-
const transform = (p) => {
|
|
14921
|
-
switch (direction) {
|
|
14922
|
-
case "bt":
|
|
14923
|
-
return { x: p.x, y: -p.y };
|
|
14924
|
-
case "lr":
|
|
14925
|
-
return { x: p.y, y: p.x };
|
|
14926
|
-
case "rl":
|
|
14927
|
-
return { x: -p.y, y: p.x };
|
|
14928
|
-
}
|
|
14929
|
-
};
|
|
14930
|
-
for (const n of nodes) {
|
|
14931
|
-
const p = transform({ x: n.cx, y: n.cy });
|
|
14932
|
-
n.cx = p.x;
|
|
14933
|
-
n.cy = p.y;
|
|
14934
|
-
}
|
|
14935
|
-
for (const b of boxes) {
|
|
14936
|
-
const c = transform({ x: b.x + b.width / 2, y: b.y + b.height / 2 });
|
|
14937
|
-
b.x = c.x - b.width / 2;
|
|
14938
|
-
b.y = c.y - b.height / 2;
|
|
14939
|
-
}
|
|
14940
|
-
}
|
|
14941
14961
|
function topLevelPackageMap(ast) {
|
|
14942
14962
|
const parentOf = /* @__PURE__ */ new Map();
|
|
14943
14963
|
for (const p of ast.packages) parentOf.set(p.id, p.parentId);
|
|
@@ -16213,14 +16233,12 @@ function parseFaultTree(text2) {
|
|
|
16213
16233
|
}
|
|
16214
16234
|
if (/^layout\s*:/i.test(t)) {
|
|
16215
16235
|
const v = afterColon2(t).toLowerCase();
|
|
16216
|
-
if (v === "tb") ast.direction = v;
|
|
16217
|
-
else if (v === "bt") ast.warnings.push(`Line ${lineNo}: layout: bt is reserved but not implemented yet; using layout: tb.`);
|
|
16236
|
+
if (v === "tb" || v === "bt") ast.direction = v;
|
|
16218
16237
|
continue;
|
|
16219
16238
|
}
|
|
16220
16239
|
if (/^style\s*:/i.test(t)) {
|
|
16221
16240
|
const v = afterColon2(t).toLowerCase();
|
|
16222
|
-
if (v === "ansi") ast.gateStyle = v;
|
|
16223
|
-
else if (v === "iec") ast.warnings.push(`Line ${lineNo}: style: iec is reserved but not implemented yet; using style: ansi.`);
|
|
16241
|
+
if (v === "ansi" || v === "iec") ast.gateStyle = v;
|
|
16224
16242
|
continue;
|
|
16225
16243
|
}
|
|
16226
16244
|
if (/^transfer\b/i.test(t)) {
|
|
@@ -17254,7 +17272,6 @@ function summarise(layout) {
|
|
|
17254
17272
|
if (analysis.topProb !== void 0) parts.push(`P(top) = ${fmtProb(analysis.topProb)} (${analysis.method}).`);
|
|
17255
17273
|
else if (analysis.missingProb.length > 0) parts.push(`P(top) = n/a \u2014 missing p on ${analysis.missingProb.join(", ")}.`);
|
|
17256
17274
|
}
|
|
17257
|
-
for (const w of ast.warnings) parts.push(w);
|
|
17258
17275
|
for (const n of analysis.notes) parts.push(n);
|
|
17259
17276
|
for (const w of analysis.warnings) parts.push(w);
|
|
17260
17277
|
return parts.join(" ");
|
|
@@ -17351,8 +17368,7 @@ function parseBowtie(text2) {
|
|
|
17351
17368
|
const lineNo = i + 1;
|
|
17352
17369
|
if (/^layout\s*:/i.test(t)) {
|
|
17353
17370
|
const v = afterColon3(t).toLowerCase();
|
|
17354
|
-
if (v === "symmetric") ast.layout = v;
|
|
17355
|
-
else if (v === "compact") ast.warnings.push(`Line ${lineNo}: layout: compact is reserved but not implemented yet; using layout: symmetric.`);
|
|
17371
|
+
if (v === "symmetric" || v === "compact") ast.layout = v;
|
|
17356
17372
|
continue;
|
|
17357
17373
|
}
|
|
17358
17374
|
if (/^legend\s*:/i.test(t)) {
|
|
@@ -26763,5 +26779,5 @@ exports.state = state;
|
|
|
26763
26779
|
exports.timeline = timeline;
|
|
26764
26780
|
exports.umlclass = umlclass;
|
|
26765
26781
|
exports.usecase = usecase;
|
|
26766
|
-
//# sourceMappingURL=chunk-
|
|
26767
|
-
//# sourceMappingURL=chunk-
|
|
26782
|
+
//# sourceMappingURL=chunk-3YRYBTLG.cjs.map
|
|
26783
|
+
//# sourceMappingURL=chunk-3YRYBTLG.cjs.map
|