schematex 0.6.7 → 0.6.9

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.
Files changed (33) hide show
  1. package/README.md +101 -6
  2. package/README.zh-CN.md +783 -0
  3. package/dist/ai/ai-sdk.cjs +8 -8
  4. package/dist/ai/ai-sdk.d.cts +1 -1
  5. package/dist/ai/ai-sdk.d.ts +1 -1
  6. package/dist/ai/ai-sdk.js +3 -3
  7. package/dist/ai/index.cjs +14 -14
  8. package/dist/ai/index.js +3 -3
  9. package/dist/browser.cjs +9 -9
  10. package/dist/browser.js +3 -3
  11. package/dist/{chunk-WK36Z63Y.cjs → chunk-25TO5A4F.cjs} +5 -5
  12. package/dist/{chunk-WK36Z63Y.cjs.map → chunk-25TO5A4F.cjs.map} +1 -1
  13. package/dist/{chunk-WAKRRGAV.js → chunk-2TUZ3QJA.js} +110 -2
  14. package/dist/chunk-2TUZ3QJA.js.map +1 -0
  15. package/dist/{chunk-TRUJ4Q6V.js → chunk-3DPWFWQU.js} +41 -12
  16. package/dist/{chunk-TRUJ4Q6V.js.map → chunk-3DPWFWQU.js.map} +1 -1
  17. package/dist/{chunk-LDONE225.cjs → chunk-5IZL57YJ.cjs} +42 -13
  18. package/dist/{chunk-LDONE225.cjs.map → chunk-5IZL57YJ.cjs.map} +1 -1
  19. package/dist/{chunk-QBS4F44Q.cjs → chunk-J3EPFZPX.cjs} +110 -2
  20. package/dist/chunk-J3EPFZPX.cjs.map +1 -0
  21. package/dist/{chunk-EVEPI423.js → chunk-Q5V4LUQR.js} +3 -3
  22. package/dist/{chunk-EVEPI423.js.map → chunk-Q5V4LUQR.js.map} +1 -1
  23. package/dist/diagrams/circuit/index.cjs +8 -8
  24. package/dist/diagrams/circuit/index.d.cts +0 -9
  25. package/dist/diagrams/circuit/index.d.ts +0 -9
  26. package/dist/diagrams/circuit/index.js +1 -1
  27. package/dist/index.cjs +27 -27
  28. package/dist/index.js +4 -4
  29. package/dist/react.cjs +3 -3
  30. package/dist/react.js +2 -2
  31. package/package.json +5 -5
  32. package/dist/chunk-QBS4F44Q.cjs.map +0 -1
  33. package/dist/chunk-WAKRRGAV.js.map +0 -1
package/README.md CHANGED
@@ -15,6 +15,10 @@
15
15
  <a href="https://www.npmjs.com/package/schematex">npm</a>
16
16
  </p>
17
17
 
18
+ <p align="center">
19
+ <strong>English</strong> · <a href="./README.zh-CN.md">简体中文</a>
20
+ </p>
21
+
18
22
  <p align="center">
19
23
  <a href="https://www.npmjs.com/package/schematex"><img src="https://img.shields.io/npm/v/schematex.svg?color=cb3837&label=npm" alt="npm"></a>
20
24
  <a href="https://bundlephobia.com/package/schematex"><img src="https://img.shields.io/bundlephobia/minzip/schematex?label=gzip" alt="bundle size"></a>
@@ -29,17 +33,21 @@
29
33
 
30
34
  ---
31
35
 
32
- **Schematex** is the open-source rendering engine for the diagrams professionals actually use — medical, electrical, legal, and analytical. 33 diagram families across ten domains:
36
+ **Schematex** is the open-source rendering engine for the diagrams professionals actually use — medical, electrical, legal, and analytical. **36 diagram families** spanning medicine, engineering, law, and analysis:
33
37
 
34
38
  - 👪 **Relationships** — genograms, ecomaps, pedigrees, sociograms, phylogenetic trees
