Convert Figma logo to code with AI

plantuml logoplantuml

Generate diagrams from textual description

11,381
1,034
11,381
506

Top Related Projects

1,302

draw.io is a JavaScript, client-side editor for general diagramming.

78,653

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown

Virtual whiteboard for sketching hand-drawn like diagrams

3,223

Creates diagrams from textual descriptions!

1,412

Structurizr DSL

20,479

D2 is a modern diagram scripting language that turns text to diagrams.

Quick Overview

PlantUML is an open-source tool that allows users to create UML diagrams from a simple and intuitive text language. It supports a wide variety of diagram types, including sequence diagrams, use case diagrams, class diagrams, and more. PlantUML can be integrated into various development environments and documentation tools.

Pros

  • Easy-to-learn text-based diagram creation
  • Supports multiple diagram types and styles
  • Integrates well with various tools and platforms
  • Generates high-quality vector graphics

Cons

  • Limited customization options for complex diagrams
  • Syntax can become verbose for large diagrams
  • Learning curve for advanced features
  • Output styling options are somewhat limited

Code Examples

  1. Simple Class Diagram:
@startuml
class Car {
  -String model
  -int year
  +void start()
  +void stop()
}
class Driver {
  -String name
  -int age
  +void drive(Car car)
}
Driver -- Car : drives >
@enduml
  1. Basic Sequence Diagram:
@startuml
Alice -> Bob: Hello
Bob --> Alice: Hi there
Alice -> Bob: How are you?
Bob --> Alice: I'm good, thanks!
@enduml
  1. Use Case Diagram:
@startuml
left to right direction
actor Customer
rectangle "Online Store" {
  usecase "Browse Products" as UC1
  usecase "Add to Cart" as UC2
  usecase "Checkout" as UC3
}
Customer -- UC1
Customer -- UC2
Customer -- UC3
@enduml

Getting Started

  1. Install PlantUML (varies by platform, e.g., download JAR or use package manager)
  2. Create a new file with .puml extension
  3. Start the diagram with @startuml
  4. Add your diagram content using PlantUML syntax
  5. End the diagram with @enduml
  6. Use the PlantUML command-line tool or an integrated editor to generate the diagram

Example:

@startuml
Alice -> Bob: Hello
Bob --> Alice: Hi
@enduml

Save this as example.puml and run java -jar plantuml.jar example.puml to generate the diagram.

Competitor Comparisons

1,302

draw.io is a JavaScript, client-side editor for general diagramming.

Pros of draw.io

  • User-friendly graphical interface for creating diagrams
  • Supports a wide variety of diagram types and styles
  • Offers real-time collaboration features

Cons of draw.io

  • Requires a web browser or desktop application to use
  • May have a steeper learning curve for complex diagrams
  • Limited automation capabilities compared to text-based solutions

Code Comparison

PlantUML uses a simple text-based syntax:

@startuml
Alice -> Bob: Hello
Bob --> Alice: Hi there
@enduml

draw.io uses XML-based format, which is typically generated by the GUI:

<mxGraphModel>
  <root>
    <mxCell id="0"/>
    <mxCell id="1" parent="0"/>
    <mxCell id="2" value="Hello" edge="1" parent="1" source="3" target="4"/>
  </root>
</mxGraphModel>

While PlantUML focuses on text-based diagram creation, draw.io provides a more visual approach with its graphical interface. PlantUML excels in version control and quick text-based diagramming, while draw.io offers a more intuitive drag-and-drop experience with a wider range of diagram types. The choice between the two depends on personal preference, project requirements, and the desired balance between simplicity and visual customization.

78,653

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown

Pros of Mermaid

  • Browser-based rendering, no need for external tools
  • Easier integration with web applications and Markdown
  • More modern syntax, often simpler for basic diagrams

Cons of Mermaid

  • Less extensive diagram types compared to PlantUML
  • Limited customization options for complex diagrams
  • Smaller community and ecosystem

Code Comparison

Mermaid:

graph TD
    A[Start] --> B{Is it?}
    B -->|Yes| C[OK]
    B -->|No| D[End]

PlantUML:

@startuml
start
if (Is it?) then (Yes)
  :OK;
else (No)
  :End;
endif
@enduml

Both Mermaid and PlantUML are popular tools for creating diagrams using text-based descriptions. Mermaid excels in web-based environments and offers a more straightforward syntax for simple diagrams. PlantUML, on the other hand, provides a wider range of diagram types and more customization options, making it suitable for complex diagrams and software architecture visualization. The choice between the two depends on the specific use case, integration requirements, and the level of diagram complexity needed.

Virtual whiteboard for sketching hand-drawn like diagrams

Pros of Excalidraw

  • User-friendly interface for creating hand-drawn style diagrams
  • Real-time collaboration features
  • Easily embeddable in web applications

Cons of Excalidraw

  • Limited diagram types compared to PlantUML's extensive options
  • Less suitable for complex technical diagrams or UML
  • Requires a web browser to use, while PlantUML can be used offline

Code Comparison

Excalidraw (JavaScript):

const element = createElement({
  type: "rectangle",
  x: 100,
  y: 100,
  width: 200,
  height: 100,
});

PlantUML (UML syntax):

