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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkQ7CWX6HA_cjs = require('./chunk-Q7CWX6HA.cjs');
3
+ var chunkKH5GRKUM_cjs = require('./chunk-KH5GRKUM.cjs');
4
4
 
5
5
  // src/ai/registry.ts
6
6
  var DIAGRAM_REGISTRY = [
@@ -258,12 +258,34 @@ var DIAGRAM_REGISTRY = [
258
258
  // ── Project management / scheduling ──────────────────────────
259
259
  {
260
260
  type: "pert",
261
- name: "PERT / CPM network",
262
- tagline: "Activity-on-node project schedule that computes ES/EF/LS/LF, slack, and the critical path.",
263
- 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), milestones (`milestone`), swimlanes (`lane: \"Team\"`), a `layout: timescaled` mode (x \u221D ES, width \u221D duration) for a network-Gantt hybrid, and a legacy `layout: aoa` mode (activity-on-arrow: numbered event circles + arrow activities + dummy activities, FS-only). Distinct from `flowchart` (no scheduling), `timeline`/Gantt (no critical-path computation), and `bpmn` (organisational process, not a one-off schedule).",
261
+ name: "PERT / CPM network & Gantt chart",
262
+ 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.",
263
+ 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).",
264
264
  cluster: "project-management",
265
- standard: "PMI PMBOK 7 + Moder 1983 (AON/PDM); see 32-PERT-STANDARD.md",
266
- syntaxKey: "pert"
265
+ standard: "PMI PMBOK 7 + Moder 1983 (AON/PDM); Gantt 1910; see 32-PERT-STANDARD.md",
266
+ syntaxKey: "pert",
267
+ aliases: [
268
+ "PERT chart",
269
+ "CPM",
270
+ "critical path method",
271
+ "Gantt chart",
272
+ "gantt",
273
+ "project schedule",
274
+ "precedence diagram",
275
+ "\u7518\u7279\u56FE"
276
+ ],
277
+ keywords: [
278
+ "critical path",
279
+ "project management",
280
+ "project schedule",
281
+ "task dependencies",
282
+ "gantt chart maker",
283
+ "project timeline",
284
+ "forward backward pass",
285
+ "slack float",
286
+ "milestone",
287
+ "PMBOK"
288
+ ]
267
289
  },
268
290
  // ── Structural UML ───────────────────────────────────────────
269
291
  {
@@ -2054,6 +2076,45 @@ If the LED doesn't light up, three things to check, in order: LED polarity (the
2054
2076
  "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',
2055
2077
  "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."
2056
2078
  },