35
39
  - ⚡ **Electrical & Industrial** — ladder logic, single-line diagrams, circuit schematics, logic gates, timing, block diagrams, **FBD**, **SFC**, breadboard, **P&ID** (ISA-5.1)
36
- - 🏢 **Corporate & Legal** — entity structures, cap tables
37
- - 🐟 **Causality & Analysis** — fishbone / Ishikawa, decision trees (Howard-Raiffa EV · CART/sklearn · taxonomy)
38
- - 🔄 **Behavior modeling** — UML 2.5 / Harel **state diagrams** (Mermaid-compatible superset), **BPMN 2.0** (OMG), **use case diagrams** (UML 2.5.1 §18), **sequence diagrams** (UML 2.5.1 §17 — all 12 combined fragments + `ref`)
39
- - 🗄️ **Data modeling** — ERD crow's-foot notation
40
+ - 🔄 **Behavior & process** — UML 2.5 / Harel **state diagrams** (Mermaid-compatible superset), **BPMN 2.0** (OMG), **use case diagrams** (UML 2.5.1 §18), **sequence diagrams** (UML 2.5.1 §17 — all 12 combined fragments + `ref`)
41
+ - 🧩 **Software & data modeling** — **UML class diagrams** (UML 2.5.1 §9–§11, namespaces + 6 relationships), **ERD** crow's-foot notation
42
+ - 🏢 **Corporate & Legal** — entity structures, cap tables, org charts
43
+ - 🐟 **Causality & Analysis** — fishbone / Ishikawa, decision trees (Howard-Raiffa EV · CART/sklearn · taxonomy), Venn / Euler
44
+ - 🛡️ **Risk & Reliability** — **fault trees** (NUREG-0492 / IEC 61025) that *compute* MOCUS minimal cut sets + P(top), **bowtie** barrier-based risk (CCPS / Energy Institute 2018)
40
45
  - 🗓️ **Project management** — **PERT / CPM** networks (PMBOK 7) that *compute* the schedule: ES/EF/LS/LF, slack, critical path, three-point estimation, swimlanes, time-scaled layout
41
46
  - 🖧 **Network & Infrastructure** — **network topology** diagrams (Cisco-convention icons) with device/link/port integrity, IP-CCTV camera systems, three-tier campus, spine-leaf fabric, subnets & VLANs
47
+ - ◉ **Concurrency** — **Petri nets** (Murata 1989 / ISO-IEC 15909) that *compute* enablement and fire token sequences
48
+ - 🔬 **Research** — **PRISMA 2020** systematic-review flow diagrams
42
49
  - 📅 **Timelines** — proportional / equidistant / log axis · swimlane · gantt · lollipop · BC dates · geological Ma scale
50
+ - 🧠 **Knowledge & strategy** — mindmaps, 2×2 / N×M matrices, flowcharts
43
51
 
44
52
  Mermaid draws generic flowcharts. Schematex draws the diagrams doctors, engineers, and lawyers actually use — a genogram a genetic counselor accepts clinically, ladder logic that maps 1:1 to IEC 61131-3, a cap table that survives a Series A review.
45
53
 
@@ -74,7 +82,7 @@ import { render } from 'schematex/genogram';
74
82
 
75
83
  ## Gallery
76
84
 