@startuml
class Rectangle {
  +x: int
  +y: int
  +width: int
  +height: int
}
@enduml

While Excalidraw uses JavaScript to create elements programmatically, PlantUML employs a domain-specific language for defining UML diagrams. This difference reflects their distinct approaches: Excalidraw as a drawing tool and PlantUML as a text-based diagramming solution.

3,223

Creates diagrams from textual descriptions!

Pros of Kroki

  • Supports multiple diagram types beyond PlantUML, including Mermaid, Graphviz, and more
  • Offers a unified API for generating various diagrams, simplifying integration
  • Provides Docker images for easy deployment and scalability

Cons of Kroki

  • Requires more setup and infrastructure compared to PlantUML's standalone JAR
  • May have higher resource usage due to supporting multiple diagram types
  • Less focused on PlantUML-specific features and optimizations

Code Comparison

PlantUML example:

@startuml
Alice -> Bob: Hello
Bob --> Alice: Hi there
@enduml

Kroki example (using PlantUML):

POST /plantuml/svg HTTP/1.1
Content-Type: text/plain

@startuml
Alice -> Bob: Hello
Bob --> Alice: Hi there
@enduml

While the diagram syntax remains the same, Kroki uses an HTTP API to generate diagrams, whereas PlantUML can be used directly as a library or command-line tool.

1,412

Structurizr DSL

Pros of Structurizr DSL

  • More focused on software architecture and system design
  • Supports multiple output formats (diagrams, documentation, etc.)
  • Better integration with development workflows and CI/CD pipelines

Cons of Structurizr DSL

  • Steeper learning curve compared to PlantUML's simpler syntax
  • Less extensive diagram types and customization options
  • Smaller community and ecosystem

Code Comparison

PlantUML:

@startuml
class User {
  +String name
  +void login()
}
@enduml

Structurizr DSL:

workspace {
  model {
    user = person "User"
    softwareSystem "MySystem" {
      user -> this "Uses"
    }
  }
}

Summary

PlantUML is a versatile diagramming tool with a simple syntax, supporting various diagram types. It's widely used and has a large community. Structurizr DSL, on the other hand, is more specialized for software architecture modeling. It offers better integration with development processes but has a steeper learning curve and fewer diagram options. The choice between the two depends on specific project needs and team preferences.

20,479

D2 is a modern diagram scripting language that turns text to diagrams.

Pros of D2

  • Modern, more visually appealing diagrams with a focus on aesthetics
  • Supports a wider range of diagram types, including sequence diagrams and entity-relationship diagrams
  • Faster rendering times, especially for complex diagrams

Cons of D2

  • Smaller community and fewer resources compared to PlantUML's established ecosystem
  • Less extensive documentation and examples available
  • Limited integration with other tools and platforms

Code Comparison

PlantUML:

@startuml
Alice -> Bob: Hello
Bob --> Alice: Hi there
@enduml

D2:

alice -> bob: Hello
bob -> alice: Hi there

Both PlantUML and D2 offer text-based diagram creation, but D2's syntax is generally more concise and intuitive. PlantUML requires specific start and end tags, while D2 allows for a more streamlined approach.

PlantUML has been around longer and has a larger user base, resulting in more extensive documentation, examples, and third-party integrations. D2, being newer, offers a fresh approach with modern aesthetics and faster rendering, but lacks the mature ecosystem of PlantUML.

Ultimately, the choice between PlantUML and D2 depends on specific project requirements, desired diagram types, and personal preferences for syntax and visual style.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

🌱 PlantUML

Generate UML diagrams from textual descriptions.

Discord server GitHub Sponsors GitHub Org's stars GitHub watchers GitHub contributors GitHub forks GitHub all releases

Release (latest by date) Release Date GitHub commits since latest release (by date) javadoc

Pre-release (latest by date) Pre-release Date GitHub last commit CI snapshot javadoc

ℹ️ About

PlantUML is a component that allows you to create various UML diagrams through simple textual descriptions. From sequence diagrams to deployment diagrams and beyond, PlantUML provides an easy way to create visual representations of complex systems.

🗃️ Supported Diagram Types

📣 Additional Features

📖 Learn More

For a more detailed overview, visit PlantUML Official Website.

🛡 Security

See Security Policy and Security overview.

[!IMPORTANT] PlantUML is not affected by the log4j vulnerability.

🚀 Getting Started

Whether you're looking to use PlantUML as a standalone application or as a component in your own project, getting started is simple. Check out the official PlantUML setup guide for instructions on how to set up PlantUML on your system.

⚙️ Building from Source

To build PlantUML from source, you'll need to have certain prerequisites installed and follow a series of steps outlined in our build guide. Find detailed instructions in our BUILDING.md file.

🧱 Contributing

PlantUML is an open-source project, and we welcome contributions of all kinds. Whether you're helping us fix bugs, improve the docs, or spread the word, we appreciate your support. See our contributing guide for more information on how to get started.

For comprehensive and detailed documentation on using PlantUML, refer to the official Javadoc, available here. Please note that this documentation is a work in progress and may not be complete.

🧑‍🤝‍🧑 Support and Community

📃 License

PlantUML is licensed under several licenses; you can choose the one that suits you best:

For more information, please refer to the PlantUML license FAQ to help determine which license is appropriate for your use case.