2079
+ {
2080
+ "slug": "gantt-construction-schedule",
2081
+ "diagram": "pert",
2082
+ "title": "Construction schedule (Gantt, computed critical path)",
2083
+ "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.",
2084
+ "standard": "PMI PMBOK 7 (critical path) + Gantt 1910",
2085
+ "tags": [
2086
+ "gantt",
2087
+ "pert",
2088
+ "cpm",
2089
+ "critical-path",
2090
+ "construction",
2091
+ "project-schedule"
2092
+ ],
2093
+ "complexity": 3,
2094
+ "featured": false,
2095
+ "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',
2096
+ "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."
2097
+ },
2098
+ {
2099
+ "slug": "gantt-website-relaunch",
2100
+ "diagram": "pert",
2101
+ "title": "Gantt chart with computed critical path (website relaunch)",
2102
+ "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.",
2103
+ "standard": "PMI PMBOK 7 (critical path) + Gantt 1910",
2104
+ "tags": [
2105
+ "gantt",
2106
+ "pert",
2107
+ "cpm",
2108
+ "critical-path",
2109
+ "project-schedule",
2110
+ "milestone",
2111
+ "calendar"
2112
+ ],
2113
+ "complexity": 3,
2114
+ "featured": true,
2115
+ "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',
2116
+ "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.'
2117
+ },
2057
2118
  {
2058
2119
  "slug": "genogram-brca-cancer",
2059
2120
  "diagram": "genogram",
@@ -4459,7 +4520,7 @@ var SYNTAX = {
4459
4520
  },
4460
4521
  "pert": {
4461
4522
  "title": "PERT / CPM Network",
4462
- "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---'
4523
+ "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---'
4463
4524
  },
4464
4525
  "petri": {
4465
4526
  "title": "Petri Net",
@@ -5510,9 +5571,9 @@ var PROFILES = {
5510
5571
  },
5511
5572
  pert: {
5512
5573
  type: "pert",
5513
- header: "pert",
5514
- mode: "AON tasks with computed schedule (ES/EF/LS/LF/slack/critical path)",
5515
- 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: "Name"] \xB7 dependency refs: ID (FS) \xB7 ID FS|SS|FF|SF[+N|-N][d|w|h] \xB7 ID+N (FS lag sugar)',
5574
+ header: "pert (or `gantt` for a Gantt chart)",
5575
+ mode: "AON tasks with computed schedule (ES/EF/LS/LF/slack/critical path); render as network, timescaled, or calendar Gantt",
5576
+ 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)',
5516
5577
  forms: [
5517
5578
  "pert",
5518
5579
  'title: "Q3 Product Launch"',
@@ -5523,12 +5584,21 @@ var PROFILES = {
5523
5584
  'task C "Backend API" duration: 15 after: A',
5524
5585
  'task D "Frontend build" duration: 10 after: B, C',
5525
5586
  'task E "QA / testing" duration: 5 after: D',
5526
- 'task G "Launch event" duration: 2 after: E'
5587
+ 'task G "Launch event" duration: 2 after: E',
5588
+ "",
5589
+ "# \u2014 or a Gantt chart (same scheduler, calendar bars) \u2014",
5590
+ 'gantt "Website Relaunch"',
5591
+ "start: 2026-07-01",
5592
+ "calendar: 5day",
5593
+ 'task P "Discovery" duration: 5 lane: "Plan"',
5594
+ 'task Q "Build" duration: 12 after: P lane: "Build" progress: 30%',
5595
+ 'task R "Go live" milestone after: Q lane: "Build"'
5527
5596
  ],
5528
5597
  prefer: [
5529
5598
  '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.',
5599
+ '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.',
5530
5600
  "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.",
5531
- 'Declare dependency types when needed: `after: A FS`, `after: A SS+2`, `after: B FF-1` (default FS, zero lag); group activities with `lane: "Team"`.'
5601
+ "Declare dependency types when needed: `after: A FS`, `after: A SS+2`, `after: B FF-1` (default FS, zero lag)."
5532
5602
  ],
5533
5603
  avoid: [
5534
5604
  "Don't write `ES:`, `EF:`, `LS:`, `LF:`, or `slack:` yourself \u2014 they are computed outputs.",
@@ -6216,7 +6286,7 @@ function getExamples(type, opts = {}) {
6216
6286
  function validateDsl(type, dsl) {
6217
6287
  const resolvedType = type ? resolveDiagramType(type) : void 0;
6218
6288
  const config = type ? { type: resolvedType ?? type } : void 0;
6219
- const result = chunkQ7CWX6HA_cjs.parseResult(dsl, config);
6289
+ const result = chunkKH5GRKUM_cjs.parseResult(dsl, config);
6220
6290
  if (result.ok) {
6221
6291
  return {
6222
6292
  ok: true,
@@ -6242,7 +6312,7 @@ function renderDsl(type, dsl, options = {}) {
6242
6312
  ...options,
6243
6313
  ...type ? { type: resolvedType ?? type } : {}
6244
6314
  };
6245
- const result = chunkQ7CWX6HA_cjs.renderResult(dsl, config);
6315
+ const result = chunkKH5GRKUM_cjs.renderResult(dsl, config);
6246
6316
  if (result.ok) {
6247
6317
  return {
6248
6318
  ok: true,
@@ -6304,5 +6374,5 @@ exports.listDiagrams = listDiagrams;
6304
6374
  exports.renderDsl = renderDsl;
6305
6375
  exports.resolveDiagramType = resolveDiagramType;
6306
6376
  exports.validateDsl = validateDsl;
6307
- //# sourceMappingURL=chunk-7EWP4OD7.cjs.map
6308
- //# sourceMappingURL=chunk-7EWP4OD7.cjs.map
6377
+ //# sourceMappingURL=chunk-HX64QWB6.cjs.map
6378
+ //# sourceMappingURL=chunk-HX64QWB6.cjs.map