77
- 31 diagram types, one unified pipeline. **Try any of these live at [schematex.dev/playground](https://schematex.dev/playground).**
85
+ All 36 diagram types share one unified pipeline. A selection is shown below — **try any of them live at [schematex.dev/playground](https://schematex.dev/playground).**
78
86
 
79
87
  ### 👪 Genogram — *McGoldrick family-systems standard*
80
88
 
@@ -576,6 +584,93 @@ network "Acme HQ — CCTV"
576
584
 
577
585
  [Network topology syntax →](https://schematex.dev/docs/network)
578
586
 
587
+ ---
588
+
589
+ ### 📐 UML class diagram — *UML 2.5.1 §9–§11*
590
+
591
+ Classifiers (class / interface / enum / datatype / primitive), all six relationship kinds with standard-correct adornments, and a **generalization-driven layered layout** where parents float to the top and connectors never cross a box. Namespaces render as nested containment frames. Accepts the Mermaid `classDiagram` glyphs for one-line migration.
592
+
593
+ ```
594
+ umlclass
595
+ title: "Shape hierarchy"
596
+
597
+ «interface» Shape {
598
+ + area() : double
599
+ + perimeter() : double
600
+ }
601
+
602
+ abstract class AbstractShape {
603
+ # name : String
604
+ + area() : double {abstract}
605
+ + perimeter() : double {abstract}
606
+ + describe() : String
607
+ }
608
+
609
+ class Circle {
610
+ + radius : double
611
+ + area() : double
612
+ }
613
+
614
+ class Square {
615
+ + side : double
616
+ + area() : double
617
+ }
618
+
619
+ Shape <|.. AbstractShape
620
+ AbstractShape <|-- Circle
621
+ AbstractShape <|-- Square
622
+ ```
623
+
624
+ ![UML class shape hierarchy](examples/umlclass/shape-hierarchy.svg)
625
+
626
+ [UML class syntax →](https://schematex.dev/docs/umlclass)
627
+
628
+ ---
629
+
630
+ ### 🛡️ Fault tree — *NUREG-0492 / IEC 61025 · MOCUS*
631
+
632
+ Reliability fault trees where the engine **computes the answer**: it runs MOCUS to enumerate the minimal cut sets (red boxes), flags single points of failure, and computes the top-event probability. AND domes, OR/XOR shields, k-of-n voting, INHIBIT, PAND.
633
+
634
+ ```
635
+ faulttree "Both pumps fail"
636
+ analysis: cutsets, probability
637
+ top T "Both redundant pumps fail" = AND(PA, PB)
638
+ basic PA "Pump A fails" p: 0.01
639
+ basic PB "Pump B fails" p: 0.01
640
+ ```
641
+
642
+ ![Redundant pump fault tree](examples/faulttree/pump-redundancy.svg)
643
+
644
+ [Fault tree syntax →](https://schematex.dev/docs/faulttree)
645
+
646
+ ---
647
+
648
+ ### 🎀 Bowtie — *CCPS / Energy Institute 2018 barrier model*
649
+
650
+ Barrier-based risk management for one major-accident scenario: threats fan in through preventative-barrier chains (left), consequences fan out through mitigative chains (right), around a central top-event knot. **Correct by construction** — a threat or consequence drawn with no barrier is rejected, not silently shown.
651
+
652
+ ```
653
+ bowtie "LPG storage — loss of containment"
654
+ hazard "LPG stored under pressure"
655
+ topevent "Loss of containment"
656
+ threat "Corrosion of vessel wall"
657
+ prevent "Corrosion-resistant coating"
658
+ prevent "UT thickness inspection"
659
+ threat "Overpressure during filling"
660
+ prevent "High-pressure trip (SIL 2)"
661
+ prevent "Pressure relief valve"
662
+ consequence "Jet fire"
663
+ mitigate "Gas detection + ESD"
664
+ mitigate "Deluge / water spray"
665
+ consequence "Vapour cloud explosion"
666
+ mitigate "Ignition-source control (ATEX)"
667
+ mitigate "Blast-resistant control room"
668
+ ```
669
+
670
+ ![LPG loss-of-containment bowtie](examples/bowtie/lpg-loss-of-containment.svg)
671
+
672
+ [Bowtie syntax →](https://schematex.dev/docs/bowtie)
673
+
579
674
  ## Why SchemaTex?
580
675
 
581
676
  **Generic flowchart tools can't draw professional diagrams.** Every diagram domain has published standards — symbol conventions, layout rules, labelling grammars — and when you ignore them, domain experts reject the output: