🧠 Second Brain

Search

Search IconIcon to open search

PlantUML

Last updated Jun 28, 2024

PlantUML is an open-source tool allowing users to create diagrams from a plain text language. Besides various UML diagrams, PlantUML has support for various other software development related formats, as well as visualisation of JSON and YAML files. The language of PlantUML is an example of a domain-specific language

There’s also an extension for Obsidian GitHub - joethei/obsidian-plantuml: Generate PlantUML Diagrams inside Obsidian.md.

# Comparison to Mermaid

Mermaid is very similar. Comparison from Mermaid looks similar to PlantUML. Anyone that gave used both and can compare? | Hacker News:

pizza234 on Feb 14, 2022 | next [–]

In the past I used to use Mermaid for simple (but not trivial) flow charts and class diagrams.
I’ve found some minor rough edges, but in particular, a couple of missing features, one of which I needed (edges going from attribute to attribute in class diagrams).

PlantUML didn’t have any of those limitations, so I switched, and never looked back.

For simple-but-not-trivial diagrams, I didn’t find any substantial difference in terms of syntax (complexity). I don’t have experience on complex diagrams, though.

majkinetor on Feb 14, 2022 | prev | next [–]

PlantUML offered more decade ago. Marmaid is a toy compared to it.
However, since its so powerful, its hard to write. Actually, any given diagram is not that hard, but to keep all those syntax rules in head is IMO almost impossible.

Ciph on Feb 14, 2022 | prev [–]

They are quite similar, PlantUML has support for more types of diagrams than mermaid (such as network diagram), but IMO PlantUML is “messier” to write, I find Mermaid more elegant in writing diagrams.

# Example

Mermaid:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
graph TD
    subgraph "Data Domain (1-n)"
        DD[Data Domain] -->|Persistent Storage| PG[Postgres]
        DD[Data Domain] -->|Data Modeling| DBT[dbt]
        DD[Data Domain] -->|Visualization| SU[Superset]
        DD[Data Domain] -->|IDE| JH[JupyterHub]
        JH[JupyterHub] --> |per-user| JN[JupyterNotebooks]
        JH[JupyterHub] --> |per-Session| pip[libraries/Dockerfile] 
        JH[JupyterHub] --> |generated-secrets-pws| VL[Vault]
    end

    BusinessDomain -->|Contains 1-n| DD
    DD -->|n-instances| Workspaces

PlantUML:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
@startuml

package "Data Domain (1-n)" {
    [Data Domain] --> [Postgres] : Persistent Storage
    [Data Domain] --> [dbt] : Data Modeling
    [Data Domain] --> [Superset] : Visualization
    [Data Domain] --> [JupyterHub] : IDE
    [JupyterHub] --> [JupyterNotebooks] : per-user
    [JupyterHub] --> [libraries/Dockerfile] : per-Session
    [JupyterHub] --> [Vault] : generated-secrets-pws
}

[BusinessDomain] --> [Data Domain] : Contains 1-n
[Data Domain] --> [Workspaces] : n-instances

@enduml

Rendered:


Origin:
References:
Created 2024-05-24