Mermaid Support

Generate Diagram by Mermaid

Mermaid is a diagramming tool that renders Markdown-inspired text definitions into visual diagrams. It is a powerful way to create and visualize various types of diagrams, including flowcharts, sequence diagrams, class diagrams, and more, directly from text.

To generate diagrams by Mermaid:

  1. Select Tools > Generate Diagram by Mermaid menu.

  2. Enter mermaid code and click Generate button.

  3. Select a package where the generated diagram and elements to be contained.

Supported Mermaid Diagrams

StarUML support the following Mermaid diagrams:

  • Class Diagram

  • Sequence Diagram

  • State Diagram

  • Flowchart

  • Entity Relationship Diagram

  • Requirement Diagram

  • Mindmap

Please refer to the official documentation for the specific Mermaid syntax.

Class Diagram

You can create a class diagram with Mermaid. Keep in mind that the class diagram syntax in Mermaid is different from the UML specification. For example, an attribute is written as age: int in UML, but as int age in Mermaid. For more details, refer to the official Mermaid documentation.

Here is an example code for class diagram.

Sequence Diagram

A sequence diagram illustrates how objects interact in a particular scenario of a use case. It shows the sequence of messages exchanged between the objects to perform a specific function. Here is an example code for sequence diagram.

Message types that do not exist in the UML specification are not supported.

  • Lines without arrowheads

  • Lines with a cross at the end

  • Lines with bidirectional arrowheads

  • Dotted lines with arrowheads treated as asyncSignal type.

In StarUML, activation cannot be controlled on a per-message basis. Therefore, if even a single message has an activation, the activation is shown throughout the entire diagram.

State Diagram

A state diagram is a graphical representation of a system that shows its states, transitions, and events. Each state depicts a unique situation in the system, while transitions indicate how the system moves from one state to another based on events or conditions. Here is an example code for state diagram.

Flowchart

A flowchart is a visual representation of a process, system, or algorithm. It uses symbols like arrows, rectangles, ovals, and diamonds to depict the flow of steps, decisions, and information, allowing for easy understanding and communication of complex processes. Here is an example code for flowchart.

Entity Relationship Diagram

An Entity Relationship Diagram (ERD) is a graphical representation of entities and their relationships in a database. It is a critical tool in database design that helps visualize how data is structured and how different entities interact within the system. Here is an example code for entity relationship diagram.

Requirement Diagram

A requirement diagram is a visual representation used to capture, categorize, and manage requirements in a system or project. Primarily used in systems engineering and software engineering, it helps stakeholders understand requirement relationships and hierarchies. Here is an example code for requirement diagram.

Mindmap

A mindmap is a visual tool used for organizing information hierarchically. It starts with a central idea and branches out into related subtopics, helping to generate, organize, and visualize ideas or concepts. Mindmaps are useful for brainstorming and planning as they encourage a free flow of ideas. Here is an example code for mindmap.

Last updated