### Complete Timeline Example Source: https://schematex.js.org/docs/timeline A full timeline example using a lollipop style configuration and various event types. ```schematex timeline "Engineering Milestones" config: style = lollipop 2024-01-08: "Sprint planning complete" 2024-02-14: milestone "Design system shipped" [side: above, color: #1565C0] 2024-03-22: "Incident — 4h outage" [icon: ⚠️] 2024-04-01 - 2024-06-30: "API v2 build" 2024-07-01: milestone "API v2 GA" [side: above, color: #2E7D32] ``` -------------------------------- ### Install Schematex with npm Source: https://schematex.js.org/docs/getting-started Install the schematex package using npm. ```bash npm install schematex ``` -------------------------------- ### List layout orgchart example Source: https://schematex.js.org/docs/orgchart A compact directory view using indent guides, recommended for large teams where tree branching is unwieldy. ```schematex orgchart "Engineering Directory — list" config: layout = list cto: "Wei Zhang" | CTO [role: cto] platform: "Platform Team" p1: "Amara Diallo" | Staff Eng [role: engineer] p2: "Ben Novak" | Senior Eng [role: engineer] p3: draft "TBH" | Engineer [role: engineer] growth: "Growth Team" g1: "Fatima Al-Rashid" | Senior Eng [role: engineer, status: new] g2: "Marco Ricci" | Engineer [role: engineer, status: leaving] ``` -------------------------------- ### Full siteplan example with parcel, road, structures, and annotations Source: https://schematex.js.org/docs/siteplan A complete siteplan sketch showing parcel boundaries, a road, frontage, setback, easement, structures, driveway, walkway, trees, car, dimension, callout, north arrow, scale, and legend. Use this as a starting template for residential listing site plans. ```schematex siteplan "Residential Listing Site Plan" unit ft parcel lot points 0,0 62,0 58,96 8,104 -4,42 road maple "Maple Ave" from -12,-16 to 74,-16 width 22 frontage front from 0,0 to 62,0 setback frontSetback "Front setback" from 5,8 to 57,8 easement util "Utility easement" from 48,0 to 43,96 structure house "Residence" points 15,28 45,28 45,64 34,64 34,78 15,78 structure garage "Garage" points 45,32 58,32 58,55 45,55 driveway drive points 52,0 52,32 width 10 walkway walk points 31,0 31,28 width 4 tree oak at 9,22 size 8 "Oak" tree mapleTree at 12,80 size 9 car car1 at 52,14 size 15 rotate 0 dim "62 ft frontage" from 0,-30 to 62,-30 callout "Covered patio" at 20,90 to 22,76 north scale 20 legend on ``` -------------------------------- ### Install local stdio MCP server Source: https://schematex.js.org/docs/ai-integration Install the Schematex MCP server globally or run it via npx for offline development or clients that only support stdio transport. ```bash npm i -g @schematex/mcp # or npx @schematex/mcp ``` -------------------------------- ### Network Diagram with Structural Hints Source: https://schematex.js.org/docs/network An example using layout and tiering hints to establish a top-down hierarchy. ```schematex network "Branch" layout: tiered router r1 "Edge Router" tier: edge l3switch core1 "Core SW" tier: core switch acc1 "Access SW" tier: access pc pc1 "Workstation" r1 -- core1 core1 -- acc1 acc1 -- pc1 ``` -------------------------------- ### Nested boundaries and connections example Source: https://schematex.js.org/docs/network Shows how to nest physical and logical boundary blocks (site, rack, subnet, zone) and connect devices. A device inside a subnet whose label is a CIDR gets its ip validated; a bare id on its own line adds an already-declared device to that group. ```plaintext network "Branch" site hq "HQ Building" { rack mdf "MDF Rack" { firewall fw1 tier: edge l3switch core1 tier: core } } subnet lan "10.0.10.0/24" { switch a1 tier: access pc u1 "User PC" ip: 10.0.10.50 } zone dmz "DMZ" { server web } fw1 -- core1 : 10G core1 -- a1 : trunk vlan: 10 a1 -- u1 ``` -------------------------------- ### Basic Network Diagram Declaration Source: https://schematex.js.org/docs/network A minimal example showing how to declare devices and create undirected links between them. ```schematex network "Tiny LAN" router r1 "Edge Router" switch sw1 "Core Switch" pc pc1 "Workstation" r1 -- sw1 sw1 -- pc1 ``` -------------------------------- ### Position openings relative to a measured façade with `from start` and `after` Source: https://schematex.js.org/docs/floorplan Use these statements to position openings relative to a measured façade. `start` means west on a horizontal wall and north on a vertical wall; `from start n` measures to the leading jamb, `from end n` from the opposite end to the trailing jamb. A `before`/`after` reference must name an earlier opening on the same resolved wall, keeping source order deterministic. ```text door hall south from start 0.30 width 0.90 id entry window hall south after entry gap 0.10 width 1.20 id display1 window hall south after display1 gap 0.20 width 1.20 id display2 ``` -------------------------------- ### Complete ecomap example with connections and labels Source: https://schematex.js.org/docs/ecomap Full ecomap definition showing center and systems, with all required declarations and example connection lines using relationship-quality and energy-flow operators. Add or customize nodes and connections as needed; the parser automatically normalizes arrow direction relative to the center. ```schematex ecomap center: client [label: "Rosa"] mom [category: family] ex [category: family] aa [label: "AA Group", category: substance] job [label: "Warehouse", category: work] mom === client [label: "daily calls"] ex ~x~ client [label: "custody disputes"] aa <== client [label: "sponsor support"] job - - client [label: "unstable hours"] ``` -------------------------------- ### Configure scale bar and outgroup Source: https://schematex.js.org/docs/phylo Example demonstrating the outgroup directive and the scale bar command to provide context for branch lengths. ```schematex phylo "Vertebrates" newick: "((Human:0.1,Chimp:0.08):0.03,Lamprey:0.8);" outgroup: Lamprey scale "substitutions/site" ``` -------------------------------- ### Network Diagram with Link Annotations Source: https://schematex.js.org/docs/network An example demonstrating directed links and link specifications like wireless connections. ```schematex network "Home" layout: star router gw "Gateway" pc pc1 laptop lt1 gw -- pc1 gw -- lt1 : wireless ``` -------------------------------- ### Minimal P&ID with pid, equip, and line Source: https://schematex.js.org/docs/pid Minimal P&ID example: declares three equipment items (tank, pump, vessel) and two process lines. Start the document with `pid`; each `equip` line declares a piece of equipment, each `line` connects an equipment port to another. The `size` attribute uses an escaped double quote (e.g., `"`). ```schematex pid equip T-1 : tank_atm equip P-1 : pump_centrifugal equip V-1 : vessel_v line L1 from T-1.bottom to P-1.in [size: "2\"", type: "process"] line L2 from P-1.out to V-1.in [size: "2\"", type: "process"] ``` -------------------------------- ### Define labels and comments Source: https://schematex.js.org/docs/sociogram Syntax examples for titles, node labels, group labels, edge labels, and line comments. ```schematex sociogram "Study group" alice [label: "Alice K."] group boys [label: "Boys"] alice -> bob [label: "lab partners"] # This is a comment ``` -------------------------------- ### NAND gate diagram Source: https://schematex.js.org/docs/logic A minimal example showing two inputs, one NAND gate, and one output. ```schematex logic "NAND check" input A, B output F F = NAND(A, B) ``` -------------------------------- ### Fan-out example flowchart Source: https://schematex.js.org/docs/flowchart A flowchart showing fan-out from deploy to smoke and health checks, and from those to Slack and email alerts on failure. ```schematex flowchart LR deploy[Deploy service] smoke[Smoke test] health[Health check] notify_slack[Slack alert] notify_email[Email alert] deploy --> smoke & health smoke & health -->|fail| notify_slack & notify_email ``` -------------------------------- ### Create a basic fishbone diagram Source: https://schematex.js.org/docs/fishbone A minimal example demonstrating the definition of a fishbone diagram with three categories, causes, and a sub-cause. ```schematex fishbone "API latency spike" effect "P99 > 2 s after deploy" category code "Code" category infra "Infra" category data "Data" code : "N+1 query in new endpoint" - "Missing eager-load on orders" infra : "DB connection pool exhausted" data : "Index missing on accounts table" ``` -------------------------------- ### Mixed edge types example: entity-structure with all operators Source: https://schematex.js.org/docs/entity Complete example showing all edge operators (->, ==>, -.->, -~->, -->) with ownership percentages, share classes, and labels. Demonstrates equity, voting control, option pool, IP license, and trust distribution edges in one entity structure. ```schematex entity-structure "Mixed edge types" entity holdco "HoldCo LLC" llc@DE entity opco "OpCo Inc." corp@DE entity ip_co "IP Ltd" corp@KY entity fund "Growth Fund" lp@DE entity esop "ESOP Pool" pool entity trust1 "Family Trust" trust@SD entity founder "J. Smith" individual # Equity ownership holdco -> opco : 100% holdco -> ip_co : 100% # IP license (non-equity) ip_co -~-> opco [label: "Exclusive license"] # Option pool (dashed) esop -.-> opco : 10% # Voting control fund ==> holdco # Trust distribution trust1 --> founder [label: "Income distributions"] founder -> trust1 : 100% ``` -------------------------------- ### Era syntax examples Source: https://schematex.js.org/docs/timeline Shows the basic syntax for defining eras with optional color property. Overlapping eras stack automatically. ```plaintext era 2020 - 2022: "Foundation Phase" era 2022 .. 2025: "Growth Phase" [color: #E8F5E9] ``` -------------------------------- ### Order processing flowchart example Source: https://schematex.js.org/docs/flowchart A complex flowchart demonstrating inventory validation, payment authorization, and order fulfillment paths. ```schematex flowchart LR start([New order received]) start --> validate{Inventory available?} validate -->|Yes| reserve[Reserve items] validate -->|No| notify[Notify customer] notify --> done([End]) reserve --> payment{Payment authorized?} payment -->|Yes| ship[Ship order] payment -->|No| cancel[Cancel & release] ship --> confirm[Send confirmation email] confirm --> done cancel --> done ``` -------------------------------- ### Alternative branches with priority transitions Source: https://schematex.js.org/docs/sfc Example of an alternative branch structure where one branch is selected based on transition conditions. ```text step S0 [initial] step S_Pick alt from: S_Pick: branch [priority: 1]: transition: IsExpressShipping step S_Express N PrepExpressBox transition: TRUE branch [priority: 2]: transition: IsStandardShipping step S_Standard N PrepStandardBox transition: TRUE merge_to: S_Ship step S_Ship transition from: S0 to: S_Pick: ProductOrdered transition from: S_Ship to: S0: Shipped ``` -------------------------------- ### Define timing diagram labels and comments Source: https://schematex.js.org/docs/timing Example showing the use of a title, a comment line, and a signal definition with a wave string. ```text timing "Demo" # this is a comment CLK: pppp # ← inline trailing comment is NOT supported ``` -------------------------------- ### Define a basic UML class diagram Source: https://schematex.js.org/docs/umlclass A basic example showing the umlclass keyword, class declarations, and an ownership relationship. ```text umlclass class Account { + id : String - balance : Money + deposit(amount : Money) : void } class Customer { + name : String } Customer "1" o-- "*" Account : owns ``` -------------------------------- ### Full Competency Heat Map Example Source: https://schematex.js.org/docs/matrix A complete 4x4 heatmap configuration demonstrating various intensity levels across a competency matrix. ```schematex matrix heatmap 4x4 "Competency Heat Map" rows: [Leadership, Execution, Communication, Technical] cols: [Junior, Mid, Senior, Staff] cell (0,0) level: weak cell (1,0) level: medium cell (2,0) level: strong cell (3,0) level: strong cell (0,1) level: medium cell (1,1) level: medium cell (2,1) level: strong cell (3,1) level: strong cell (0,2) level: weak cell (1,2) level: medium cell (2,2) level: medium cell (3,2) level: strong cell (0,3) level: weak cell (1,3) level: weak cell (2,3) level: medium cell (3,3) level: strong ``` -------------------------------- ### Define an evacuation plan in Schematex Source: https://schematex.js.org/docs/evacuation This example defines an office layout with rooms, exits, safety equipment, and primary/secondary evacuation routes. ```schematex evacuation "Office Escape Plan" unit m compliance iso sheet a3 landscape room office "Open Office" at 0,0 size 6x5 room lobby "Lift Lobby" below office size 6x2.4 room stairA "Stair A" left-of lobby size 3x2.4 room stairB "Stair B" right-of lobby size 3x2.4 opening between office lobby at 50% width 1.6 door between lobby stairA at 50% width 1.1 door between lobby stairB at 50% width 1.1 here in office at 3,2.5 exit-final xA in stairA at 0,1.2 side west "EXIT" exit-final xB in stairB at 3,1.2 side east "EXIT" extinguisher f1 in lobby at 2,1.8 class "ABC" route primary here -> lobby -> stairB -> xB route secondary here -> lobby -> stairA -> xA ``` -------------------------------- ### Genogram comment syntax example Source: https://schematex.js.org/docs/genogram Shows valid comment styles (#, %%, //) at line start and demonstrates that trailing inline comments are not supported and break the parser. ```genogram genogram "Smith Family" # this line is a comment — fine %% Mermaid-style comment — also fine alice [female, 1980] # ← THIS trailing comment breaks the parser ``` -------------------------------- ### Mixed continuous and discrete block diagram Source: https://schematex.js.org/docs/block A complete example demonstrating blocks, signals, and connections with various labels and discrete flags. ```schematex blockdiagram "Mixed continuous/discrete" ctrl = block("Digital PID") [role: controller] dac = block("DAC") [role: actuator] plant = block("G(s)") [role: plant] adc = block("ADC") [role: sensor] err = sum(+r, -yk) r = signal("r[k]") [discrete] yk = signal("y[k]") [discrete] in -> r r -> err err -> ctrl ctrl -> dac [label: "u[k]", discrete] dac -> plant ["u(t)"] plant -> adc ["y(t)"] adc -> yk [discrete] yk -> err ``` -------------------------------- ### Create a custom 2×2 matrix with labeled axes and points Source: https://schematex.js.org/docs/matrix Start with the keyword `matrix`, optionally followed by a template name or a quoted title. Set axes with `x-axis:` and `y-axis:`; each point is `"Label" at (x, y)` with decimal fractions from 0.0 to 1.0. Optional properties like `size:`, `category:`, `color:`, `shape:`, `highlight:` can follow coordinates. Comments must start with `#` anywhere on a line (outside quoted strings). ```schematex matrix "Feature Prioritization" x-axis: Low Effort → High Effort y-axis: Low Value → High Value "Add search" at (0.3, 0.8) "Rebuild pipeline" at (0.85, 0.7) "Update footer" at (0.2, 0.2) ``` -------------------------------- ### Six-field activity box layout Source: https://schematex.js.org/docs/pert ASCII representation of the canonical 3x2 PERT/CPM rectangle. Shows the placement of Early Start, Duration, Early Finish, Task Name, Late Start, Slack, and Late Finish fields. Critical activities get a red border and bold zero slack. ```text ┌──────────┬────────────┬──────────┐ │ ES │ Duration │ EF │ ├──────────┴────────────┴──────────┤ │ Task Name (ID) │ ├──────────┬────────────┬──────────┤ │ LS │ Slack │ LF │ └──────────┴────────────┴──────────┘ ``` -------------------------------- ### Place doors, openings, and windows with `between` and `at` Source: https://schematex.js.org/docs/floorplan Use these statements to place doors, openings, and windows on walls. `between A B` resolves the shared wall segment and positions at the percentage along the overlap; non-adjacent rooms are rejected with the measured gap. Doors default to 0.9 m wide on exterior walls and 0.8 m on `between` walls; windows default to 1.2 m. `hinge left|right` picks the jamb, `swing in|out` flips the quarter-arc (default swings into the owning room), and `type` options control the leaf/arc rendering. ```text door hall west at 50% width 1.0 swing in # exterior door on a wall door between hall bed1 at 50% hinge right # interior door on the shared wall door between bed1 bath at 30% type sliding # sliding door — no arc opening between living kitchen at 35% width 1.2 # archway, no leaf window living north at 30% width 1.8 ``` -------------------------------- ### Define a Studio Apartment floor plan in Schematex Source: https://schematex.js.org/docs/floorplan This example demonstrates how to declare a studio apartment layout, including room dimensions, doors, windows, and furniture placement. ```schematex floorplan "Studio Apartment" unit m room main "Living / Sleeping" at 0,0 size 5.2x4.0 room bath "Bath" right-of main size 2.0x2.2 room kitchen "Kitchenette" right-of main align end size 2.0x1.8 door main south at 15% width 0.9 door between main bath at 50% opening between main kitchen at 50% width 1.2 window main north at 30% width 1.8 furniture bed-double in main at 3.4,0.3 furniture sofa in main at 0.2,3.0 furniture toilet in bath at 0.2,0.2 furniture sink in bath at 1.3,0.2 furniture counter in kitchen at 0.15,1.05 size 1.7x0.6 furniture kitchen-sink in kitchen at 0.6,1.05 ``` -------------------------------- ### Genogram with medical conditions Source: https://schematex.js.org/docs/genogram A complete genogram example using the `conditions` attribute. Shows a family with `dad`, `mom`, and `son`, where `son` has a striped carrier condition. The `genogram` keyword starts the diagram. ```schematex genogram dad [male, 1950, conditions: heart(full, #E53935)] mom [female, 1952, conditions: diabetes(half-left) + depression(half-right, #5C6BC0)] dad -- mom son [male, 1980, conditions: carrier(striped)] ``` -------------------------------- ### Define a football play with Red Zone Play-Action Fade Source: https://schematex.js.org/docs/playbook Example of a football play definition using field setup, formation, defensive coverage, and player actions like handoff, route, and run. ```schematex playbook "Red Zone — Play-Action Fade" sport football field down 1 distance 5 los 5 goal 5 hash nfl formation i-form right defense cover-1 handoff QB RB route Z corner 4 route X slant route Y out 3 run RB dive right ``` -------------------------------- ### Schematex breadboard example with parts and wires Source: https://schematex.js.org/docs/breadboard Complete breadboard definition showing the required `breadboard`, `parts`, and `wires` sections. Parts use `id: kind [args] @placement`; wires use ` --color-- `. Optional `board:` and `title:` lines may follow the header. ```schematex breadboard parts uno: mcu uno @beside-left r1: resistor 220 @5e..9e d1: led red @10e..10f wires uno:5V --red-- @+t1 uno:GND --black-- @-t1 uno:D13 --yellow-- @5a @10j --black-- @-t1 ``` -------------------------------- ### Define a basic Markov chain Source: https://schematex.js.org/docs/markov A simple example of a weather model using the markov keyword to define states and transition probabilities. ```schematex markov "Weather" Sunny -> Sunny : 0.9 Sunny -> Rainy : 0.1 Rainy -> Sunny : 0.5 Rainy -> Rainy : 0.5 ``` -------------------------------- ### Schematex mindmap with inline formatting Source: https://schematex.js.org/docs/mindmap A Schematex mindmap example that uses inline formatting in node labels, including bold, italic, monospace code, links, and task checkboxes. The checkbox must be at the very start of the label. Inline formatting can be nested. ```schematex mindmap # Sprint 24 review ## Completed - [x] **Auth redesign** — JWT + refresh tokens - [x] API rate limiting \`per-user\` - [x] [Error budget dashboard](https://metrics.example.com) ## In progress - [ ] *Mobile push notifications* - [ ] iOS APNs integration - [ ] Android FCM setup ## Blocked - [ ] **Payment webhook** — waiting on Stripe team - *Escalated to account manager* ``` -------------------------------- ### Common mistakes examples Source: https://schematex.js.org/docs/gitgraph Three incorrect git graph definitions: missing the `gitGraph` header, using an unknown operation (`rebase`), and using an unknown commit type (`SQUASH`). The document must start with `gitGraph`; only `commit` / `branch` / `checkout` / `switch` / `merge` / `cherry-pick` are valid operations; `type:` must be `NORMAL`, `HIGHLIGHT`, or `REVERSE`. ```plaintext # WRONG — no gitGraph header commit commit ``` ```plaintext # WRONG — unknown operation gitGraph rebase main ``` ```plaintext # WRONG — unknown commit type gitGraph commit type: SQUASH ``` -------------------------------- ### Minimal library use case diagram Source: https://schematex.js.org/docs/usecase Minimal example showing the required `usecase` keyword, a `system` header, one actor, one use case, and a plain association. Demonstrates the basic syntax for a first diagram. ```schematex usecase system: "Library" actor: Member usecase: "Borrow Book" as Borrow Member -- Borrow ``` -------------------------------- ### All contact types with addresses and names Source: https://schematex.js.org/docs/ladder Example showing all four contact types (XIC, XIO, ONS, OSF) with optional address and name arguments, plus an OTE coil. ```schematex ladder "Contact types" rung 1 "All four contact types": XIC(START_PB, "IN 1.0", name="Start Button") XIO(E_STOP, "IN 1.5", name="Emergency Stop NC") ONS(PULSE_IN, "BIT 5.0", name="One-Shot Rising") OSF(RESET_SIG, "BIT 5.1", name="One-Shot Falling") OTE(OUT_RLY, "OUT 2.0", name="Output Relay") ``` -------------------------------- ### Genogram diagram example Source: https://schematex.js.org/docs A basic example of the Schematex DSL defining a genogram with two parents and two children. ```schematex genogram "The Smiths" john [male, 1950] mary [female, 1952] john -- mary alice [female, 1975, index] bob [male, 1978] alice -close- mary ``` -------------------------------- ### Configure layout and label width with directives Source: https://schematex.js.org/docs/mindmap Example showing the use of %% style and %% maxLabelWidth directives before the root heading to customize the diagram layout. ```text mindmap %% style: logic-right %% maxLabelWidth: 320 # Wide label root ``` -------------------------------- ### Complete RC filter circuit example Source: https://schematex.js.org/docs/circuit Complete example of an RC filter circuit using voltage source, resistor, capacitor, named net, label, and ground. ```schematex circuit "RC filter" V1: voltage_source down value="5V" wire right R1: resistor right value="1k" label="R1" net OUT: dot wire right label "Vout" right at: OUT C1: capacitor down value="100n" label="C1" wire down ground ``` -------------------------------- ### Define a Login flow sequence diagram Source: https://schematex.js.org/docs/sequence This example demonstrates a login flow using actors, participants, control, and database elements, including activation, alt fragments, and notes. ```schematex sequence "Login flow" actor User participant Web as "Web App" control Auth database DB User -> Web : submit(credentials) activate Web Web ->+ Auth : verify(credentials) Auth ->+ DB : SELECT user DB --> Auth : row deactivate DB alt [credentials valid] Auth --> Web : token Web --> User : 200 OK else [invalid] Auth --> Web : 401 Web --> User : error end deactivate Auth deactivate Web note over User, Web : session cookie set ``` -------------------------------- ### Full jurisdiction cluster example Source: https://schematex.js.org/docs/entity Complete example combining entity-structure, jurisdiction declarations, entity declarations, and relationships. Entities with matching jurisdiction codes are grouped into clusters; relationships use arrows and labels. ```schematex entity-structure "IP holding structure" jurisdiction US "United States" [color: "#3b82f6"] jurisdiction IE "Ireland" [color: "#059669"] jurisdiction KY "Cayman Islands" [color: "#d97706"] entity parent "TopCo, Inc." corp@US entity ie_hold "Ireland Holdings" corp@IE entity ie_ip "IP HoldCo" corp@KY [note: "Group IP"] entity ie_op "EU Opco" llc@IE parent -> ie_hold : 100% ie_hold -> ie_ip : 100% ie_hold -> ie_op : 100% ie_ip -~-> ie_op [label: "IP License"] ``` -------------------------------- ### Full State Diagram with Composite State Source: https://schematex.js.org/docs/state A complete state diagram example using the schematex syntax, demonstrating transitions and a composite state with activities. ```schematex stateDiagram-v2 [*] --> Stopped Stopped --> Playing : play / loadSource() Playing --> Paused : pause Paused --> Playing : play Playing --> Stopped : stop / releaseSource() state Playing { entry / startBuffer() exit / stopBuffer() do / decodeFrames() [*] --> Buffering Buffering --> Streaming : buffer_full Streaming --> Buffering : underflow } ``` -------------------------------- ### Product Portfolio matrix with quadrants and points Source: https://schematex.js.org/docs/matrix Complete matrix example with reversed x-axis, four quadrants, and points with size and highlight properties. Coordinates are normalized (0-1). ```schematex matrix "Product Portfolio" x-axis: High Market Share ← Low Market Share y-axis: Low Growth → High Growth quadrant Q1 "Question Marks" quadrant Q2 "Stars" quadrant Q3 "Cash Cows" quadrant Q4 "Dogs" "Analytics Suite" at (0.25, 0.35) size: 5 "ChatBot Pro" at (0.2, 0.8) size: 4 highlight: true "Legacy CRM" at (0.75, 0.25) size: 6 "Mobile App" at (0.65, 0.75) size: 3 ``` -------------------------------- ### Entity structure diagram example Source: https://schematex.js.org/docs/entity Example of a Schematex entity structure diagram showing a holding structure with parent, subsidiaries, and an employee option pool. Uses entity declarations with jurisdiction codes and ownership percentages. ```schematex entity-structure "Acme Global Holdings" entity parent "Acme Global, Inc." corp@US [note: "Ultimate Parent"] entity ie-holdco "Acme Ireland Holdings" corp@IE entity ie-ip "Acme IP Ltd" corp@KY [note: "Holds group IP"] entity nl-bv "Acme EU Distribution" llc@NL entity sg-apac "Acme APAC Trading" corp@SG entity esop "Employee Option Pool" pool parent -> ie-holdco : 100% ie-holdco -> ie-ip : 100% ie-holdco -> nl-bv : 100% ie-ip -~-> nl-bv [label: "IP License · royalty"] parent -> sg-apac : 100% esop -.-> ie-holdco ``` -------------------------------- ### Example flowchart showing node shapes Source: https://schematex.js.org/docs/flowchart A full flowchart TD example that uses the node shapes documented on this page, including terminal, rectangle, diamond, parallelogram, cylinder, and subroutine nodes. It demonstrates branching and connections. ```schematex flowchart TD t([Terminal / stadium]) r[Rectangle process] d{Diamond decision} p[/Parallelogram input/] db[(Cylinder database)] sub[[Subroutine]] t --> r --> d d -->|branch A| p d -->|branch B| db p --> sub db --> sub ``` -------------------------------- ### Basic Finish-to-Start dependency Source: https://schematex.js.org/docs/pert Shows the default dependency: a task starts once its predecessor finishes. The `after:` attribute takes a comma-separated list of predecessor references. ```schematex task D "Frontend build" duration: 10 after: B, C ``` -------------------------------- ### Schematex phylo example: circular phylogram with clades and scale Source: https://schematex.js.org/docs/phylo Defines a phylogenetic tree in Schematex using the 'phylo' directive with a Newick string, clade definitions for highlighting, and a scale bar. The example uses circular layout and phylogram mode. ```schematex phylo "Vertebrate Evolution" [layout: circular, mode: phylogram] newick: "(((Human:0.1,Chimp:0.08,Gorilla:0.12):0.15,(Mouse:0.45,Rat:0.42):0.3):0.05,((Dog:0.35,(Cat:0.30,Tiger:0.32):0.1):0.2,(Whale:0.6,Dolphin:0.55):0.15):0.3,(Salmon:0.5,Zebrafish:0.45):0.4);" clade Primates = (Human, Chimp, Gorilla) [color: "#1E88E5", label: "Primates", highlight: both] clade Rodents = (Mouse, Rat) [color: "#E53935", label: "Rodents", highlight: background] clade Carnivora = (Dog, Cat, Tiger) [color: "#43A047", label: "Carnivora", highlight: both] clade Cetacea = (Whale, Dolphin) [color: "#FB8C00", label: "Cetacea", highlight: background] scale "substitutions/site" ``` -------------------------------- ### Full ATM use case diagram with actors and associations Source: https://schematex.js.org/docs/usecase Complete example showing the `usecase` keyword, `title`, `system`, multiple `actor` and `usecase` declarations, and plain associations (`--`) between actors and use cases, and between use cases and the external bank actor. ```schematex usecase title: "ATM" system: "ATM System" actor: Customer actor: Bank (external) usecase: "Withdraw Cash" as Withdraw usecase: "Deposit Funds" as Deposit usecase: "Check Balance" as Check Customer -- Withdraw Customer -- Deposit Customer -- Check Withdraw -- Bank Deposit -- Bank Check -- Bank ``` -------------------------------- ### Schematex ecomap example: Nguyen Family Resettlement Source: https://schematex.js.org/docs/ecomap Defines a complete ecomap with a central family node, surrounding systems, and relationship lines with labels and categories. The example shows the syntax for nodes, labels, categories, and relationship types (strong, tenuous, stressful) with direction. ```schematex ecomap "Nguyen Family Resettlement" center: family [label: "Nguyen Family"] resettlement [label: "IRC Office", category: government] school [label: "Lincoln Elementary", category: education] clinic [label: "Community Clinic", category: health] caseworker [label: "Ms. Patel", category: mental-health] temple [label: "Vietnamese Temple", category: cultural] neighbors [label: "Sponsor Family", category: community] employer [label: "Warehouse Job", category: work] family === resettlement [label: "active case"] family === school clinic --> family [label: "vaccinations"] caseworker <-> family [label: "weekly"] family === temple [label: "anchor"] neighbors === family [label: "housing host"] family --- employer [label: "new, part-time"] ``` -------------------------------- ### Dependency types with lag and lead Source: https://schematex.js.org/docs/pert Illustrates all four Precedence-Diagramming relationships and lag/lead modifiers. `SS+1` starts 1 day after the predecessor starts, `D+3` is FS with a 3-day lag, `SS-1` is a lead, `FF` finishes when the predecessor finishes, and `SF+1` is a rare start-to-finish relationship. ```schematex task B "Stakeholder interviews" duration: 6 after: A SS+1 # start 1d after A starts task I "Documentation" duration: 4 after: D+3 # FS with a 3-day lag task J "Translation" duration: 3 after: I SS-1 # start 1d before I starts (lead) task K "Sign-off" duration: 1 after: I FF # finishes when I finishes task L "Press release" duration: 2 after: G SF+1 # start-to-finish (rare) ``` -------------------------------- ### ML config example Source: https://schematex.js.org/docs/decisiontree Shows a complete ML decision tree configuration with direction, impurity metric, and class labels. The `classes` option is a comma-separated list of class names for display. ```text decisiontree:ml "Loan classifier" direction: top-down impurity: gini classes: Approved, Denied, Review ``` -------------------------------- ### Complete one-line diagram with ATS backup and cable labels Source: https://schematex.js.org/docs/sld A full Schematics example defining nodes (utility, generator, ATS, bus, breakers, loads) and connections with labels and cable attributes. Demonstrates a typical backup power system with normal and emergency sources. ```schematex sld "ATS backup with cable labels" UTIL = utility [label: "Utility 480V"] GEN = generator [rating: "500 kW", label: "Emergency Gen"] ATS1 = ats [rating: "800A", label: "ATS-1"] BUS1 = bus [voltage: "480V", label: "Critical Bus"] CB1 = breaker [rating: "200A", label: "CB-1"] CB2 = breaker [rating: "200A", label: "CB-2"] L1 = load [label: "Server Room"] L2 = load [label: "Life Safety"] UTIL -> ATS1 [label: "Normal source"] GEN -> ATS1 [label: "Emergency source"] ATS1 -> BUS1 [cable: "3#2/0 AWG"] BUS1 -> CB1 BUS1 -> CB2 CB1 -> L1 [cable: "3#4 AWG"] CB2 -> L2 [cable: "3#4 AWG"] ``` -------------------------------- ### Genogram example: The Potter Family Source: https://schematex.js.org/docs/genogram A complete genogram definition in Schematex syntax. It defines family members with attributes (gender, birth/death years, deceased, index), relationships (marriage, parent-child), and emotional connections (cutoff, hostile, close). The example uses the McGoldrick standard and GenoPro taxonomy. ```schematex genogram "The Potter Family" fleamont [male, 1909, 1979, deceased] euphemia [female, 1920, 1979, deceased] fleamont -- euphemia james [male, 1960, 1981, deceased] mr_evans [male, 1925, deceased] mrs_evans [female, 1928, deceased] mr_evans -- mrs_evans lily [female, 1960, 1981, deceased] petunia [female, 1958] james -- lily "m. 1978" harry [male, 1980, index] petunia -- vernon [male, 1951] dudley [male, 1980] harry -cutoff- petunia harry -hostile- dudley harry -close- lily ``` -------------------------------- ### pros-cons example: microservices migration Source: https://schematex.js.org/docs/comparison Uses `mode: pros-cons` with `pro` and `con` lines. `pro` lines fill the green column, `con` lines the red column; order is independent. ```schematex comparison "Migrate to microservices?" mode: pros-cons pro "Independent team deploys" pro "Scale hot paths in isolation" con "Distributed-systems complexity" con "Operational + infra cost goes up" ``` -------------------------------- ### CART decision tree example for Iris classification Source: https://schematex.js.org/docs/decisiontree A complete Schematex example for a CART decision tree. It uses the 'decisiontree:ml' directive with options for direction and impurity, and defines split and leaf nodes with properties such as feature, op, threshold, samples, gini, and class. The tree classifies Iris samples into Setosa, Versicolor, and Virginica. ```schematex decisiontree:ml "Iris classification (CART)" direction: top-down impurity: gini split "Petal length ≤ 2.45" feature=petal_length op="<=" threshold=2.45 samples=150 gini=0.667 true leaf "Setosa" class=Iris-setosa value=50 gini=0.0 false split "Petal width ≤ 1.75" feature=petal_width op="<=" threshold=1.75 samples=100 gini=0.5 true leaf "Versicolor" class=Iris-versicolor value=50 gini=0.0 false leaf "Virginica" class=Iris-virginica value=50 gini=0.0 ``` -------------------------------- ### Block diagram example: Audio dynamics processor Source: https://schematex.js.org/docs/block Shows the Schematex blockdiagram syntax for a signal chain with blocks, summing junctions, and signal connections. Uses the Laplace-domain transfer-function convention with explicit +/− polarity signs and a discrete flag for dashed lines. The example models an audio dynamics processor with a side-chain feedback path. ```schematex blockdiagram "Audio dynamics processor" # Signal chain in_s = signal("Input") gate_s = signal("gated") comp_s = signal("compressed") out_s = signal("Output") # Blocks gate = block("Noise gate") [role: controller] comp = block("Compressor") [role: plant] eq = block("3-band EQ") [role: generic] limiter = block("Limiter") [role: actuator] # Level detection side-chain detect = block("Level detect") [role: sensor] sum_g = sum(+in_s, -detect) # Forward path in -> in_s in_s -> sum_g sum_g -> gate gate -> gate_s gate_s -> comp comp -> comp_s comp_s -> eq eq -> limiter limiter -> out_s # Side-chain feedback limiter -> detect ``` -------------------------------- ### Rendered sheet scale note Source: https://schematex.js.org/docs/evacuation Example of the note automatically generated on each rendered evacuation sheet. ```text Scale 1:200 on A3 (landscape) · symbols 8.0 mm · ISO 23601 ✓ ``` -------------------------------- ### Decision Tree Analysis Example Source: https://schematex.js.org/docs/decisiontree A complete decision tree model for cloud vendor selection, demonstrating decision nodes, chance nodes with probabilities, and terminal payoff values. ```schematex decisiontree:decision "Cloud vendor selection" decision "Which vendor?" choice "Build in-house" chance "Project outcome" prob 0.6 end "On-time delivery" payoff=900000 prob 0.4 end "Over budget / delayed" payoff=150000 choice "Managed SaaS vendor" end "Predictable cost" payoff=500000 choice "Hybrid approach" chance "Integration complexity" prob 0.5 end "Smooth integration" payoff=700000 prob 0.5 end "Integration rework" payoff=300000 ``` -------------------------------- ### Define a tree using Newick format Source: https://schematex.js.org/docs/phylo An example of using the Newick format within a Schematex block. ```schematex phylo "Newick examples" newick: "((A:0.1,B:0.2):0.05[&&NHX:B=98],(C:0.3,D:0.4):0.08[&&NHX:B=87]);" ``` -------------------------------- ### Time-parameterized action qualifiers Source: https://schematex.js.org/docs/sfc Example showing the use of L (Time-Limited) and D (Time-Delayed) qualifiers with duration literals. ```text step S1 L LimitedRun T#5s D DelayedRun T#2s ``` -------------------------------- ### Define a basic ERD with Customer and Order tables Source: https://schematex.js.org/docs/erd This example demonstrates the minimal structure for an ERD, including table definitions with primary keys, foreign keys, and a relationship reference. ```schematex erd table Customer { customer_id int PK email varchar UK } table Order { order_id int PK customer_id int FK -> Customer.customer_id } ref Order.customer_id many-mandatory -- one-mandatory Customer.customer_id : "places" ``` -------------------------------- ### Define a mindmap with Schematex features Source: https://schematex.js.org/docs/mindmap A complete mindmap example demonstrating the use of directives and hierarchical labels. ```schematex mindmap %% style: logic-right %% maxLabelWidth: 200 # Schematex features ## DSL-first design - One keyword per diagram - AI-friendly syntax - CJK support ## Zero dependencies - Hand-written parser - No D3, no dagre - ~KB-level bundle ## Standards-compliant - IEEE for logic gates - IEC for circuits - McGoldrick for genograms ``` -------------------------------- ### Define Market Entry influence diagram Source: https://schematex.js.org/docs/decisiontree An example of a market-entry decision using the mode: influence directive. ```schematex decisiontree "Market Entry" mode: influence decision Enter "Enter market?" chance Demand "Market demand" chance Competition "Competitor response" value V "Profit" utility=120 Demand -> Enter Demand -> V Competition -> V Enter -> V ``` -------------------------------- ### Implement jumps and loops Source: https://schematex.js.org/docs/sfc Transitions targeting earlier steps render as margin arrows. Jumps back to the initial step appear on the left, while forward-looping back-edges appear on the right. ```text step S0 [initial] step S1 step S2 transition from: S0 to: S1: A transition from: S1 to: S2: B transition T_Reset from: S2 to: S0: ResetBtn transition from: S2 to: S1: NOT ResetBtn ```