schematex 0.9.5 → 0.9.6
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 +19 -0
- package/dist/ai/ai-sdk.cjs +7 -7
- package/dist/ai/ai-sdk.js +2 -2
- package/dist/ai/index.cjs +16 -16
- package/dist/ai/index.js +3 -3
- package/dist/browser.cjs +8 -8
- package/dist/browser.js +2 -2
- package/dist/{chunk-LMNWUZMD.js → chunk-4W75FGWO.js} +473 -70
- package/dist/chunk-4W75FGWO.js.map +1 -0
- package/dist/{chunk-N524SY5D.js → chunk-CVTHUOAM.js} +84 -14
- package/dist/chunk-CVTHUOAM.js.map +1 -0
- package/dist/{chunk-7EWP4OD7.cjs → chunk-HX64QWB6.cjs} +86 -16
- package/dist/chunk-HX64QWB6.cjs.map +1 -0
- package/dist/{chunk-Q7CWX6HA.cjs → chunk-KH5GRKUM.cjs} +473 -70
- package/dist/chunk-KH5GRKUM.cjs.map +1 -0
- package/dist/index.cjs +34 -34
- package/dist/index.js +2 -2
- package/dist/react.cjs +2 -2
- package/dist/react.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-7EWP4OD7.cjs.map +0 -1
- package/dist/chunk-LMNWUZMD.js.map +0 -1
- package/dist/chunk-N524SY5D.js.map +0 -1
- package/dist/chunk-Q7CWX6HA.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseResult, renderResult } from './chunk-
|
|
1
|
+
import { parseResult, renderResult } from './chunk-4W75FGWO.js';
|
|
2
2
|
|
|
3
3
|
// src/ai/registry.ts
|
|
4
4
|
var DIAGRAM_REGISTRY = [
|
|
@@ -256,12 +256,34 @@ var DIAGRAM_REGISTRY = [
|
|
|
256
256
|
// ── Project management / scheduling ──────────────────────────
|
|
257
257
|
{
|
|
258
258
|
type: "pert",
|
|
259
|
-
name: "PERT / CPM network",
|
|
260
|
-
tagline: "Activity-on-node project schedule that computes ES/EF/LS/LF, slack, and the critical path.",
|
|
261
|
-
useWhen: "Use whenever the user mentions 'PERT', 'CPM', 'critical path', 'project network', 'precedence diagram', or wants a project schedule from tasks + durations + dependencies. Unlike a flowchart, this engine *computes* the schedule: write `task <id> \"label\" duration: <n> after: <preds>` and it runs the forward/backward pass and returns Early/Late Start & Finish, total slack, project duration, and highlights the critical path in red. Supports PDM dependency types (FS/SS/FF/SF) with lag/lead (`after: A SS+2d`), three-point estimation (`duration: 4/6/10` \u2192 te + variance),
|
|
259
|
+
name: "PERT / CPM network & Gantt chart",
|
|
260
|
+
tagline: "Activity-on-node project schedule that computes ES/EF/LS/LF, slack, and the critical path \u2014 rendered as a network, a timescale, or a calendar Gantt.",
|
|
261
|
+
useWhen: "Use whenever the user mentions 'PERT', 'CPM', 'critical path', 'Gantt chart', 'project schedule', 'project network', 'precedence diagram', or wants a project schedule from tasks + durations + dependencies. Unlike a flowchart, this engine *computes* the schedule: write `task <id> \"label\" duration: <n> after: <preds>` and it runs the forward/backward pass and returns Early/Late Start & Finish, total slack, project duration, and highlights the critical path in red. **For a Gantt chart use the `gantt` header (or `layout: gantt`)** \u2014 bars are placed from the computed ES/EF (not typed-in dates, the way Mermaid requires), one task per row, grouped into sections by `lane:`, with a calendar date axis from `start: YYYY-MM-DD` (`calendar: continuous`|`5day` to exclude weekends), `progress: 60%` overlays, `milestone` diamonds, dependency connectors, an optional `today:` marker, and the critical path drawn in red. Supports PDM dependency types (FS/SS/FF/SF) with lag/lead (`after: A SS+2d`), three-point estimation (`duration: 4/6/10` \u2192 te + variance), a `layout: timescaled` mode, and a legacy `layout: aoa` mode (activity-on-arrow). Distinct from `flowchart` (no scheduling), `timeline` (no critical-path computation), and `bpmn` (organisational process, not a one-off schedule).",
|
|
262
262
|
cluster: "project-management",
|
|
263
|
-
standard: "PMI PMBOK 7 + Moder 1983 (AON/PDM); see 32-PERT-STANDARD.md",
|
|
264
|
-
syntaxKey: "pert"
|
|
263
|
+
standard: "PMI PMBOK 7 + Moder 1983 (AON/PDM); Gantt 1910; see 32-PERT-STANDARD.md",
|
|
264
|
+
syntaxKey: "pert",
|
|
265
|
+
aliases: [
|
|
266
|
+
"PERT chart",
|
|
267
|
+
"CPM",
|
|
268
|
+
"critical path method",
|
|
269
|
+
"Gantt chart",
|
|
270
|
+
"gantt",
|
|
271
|
+
"project schedule",
|
|
272
|
+
"precedence diagram",
|
|
273
|
+
"\u7518\u7279\u56FE"
|
|
274
|
+
],
|
|
275
|
+
keywords: [
|
|
276
|
+
"critical path",
|
|
277
|
+
"project management",
|
|
278
|
+
"project schedule",
|
|
279
|
+
"task dependencies",
|
|
280
|
+
"gantt chart maker",
|
|
281
|
+
"project timeline",
|
|
282
|
+
"forward backward pass",
|
|
283
|
+
"slack float",
|
|
284
|
+
"milestone",
|
|
285
|
+
"PMBOK"
|
|
286
|
+
]
|
|
265
287
|
},
|
|
266
288
|
// ── Structural UML ───────────────────────────────────────────
|
|
267
289
|
{
|
|
@@ -2052,6 +2074,45 @@ If the LED doesn't light up, three things to check, in order: LED polarity (the
|
|
|
2052
2074
|
"dsl": 'fmea "Injection moulding PFMEA"\n type: process\n rank: rpn\n flag: rpn > 100\n item "Mould fill step" fn "Fill cavity with melt"\n mode "Short shot"\n effect "Incomplete part scrapped" sev: 7\n cause "Injection pressure too low" occ: 5\n controls prevention: "Pressure setpoint lock", detection: "Vision check" det: 4\n cause "Blocked gate" occ: 3\n controls detection: "Cycle-time monitor" det: 6\n item "Cooling step" fn "Solidify part to spec"\n mode "Warpage"\n effect "Out-of-tolerance dimension" sev: 6\n cause "Uneven cooling channel flow" occ: 6\n controls detection: "CMM sampling" det: 7',
|
|
2053
2075
|
"notes": "## What this shows\n\nA process FMEA (PFMEA) following the steps of an injection-moulding line \u2014 the fill step and the cooling step \u2014 rather than the parts of a product. Each process step gets its failure modes (short shot, warpage), the effect each has on the part, the process causes behind it, and the in-line controls that prevent or detect it.\n\nThis worksheet is ranked the legacy way with `rank: rpn`, so the engine sorts purely on RPN = S \xD7 O \xD7 D and the `flag: rpn > 100` directive lights up every row above 100 \u2014 here the uneven-cooling warpage row at S6\xB7O6\xB7D7 (RPN 252) and the short-shot pressure row at S7\xB7O5\xB7D4 (RPN 140). Each rendered row carries `data-rpn` and `data-ap`, so even on a legacy RPN worksheet the AIAG-VDA Action Priority is still computed and inspectable underneath."
|
|
2054
2076
|
},
|
|
2077
|
+
{
|
|
2078
|
+
"slug": "gantt-construction-schedule",
|
|
2079
|
+
"diagram": "pert",
|
|
2080
|
+
"title": "Construction schedule (Gantt, computed critical path)",
|
|
2081
|
+
"description": "A residential construction Gantt on a continuous calendar \u2014 excavation through handover. The engine computes the critical path (excavation \u2192 foundation \u2192 framing \u2192 electrical \u2192 drywall \u2192 finishes \u2192 handover) and shows the float on the parallel roofing and plumbing trades.",
|
|
2082
|
+
"standard": "PMI PMBOK 7 (critical path) + Gantt 1910",
|
|
2083
|
+
"tags": [
|
|
2084
|
+
"gantt",
|
|
2085
|
+
"pert",
|
|
2086
|
+
"cpm",
|
|
2087
|
+
"critical-path",
|
|
2088
|
+
"construction",
|
|
2089
|
+
"project-schedule"
|
|
2090
|
+
],
|
|
2091
|
+
"complexity": 3,
|
|
2092
|
+
"featured": false,
|
|
2093
|
+
"dsl": 'gantt "Residential Build"\n start: 2026-09-01\n calendar: continuous\n task EXC "Excavation" duration: 6\n task FND "Foundation" duration: 8 after: EXC\n task FRM "Framing" duration: 12 after: FND\n task ROOF "Roofing" duration: 6 after: FRM\n task ELEC "Electrical" duration: 8 after: FRM\n task PLMB "Plumbing" duration: 7 after: FRM\n task DRY "Drywall" duration: 6 after: ELEC, PLMB, ROOF\n task FIN "Finishes" duration: 10 after: DRY\n task HAND "Handover" milestone after: FIN',
|
|
2094
|
+
"notes": "## What this shows\n\nOnce framing finishes, three trades \u2014 **roofing, electrical, plumbing** \u2014 run in parallel, but drywall can't start until all three are done. The engine works out that **electrical** is the longest of the three, so it lands on the critical path while roofing and plumbing carry float (drawn in blue with their slack). The critical chain `Excavation \u2192 Foundation \u2192 Framing \u2192 Electrical \u2192 Drywall \u2192 Finishes \u2192 Handover` is in red, and `Handover` is a milestone diamond. On a `continuous` calendar the bars span weekends; switch to `calendar: 5day` for a working-day timeline."
|
|
2095
|
+
},
|
|
2096
|
+
{
|
|
2097
|
+
"slug": "gantt-website-relaunch",
|
|
2098
|
+
"diagram": "pert",
|
|
2099
|
+
"title": "Gantt chart with computed critical path (website relaunch)",
|
|
2100
|
+
"description": "A calendar Gantt for a website relaunch \u2014 sections, a weekday-only date axis, progress overlays, a milestone, and a today marker. The bars are placed from the engine's computed schedule, so the critical path is highlighted in red and off-path tasks show their slack \u2014 something a hand-placed (Mermaid) Gantt can't do.",
|
|
2101
|
+
"standard": "PMI PMBOK 7 (critical path) + Gantt 1910",
|
|
2102
|
+
"tags": [
|
|
2103
|
+
"gantt",
|
|
2104
|
+
"pert",
|
|
2105
|
+
"cpm",
|
|
2106
|
+
"critical-path",
|
|
2107
|
+
"project-schedule",
|
|
2108
|
+
"milestone",
|
|
2109
|
+
"calendar"
|
|
2110
|
+
],
|
|
2111
|
+
"complexity": 3,
|
|
2112
|
+
"featured": true,
|
|
2113
|
+
"dsl": 'gantt "Website Relaunch"\n start: 2026-07-01\n calendar: 5day\n task A "Discovery" duration: 5 lane: "Plan"\n task B "Wireframes" duration: 8 after: A lane: "Design"\n task C "Visual design" duration: 6 after: B lane: "Design" progress: 40%\n task D "Frontend build" duration: 12 after: C lane: "Build"\n task E "Backend API" duration: 10 after: A lane: "Build"\n task F "Integration & QA" duration: 5 after: D, E lane: "Build"\n task LAUNCH "Go live" milestone after: F lane: "Build"\n today: 2026-07-20',
|
|
2114
|
+
"notes": '## What this shows\n\nA real Gantt chart where **you type dependencies, not dates**. Each task declares a duration and what it comes `after:`; the engine runs the forward/backward pass and *places the bars* from the computed Early Start / Early Finish.\n\n**The critical path is computed and drawn in red** \u2014 `A \u2192 B \u2192 C \u2192 D \u2192 F \u2192 Go live`. "Backend API" runs in parallel off the critical path, so it\'s drawn in the resting blue with its **slack** annotated: you can start it 16 working days late without slipping the launch. The `5day` calendar excludes weekends from the timeline, `lane:` bands the rows into Plan / Design / Build sections, the 40 % progress overlay marks how far Visual design has got, and the dashed **today** line shows where the project stands. This is the differentiator over a typed Gantt: change one duration and the whole schedule \u2014 and the critical path \u2014 recomputes.'
|
|
2115
|
+
},
|
|
2055
2116
|
{
|
|
2056
2117
|
"slug": "genogram-brca-cancer",
|
|
2057
2118
|
"diagram": "genogram",
|
|
@@ -4457,7 +4518,7 @@ var SYNTAX = {
|
|
|
4457
4518
|
},
|
|
4458
4519
|
"pert": {
|
|
4459
4520
|
"title": "PERT / CPM Network",
|
|
4460
|
-
"content": '## 1. Your first diagram\n\nEvery document starts with the `pert` keyword, an optional header, then one `task` line per activity:\n\n```\npert\nunit: days\n\ntask A "Market research" duration: 5\ntask B "Design mockups" duration: 8 after: A\ntask C "Backend API" duration: 15 after: A\ntask D "Frontend build" duration: 10 after: B, C\n```\n\nEach task carries an `<id>`, a quoted `<label>`, a `duration:`, and an optional `after:` list of predecessors. The engine adds an invisible Start and Finish, runs the schedule, and draws the six-field activity box for every task. You never type ES/EF/LS/LF \u2014 they are computed.\n\nThe header accepts:\n\n- `title: "\u2026"` \u2014 a heading drawn above the diagram.\n- `unit: days | weeks | hours | abstract` \u2014 the time unit (default `days`; purely a label, the engine is calendar-agnostic).\n- `direction: LR | TB` \u2014 left-to-right (default) or top-to-bottom.\n- `layout: network | timescaled` \u2014 the layered network (default) or a time-proportional view (\xA76).\n- `critical-tolerance: <n>` \u2014 slack \u2264 this counts as critical (default `0`; set `0.001` for three-point projects).\n- `show-sentinels: true` \u2014 draw the synthetic Start / Finish nodes (hidden by default).\n\n---\n\n## 2. The six-field activity box\n\nEvery task renders as the canonical 3\xD72 PERT/CPM rectangle:\n\n```\n\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 ES \u2502 Duration \u2502 EF \u2502\n\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 Task Name (ID) \u2502\n\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 LS \u2502 Slack \u2502 LF \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n- **ES / EF** \u2014 Early Start / Early Finish, from the forward pass.\n- **LS / LF** \u2014 Late Start / Late Finish, from the backward pass.\n- **Slack** (total float) = LS \u2212 ES = LF \u2212 EF. Zero slack means the activity is on the critical path.\n\nCritical activities get a **red border** and a bold `0` slack; the project\'s critical chain reads as an unbroken red line. Every field is also mirrored onto `data-*` attributes (`data-es`, `data-slack`, `data-critical`, \u2026) so you can query the SVG without re-running the math.\n\n**On the two-colour palette.** A PERT chart is deliberately drawn in just two colours. Red for the critical path is a genuine industry convention \u2014 MS Project, Oracle Primavera P6, and PMBOK figures all use it, because "critical vs. not" is the one distinction the diagram exists to surface. Everything else stays a neutral house-blue. Adding more colours would imply categories that PERT\'s semantics don\'t have; if you need to group by team or phase, use [swimlanes](#7-swimlanes-tags-classes-and-comments) (`lane:`) instead of colour.\n\n---\n\n## 3. Dependencies (FS / SS / FF / SF + lag/lead)\n\n`after:` takes a comma-separated list of predecessor references. The default relationship is **Finish-to-Start (FS)** \u2014 a task starts once its predecessor finishes:\n\n```\ntask D "Frontend build" duration: 10 after: B, C\n```\n\nModern scheduling needs the other three Precedence-Diagramming relationships and **lag** (delay) or **lead** (negative lag):\n\n```\ntask B "Stakeholder interviews" duration: 6 after: A SS+1 # start 1d after A starts\ntask I "Documentation" duration: 4 after: D+3 # FS with a 3-day lag\ntask J "Translation" duration: 3 after: I SS-1 # start 1d before I starts (lead)\ntask K "Sign-off" duration: 1 after: I FF # finishes when I finishes\ntask L "Press release" duration: 2 after: G SF+1 # start-to-finish (rare)\n```\n\n| Form | Meaning |\n|------|---------|\n| `after: A` | Finish-to-Start, no lag (the common case) |\n| `after: A+2` or `after: A+2d` | FS with a 2-unit lag |\n| `after: A SS` / `A FF` / `A SF` | Start-to-Start / Finish-to-Finish / Start-to-Finish |\n| `after: A SS+2d` / `A FF-1d` | any type with lag (`+`) or lead (`-`) |\n\nA lag unit suffix (`d` / `w` / `h`) must match the diagram\'s `unit:` or be omitted; mixed units are rejected. FS with zero lag is unlabelled; SS/FF/SF always show their type on the edge.\n\n---\n\n## 4. Three-point (PERT) estimation\n\nWrite a duration as `O/M/P` (optimistic / most-likely / pessimistic) and the engine computes the beta-distribution expected duration **te = (O + 4M + P) / 6** and the variance **\u03C3\xB2 = ((P \u2212 O)/6)\xB2**:\n\n```\npert\ncritical-tolerance: 0.01\ntask A "Spec" duration: 2/3/5 # te = 3.17, \u03C3\xB2 = 0.25\ntask B "Build" duration: 5/8/14 after: A # te = 8.50, \u03C3\xB2 = 2.25\ntask C "Test" duration: 3/4/6 after: B\ntask D "Deploy" duration: 1/2/3 after: C\n```\n\nThe Duration field shows `te`; a small `\u03C3=\u2026` annotation appears under the name; and the project-level standard deviation (\u221A of the summed critical-path variances) is reported in the footer. Use `critical-tolerance: 0.01` so floating-point `te` values don\'t displace the visible critical path.\n\n---\n\n## 5. Milestones\n\nA milestone is a zero-duration checkpoint, drawn as a diamond. Use the `milestone` flag or `duration: 0`:\n\n```\ntask P "Cutover weekend" milestone after: O\ntask Q "Go-live" duration: 0 after: P\n```\n\n---\n\n## 6. Time-scaled layout\n\n`layout: timescaled` switches from the layered network to a network-Gantt hybrid: each activity\'s **x-position is proportional to its ES** and its **width is proportional to its duration**, with a unit time axis along the bottom. Activities are packed into lanes so nothing overlaps.\n\n```\npert\nlayout: timescaled\nunit: days\n\ntask A "Inventory" duration: 5\ntask B "Interviews" duration: 6 after: A SS+1\ntask C "Design" duration: 10 after: A, B\ntask D "Build" duration: 15 after: C\ntask E "Pilot" duration: 7 after: D\n```\n\nThis is a bridge to a Gantt view, not a replacement: there\'s no calendar, working-time mask, or resource swimlane.\n\n### Activity-on-arrow (`layout: aoa`)\n\n`layout: aoa` renders the older **activity-on-arrow** (ADM) notation you\'ll find in textbooks and on Investopedia: numbered **event** circles, **activities as labelled arrows**, and dotted **dummy activities** auto-inserted wherever an activity has two or more predecessors. You write the same activity-on-node DSL \u2014 Schematex builds the event graph and numbers the events for you.\n\n```\npert\nlayout: aoa\nunit: days\n\ntask A "create schedule" duration: 10\ntask B "buy hardware" duration: 5\ntask C "programming" duration: 20 after: A\ntask D "installation" duration: 5 after: B\ntask E "conversion" duration: 15 after: D\ntask F "test code" duration: 20 after: C, E\ntask G "write manual" duration: 15 after: E\n```\n\nAOA is a **legacy** notation (PMBOK 7 dropped it; AON is the modern standard) and it can only express **finish-to-start** logic \u2014 SS/FF/SF and lag/lead are flattened to FS with a warning. Use it for teaching, exam prep, or matching an existing textbook figure; use the default `network` (AON) layout for real scheduling.\n\n---\n\n## 7. Swimlanes, tags, classes, and comments\n\nAdd `lane: "\u2026"` to any task and the network re-groups into horizontal swimlanes \u2014 by responsible team, phase, or owner \u2014 while still computing the schedule exactly as before:\n\n```\ntask T1 "Support Account Deletion" duration: 3 lane: "Customer Account"\ntask T2 "Design a New Theme" duration: 8 lane: "Shopping Site"\ntask T3 "Apply New Theme" duration: 15 after: T2 lane: "Shopping Site"\n```\n\nLanes appear in first-declared order, each as a banded row with a label gutter on the left. Swimlanes are a presentation of the same AON network, not a different layout mode \u2014 they activate automatically when any task declares a lane.\n\n```\ntask X "External vendor work" duration: 10 after: A tags: vendor, external class: secondary\n# this is a comment\n```\n\n`tags:` emit `data-tag="\u2026"` on the node group and `class:` adds a CSS class for downstream theming. `#` and `//` start a comment to end of line.\n\n---\n\n## 8. Grammar (EBNF)\n\n```text\ndocument = "pert" NEWLINE header* task+\nheader = "title:" quoted\n | "unit:" ("days" | "weeks" | "hours" | "abstract")\n | "direction:" ("LR" | "TB")\n | "layout:" ("network" | "timescaled" | "aoa")\n | "critical-tolerance:" number\n | "show-sentinels:" boolean\n\ntask = "task" IDENT quoted "duration:" duration ("after:" reflist)? "milestone"? attrs?\n | "task" IDENT quoted "milestone" ("after:" reflist)? attrs?\nduration = number | number "/" number "/" number ; deterministic or O/M/P\nreflist = ref ("," ref)*\nref = IDENT (WS deptype)? laglead?\n | IDENT "+" number unit? ; attached FS lag sugar\ndeptype = "FS" | "SS" | "FF" | "SF"\nlaglead = ("+" | "-") number unit?\nunit = "d" | "w" | "h"\nattrs = ("tags:" idlist)? ("class:" IDENT)? ("lane:" quoted)?\n```\n\n---'
|
|
4521
|
+
"content": '## 1. Your first diagram\n\nEvery document starts with the `pert` keyword, an optional header, then one `task` line per activity:\n\n```\npert\nunit: days\n\ntask A "Market research" duration: 5\ntask B "Design mockups" duration: 8 after: A\ntask C "Backend API" duration: 15 after: A\ntask D "Frontend build" duration: 10 after: B, C\n```\n\nEach task carries an `<id>`, a quoted `<label>`, a `duration:`, and an optional `after:` list of predecessors. The engine adds an invisible Start and Finish, runs the schedule, and draws the six-field activity box for every task. You never type ES/EF/LS/LF \u2014 they are computed.\n\nThe header accepts:\n\n- `title: "\u2026"` \u2014 a heading drawn above the diagram.\n- `unit: days | weeks | hours | abstract` \u2014 the time unit (default `days`; purely a label, the engine is calendar-agnostic).\n- `direction: LR | TB` \u2014 left-to-right (default) or top-to-bottom.\n- `layout: network | timescaled` \u2014 the layered network (default) or a time-proportional view (\xA76).\n- `critical-tolerance: <n>` \u2014 slack \u2264 this counts as critical (default `0`; set `0.001` for three-point projects).\n- `show-sentinels: true` \u2014 draw the synthetic Start / Finish nodes (hidden by default).\n\n---\n\n## 2. The six-field activity box\n\nEvery task renders as the canonical 3\xD72 PERT/CPM rectangle:\n\n```\n\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 ES \u2502 Duration \u2502 EF \u2502\n\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 Task Name (ID) \u2502\n\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 LS \u2502 Slack \u2502 LF \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n- **ES / EF** \u2014 Early Start / Early Finish, from the forward pass.\n- **LS / LF** \u2014 Late Start / Late Finish, from the backward pass.\n- **Slack** (total float) = LS \u2212 ES = LF \u2212 EF. Zero slack means the activity is on the critical path.\n\nCritical activities get a **red border** and a bold `0` slack; the project\'s critical chain reads as an unbroken red line. Every field is also mirrored onto `data-*` attributes (`data-es`, `data-slack`, `data-critical`, \u2026) so you can query the SVG without re-running the math.\n\n**On the two-colour palette.** A PERT chart is deliberately drawn in just two colours. Red for the critical path is a genuine industry convention \u2014 MS Project, Oracle Primavera P6, and PMBOK figures all use it, because "critical vs. not" is the one distinction the diagram exists to surface. Everything else stays a neutral house-blue. Adding more colours would imply categories that PERT\'s semantics don\'t have; if you need to group by team or phase, use [swimlanes](#7-swimlanes-tags-classes-and-comments) (`lane:`) instead of colour.\n\n---\n\n## 3. Dependencies (FS / SS / FF / SF + lag/lead)\n\n`after:` takes a comma-separated list of predecessor references. The default relationship is **Finish-to-Start (FS)** \u2014 a task starts once its predecessor finishes:\n\n```\ntask D "Frontend build" duration: 10 after: B, C\n```\n\nModern scheduling needs the other three Precedence-Diagramming relationships and **lag** (delay) or **lead** (negative lag):\n\n```\ntask B "Stakeholder interviews" duration: 6 after: A SS+1 # start 1d after A starts\ntask I "Documentation" duration: 4 after: D+3 # FS with a 3-day lag\ntask J "Translation" duration: 3 after: I SS-1 # start 1d before I starts (lead)\ntask K "Sign-off" duration: 1 after: I FF # finishes when I finishes\ntask L "Press release" duration: 2 after: G SF+1 # start-to-finish (rare)\n```\n\n| Form | Meaning |\n|------|---------|\n| `after: A` | Finish-to-Start, no lag (the common case) |\n| `after: A+2` or `after: A+2d` | FS with a 2-unit lag |\n| `after: A SS` / `A FF` / `A SF` | Start-to-Start / Finish-to-Finish / Start-to-Finish |\n| `after: A SS+2d` / `A FF-1d` | any type with lag (`+`) or lead (`-`) |\n\nA lag unit suffix (`d` / `w` / `h`) must match the diagram\'s `unit:` or be omitted; mixed units are rejected. FS with zero lag is unlabelled; SS/FF/SF always show their type on the edge.\n\n---\n\n## 4. Three-point (PERT) estimation\n\nWrite a duration as `O/M/P` (optimistic / most-likely / pessimistic) and the engine computes the beta-distribution expected duration **te = (O + 4M + P) / 6** and the variance **\u03C3\xB2 = ((P \u2212 O)/6)\xB2**:\n\n```\npert\ncritical-tolerance: 0.01\ntask A "Spec" duration: 2/3/5 # te = 3.17, \u03C3\xB2 = 0.25\ntask B "Build" duration: 5/8/14 after: A # te = 8.50, \u03C3\xB2 = 2.25\ntask C "Test" duration: 3/4/6 after: B\ntask D "Deploy" duration: 1/2/3 after: C\n```\n\nThe Duration field shows `te`; a small `\u03C3=\u2026` annotation appears under the name; and the project-level standard deviation (\u221A of the summed critical-path variances) is reported in the footer. Use `critical-tolerance: 0.01` so floating-point `te` values don\'t displace the visible critical path.\n\n---\n\n## 5. Milestones\n\nA milestone is a zero-duration checkpoint, drawn as a diamond. Use the `milestone` flag or `duration: 0`:\n\n```\ntask P "Cutover weekend" milestone after: O\ntask Q "Go-live" duration: 0 after: P\n```\n\n---\n\n## 6. Time-scaled layout\n\n`layout: timescaled` switches from the layered network to a network-Gantt hybrid: each activity\'s **x-position is proportional to its ES** and its **width is proportional to its duration**, with a unit time axis along the bottom. Activities are packed into lanes so nothing overlaps.\n\n```\npert\nlayout: timescaled\nunit: days\n\ntask A "Inventory" duration: 5\ntask B "Interviews" duration: 6 after: A SS+1\ntask C "Design" duration: 10 after: A, B\ntask D "Build" duration: 15 after: C\ntask E "Pilot" duration: 7 after: D\n```\n\nThis is the network-flavoured time view; for a calendar Gantt chart with one row per task, use `layout: gantt` (next).\n\n### Gantt chart (`gantt` / `layout: gantt`)\n\nStart a document with the **`gantt`** header (sugar for `pert` + `layout: gantt`) for a calendar Gantt. It is the *same scheduler* \u2014 so the bars are placed from the **computed** ES/EF, and the **critical path is drawn in red**, the thing a hand-placed Gantt (Mermaid) can\'t do: there you type the dates yourself, here you type dependencies and the engine schedules them.\n\n```\ngantt "Website Relaunch"\nstart: 2026-07-01\ncalendar: 5day\ntask A "Discovery" duration: 5 lane: "Plan"\ntask B "Wireframes" duration: 8 after: A lane: "Design"\ntask C "Visual design" duration: 6 after: B lane: "Design" progress: 40%\ntask D "Frontend build" duration: 12 after: C lane: "Build"\ntask E "Backend API" duration: 10 after: A lane: "Build"\ntask F "Integration" duration: 5 after: D, E lane: "Build"\ntask LAUNCH "Go live" milestone after: F lane: "Build"\ntoday: 2026-07-20\n```\n\n- **`start: YYYY-MM-DD`** turns the axis into calendar dates (omit it for a numeric day-offset axis).\n- **`calendar: continuous`** (default) spans weekends; **`calendar: 5day`** excludes Sat/Sun from the timeline.\n- **`lane: "\u2026"`** groups tasks into labelled **sections**; **`progress: 60%`** draws a completion overlay; **`milestone`** is a diamond; **`today: YYYY-MM-DD`** drops a marker line.\n- One row per task, in declaration order. Off-critical-path bars are drawn in the resting blue with their **slack** annotated; critical bars are red.\n\n### Activity-on-arrow (`layout: aoa`)\n\n`layout: aoa` renders the older **activity-on-arrow** (ADM) notation you\'ll find in textbooks and on Investopedia: numbered **event** circles, **activities as labelled arrows**, and dotted **dummy activities** auto-inserted wherever an activity has two or more predecessors. You write the same activity-on-node DSL \u2014 Schematex builds the event graph and numbers the events for you.\n\n```\npert\nlayout: aoa\nunit: days\n\ntask A "create schedule" duration: 10\ntask B "buy hardware" duration: 5\ntask C "programming" duration: 20 after: A\ntask D "installation" duration: 5 after: B\ntask E "conversion" duration: 15 after: D\ntask F "test code" duration: 20 after: C, E\ntask G "write manual" duration: 15 after: E\n```\n\nAOA is a **legacy** notation (PMBOK 7 dropped it; AON is the modern standard) and it can only express **finish-to-start** logic \u2014 SS/FF/SF and lag/lead are flattened to FS with a warning. Use it for teaching, exam prep, or matching an existing textbook figure; use the default `network` (AON) layout for real scheduling.\n\n---\n\n## 7. Swimlanes, tags, classes, and comments\n\nAdd `lane: "\u2026"` to any task and the network re-groups into horizontal swimlanes \u2014 by responsible team, phase, or owner \u2014 while still computing the schedule exactly as before:\n\n```\ntask T1 "Support Account Deletion" duration: 3 lane: "Customer Account"\ntask T2 "Design a New Theme" duration: 8 lane: "Shopping Site"\ntask T3 "Apply New Theme" duration: 15 after: T2 lane: "Shopping Site"\n```\n\nLanes appear in first-declared order, each as a banded row with a label gutter on the left. Swimlanes are a presentation of the same AON network, not a different layout mode \u2014 they activate automatically when any task declares a lane.\n\n```\ntask X "External vendor work" duration: 10 after: A tags: vendor, external class: secondary\n# this is a comment\n```\n\n`tags:` emit `data-tag="\u2026"` on the node group and `class:` adds a CSS class for downstream theming. `#` and `//` start a comment to end of line.\n\n---\n\n## 8. Grammar (EBNF)\n\n```text\ndocument = "pert" NEWLINE header* task+\nheader = "title:" quoted\n | "unit:" ("days" | "weeks" | "hours" | "abstract")\n | "direction:" ("LR" | "TB")\n | "layout:" ("network" | "timescaled" | "aoa")\n | "critical-tolerance:" number\n | "show-sentinels:" boolean\n\ntask = "task" IDENT quoted "duration:" duration ("after:" reflist)? "milestone"? attrs?\n | "task" IDENT quoted "milestone" ("after:" reflist)? attrs?\nduration = number | number "/" number "/" number ; deterministic or O/M/P\nreflist = ref ("," ref)*\nref = IDENT (WS deptype)? laglead?\n | IDENT "+" number unit? ; attached FS lag sugar\ndeptype = "FS" | "SS" | "FF" | "SF"\nlaglead = ("+" | "-") number unit?\nunit = "d" | "w" | "h"\nattrs = ("tags:" idlist)? ("class:" IDENT)? ("lane:" quoted)?\n```\n\n---'
|
|
4461
4522
|
},
|
|
4462
4523
|
"petri": {
|
|
4463
4524
|
"title": "Petri Net",
|
|
@@ -5508,9 +5569,9 @@ var PROFILES = {
|
|
|
5508
5569
|
},
|
|
5509
5570
|
pert: {
|
|
5510
5571
|
type: "pert",
|
|
5511
|
-
header: "pert",
|
|
5512
|
-
mode: "AON tasks with computed schedule (ES/EF/LS/LF/slack/critical path)",
|
|
5513
|
-
keywords: 'pert \xB7 title: "\u2026" \xB7 unit: days|weeks|hours|abstract \xB7 direction: LR|TB \xB7 layout: network|timescaled|aoa \xB7 critical-tolerance: N \xB7 task ID "label" duration: N|O/M/P [after: ref,\u2026] [milestone] [lane: "
|
|
5572
|
+
header: "pert (or `gantt` for a Gantt chart)",
|
|
5573
|
+
mode: "AON tasks with computed schedule (ES/EF/LS/LF/slack/critical path); render as network, timescaled, or calendar Gantt",
|
|
5574
|
+
keywords: 'pert | gantt \xB7 title: "\u2026" \xB7 unit: days|weeks|hours|abstract \xB7 direction: LR|TB \xB7 layout: network|timescaled|aoa|gantt \xB7 critical-tolerance: N \xB7 gantt-only: start: YYYY-MM-DD \xB7 calendar: continuous|5day \xB7 today: YYYY-MM-DD \xB7 task ID "label" duration: N|O/M/P [after: ref,\u2026] [milestone] [lane: "Section"] [progress: N%] \xB7 dependency refs: ID (FS) \xB7 ID FS|SS|FF|SF[+N|-N][d|w|h] \xB7 ID+N (FS lag sugar)',
|
|
5514
5575
|
forms: [
|
|
5515
5576
|
"pert",
|
|
5516
5577
|
'title: "Q3 Product Launch"',
|
|
@@ -5521,12 +5582,21 @@ var PROFILES = {
|
|
|
5521
5582
|
'task C "Backend API" duration: 15 after: A',
|
|
5522
5583
|
'task D "Frontend build" duration: 10 after: B, C',
|
|
5523
5584
|
'task E "QA / testing" duration: 5 after: D',
|
|
5524
|
-
'task G "Launch event" duration: 2 after: E'
|
|
5585
|
+
'task G "Launch event" duration: 2 after: E',
|
|
5586
|
+
"",
|
|
5587
|
+
"# \u2014 or a Gantt chart (same scheduler, calendar bars) \u2014",
|
|
5588
|
+
'gantt "Website Relaunch"',
|
|
5589
|
+
"start: 2026-07-01",
|
|
5590
|
+
"calendar: 5day",
|
|
5591
|
+
'task P "Discovery" duration: 5 lane: "Plan"',
|
|
5592
|
+
'task Q "Build" duration: 12 after: P lane: "Build" progress: 30%',
|
|
5593
|
+
'task R "Go live" milestone after: Q lane: "Build"'
|
|
5525
5594
|
],
|
|
5526
5595
|
prefer: [
|
|
5527
5596
|
'Each `task ID "label" duration: N` is one activity; wire dependencies with `after: A, B` (comma-separated, forward references allowed). The engine computes ES/EF/LS/LF and the critical path \u2014 never write those yourself.',
|
|
5597
|
+
'For a Gantt chart, use the `gantt` header (or `layout: gantt`); add `start: YYYY-MM-DD` for a calendar date axis, `calendar: 5day` to exclude weekends, `lane: "Section"` to band rows, `progress: 60%` for completion, and `milestone` for diamonds. Bars are placed from the computed schedule \u2014 still never type ES/EF.',
|
|
5528
5598
|
"Use three-point estimation `duration: O/M/P` (e.g. `2/3/5`) for uncertainty \u2014 the engine computes `te = (O+4M+P)/6` and variance; add `critical-tolerance: 0.01` when mixing estimate kinds.",
|
|
5529
|
-
|
|
5599
|
+
"Declare dependency types when needed: `after: A FS`, `after: A SS+2`, `after: B FF-1` (default FS, zero lag)."
|
|
5530
5600
|
],
|
|
5531
5601
|
avoid: [
|
|
5532
5602
|
"Don't write `ES:`, `EF:`, `LS:`, `LF:`, or `slack:` yourself \u2014 they are computed outputs.",
|
|
@@ -6292,5 +6362,5 @@ function matchRepair(repairs, message) {
|
|
|
6292
6362
|
}
|
|
6293
6363
|
|
|
6294
6364
|
export { DIAGRAM_REGISTRY, DIAGRAM_SINCE, getAllDiagramTypes, getDiagramMeta, getDiagramSince, getExamples, getSyntax, listDiagrams, renderDsl, resolveDiagramType, validateDsl };
|
|
6295
|
-
//# sourceMappingURL=chunk-
|
|
6296
|
-
//# sourceMappingURL=chunk-
|
|
6365
|
+
//# sourceMappingURL=chunk-CVTHUOAM.js.map
|
|
6366
|
+
//# sourceMappingURL=chunk-CVTHUOAM.js.map
|