https://github.com/antononcube/wl-mermaidjs-paclet
Wolfram Language (aka Mathematica) paclet for obtaining Mermaid-JS images and graphics.
https://github.com/antononcube/wl-mermaidjs-paclet
mermaid-charting-language mermaid-cli mermaid-diagrams mermaidjs wolfram-language wolfram-mathematica
Last synced: 6 months ago
JSON representation
Wolfram Language (aka Mathematica) paclet for obtaining Mermaid-JS images and graphics.
- Host: GitHub
- URL: https://github.com/antononcube/wl-mermaidjs-paclet
- Owner: antononcube
- License: mit
- Created: 2023-04-24T16:21:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-21T00:30:54.000Z (over 1 year ago)
- Last Synced: 2025-02-08T11:13:09.133Z (8 months ago)
- Topics: mermaid-charting-language, mermaid-cli, mermaid-diagrams, mermaidjs, wolfram-language, wolfram-mathematica
- Language: Mathematica
- Homepage: https://resources.wolframcloud.com/PacletRepository/resources/AntonAntonov/MermaidJS/
- Size: 2.85 MB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MermaidJS WL paclet
Wolfram Language (aka Mathematica) paclet for obtaining Mermaid-JS images and graphics.
- Mermaid lets you create diagrams and visualizations using text and code.
- Mermaid has different types of diagrams: Flowchart, Sequence Diagram, Class Diagram, State Diagram, Entity Relationship Diagram, User Journey, Gantt, Pie Chart, Requirement Diagram, and others.
- Mermaid-js is a JavaScript based diagramming and charting tool that renders Markdown-inspired text definitions to create and modify diagrams dynamically.
- `MermaidJS` and `MermaidInk` are very similar; the main difference is in which environment the mermaid-js specifications are converted into images.
- `MermaidInk` uses the Web API mermaid.ink.
- `MermaidJS` uses a local installation of mermaid-cli via the shell program mmdc.
Here is an example:
```mathematica
MermaidInk["
classDiagram
Animal <|-- Duck
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
"]
```
----
## Flowchart
Here is a diagram that clarifies the execution of `MermaidInk`:
```mermaid
graph TD
UI[/User input/]
MS{{Mermaid-ink server}}
WL{{Wolfram Language}}
WLnb>Notebook]
WLIC[[Input cell]]
WLOC[[Output cell]]
MI[MermaidInk]
UI --> WLIC -.- WLnb
WLIC --> MI -.- WL
MI --> |spec|MS
MS --> |image|MI
MI --> WLOC -.- WLnb
WLnb -.- WL
```