@dskripchenko/diagrams 1.1.0 → 1.2.0

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 (5) hide show
  1. package/README.md +25 -4
  2. package/dist/index.cjs +16479 -10751
  3. package/dist/index.d.ts +663 -3
  4. package/dist/index.mjs +16477 -10752
  5. package/package.json +9 -2
package/README.md CHANGED
@@ -4,8 +4,8 @@
4
4
  [![npm](https://img.shields.io/npm/v/@dskripchenko/diagrams.svg)](https://www.npmjs.com/package/@dskripchenko/diagrams)
5
5
  [![license](https://img.shields.io/npm/l/@dskripchenko/diagrams.svg)](LICENSE)
6
6
 
7
- Diagrams written in Mermaid syntax, rendered to SVG — with **no runtime
8
- dependencies** and **no DOM**. A string goes in, a string of SVG comes out:
7
+ Diagrams written as text — in **Mermaid** or **PlantUML** syntax — rendered
8
+ to SVG, with **no runtime dependencies** and **no DOM**. A string goes in, a string of SVG comes out:
9
9
  the same call works in a browser, in server-side rendering and in a Node
10
10
  build script.
11
11
 
@@ -18,12 +18,24 @@ const { svg } = render(`flowchart LR
18
18
  B -->|no| D[Reject]`)
19
19
 
20
20
  element.innerHTML = svg
21
+
22
+ // PlantUML: recognised by its @startuml.
23
+ render(`@startuml
24
+ actor User
25
+ User -> API ++ : POST /orders
26
+ return 201
27
+ @enduml`)
21
28
  ```
22
29
 
23
30
  **Supported:** `flowchart` (with subgraphs and per-subgraph direction),
24
31
  `sequenceDiagram`, `stateDiagram-v2`, `erDiagram`, `classDiagram`, C4
25
32
  (`C4Context`, `C4Container`, `C4Component`, `C4Dynamic`, `C4Deployment`),
26
- `pie`, `gantt`, `timeline`, `xychart-beta`, `mindmap`.
33
+ `pie`, `gantt`, `timeline`, `xychart-beta`, `mindmap`, `journey`,
34
+ `quadrantChart`, `kanban`, `requirementDiagram`, `architecture-beta`,
35
+ `sankey-beta`, `gitGraph`, `block-beta`; PlantUML sequence,
36
+ use case, component, deployment, activity (with swimlanes), class, object,
37
+ state, ER, C4 (C4-PlantUML) and timing diagrams, mind maps, WBS, Gantt
38
+ charts and Salt wireframes.
27
39
 
28
40
  ## Why another renderer
29
41
 
@@ -42,7 +54,7 @@ element.innerHTML = svg
42
54
  - **Errors you can act on.** A source that cannot be read raises a
43
55
  `DiagramError` with the line, the column and, where there is one, a hint.
44
56
 
45
- The syntax is a declared subset of Mermaid's. What is supported is listed
57
+ The syntax is a declared subset of Mermaid's and PlantUML's. What is supported is listed
46
58
  per diagram type in the documentation; anything else is an error rather
47
59
  than a silently wrong picture.
48
60
 
@@ -61,6 +73,15 @@ than a silently wrong picture.
61
73
  | Timeline | [en](docs/en/timeline.md) | [ru](docs/ru/timeline.md) | [de](docs/de/timeline.md) | [zh](docs/zh/timeline.md) |
62
74
  | XY chart | [en](docs/en/xychart.md) | [ru](docs/ru/xychart.md) | [de](docs/de/xychart.md) | [zh](docs/zh/xychart.md) |
63
75
  | Mind map | [en](docs/en/mindmap.md) | [ru](docs/ru/mindmap.md) | [de](docs/de/mindmap.md) | [zh](docs/zh/mindmap.md) |
76
+ | Journey | [en](docs/en/journey.md) | [ru](docs/ru/journey.md) | [de](docs/de/journey.md) | [zh](docs/zh/journey.md) |
77
+ | Quadrant chart | [en](docs/en/quadrant.md) | [ru](docs/ru/quadrant.md) | [de](docs/de/quadrant.md) | [zh](docs/zh/quadrant.md) |
78
+ | Kanban board | [en](docs/en/kanban.md) | [ru](docs/ru/kanban.md) | [de](docs/de/kanban.md) | [zh](docs/zh/kanban.md) |
79
+ | Requirement diagram | [en](docs/en/requirement.md) | [ru](docs/ru/requirement.md) | [de](docs/de/requirement.md) | [zh](docs/zh/requirement.md) |
80
+ | Architecture diagram | [en](docs/en/architecture.md) | [ru](docs/ru/architecture.md) | [de](docs/de/architecture.md) | [zh](docs/zh/architecture.md) |
81
+ | Sankey diagram | [en](docs/en/sankey.md) | [ru](docs/ru/sankey.md) | [de](docs/de/sankey.md) | [zh](docs/zh/sankey.md) |
82
+ | Git graph | [en](docs/en/gitgraph.md) | [ru](docs/ru/gitgraph.md) | [de](docs/de/gitgraph.md) | [zh](docs/zh/gitgraph.md) |
83
+ | Block diagram | [en](docs/en/block.md) | [ru](docs/ru/block.md) | [de](docs/de/block.md) | [zh](docs/zh/block.md) |
84
+ | PlantUML | [en](docs/en/plantuml.md) | [ru](docs/ru/plantuml.md) | [de](docs/de/plantuml.md) | [zh](docs/zh/plantuml.md) |
64
85
  | Theming | [en](docs/en/theming.md) | [ru](docs/ru/theming.md) | [de](docs/de/theming.md) | [zh](docs/zh/theming.md) |
65
86
 
66
87
  ## Install