# Mermaid

Mermaid is a powerful tool for visualizing complex workflows, data models, and system architectures using simple code. Seamlessly integrated into Paradime, it helps data teams document their dbt™ projects and collaborate more effectively by creating professional diagrams directly within their development environment.

{% hint style="info" %}

#### **Why Use Mermaid in Paradime?**

* **AI-Powered Creation:** Use [DinoAI](https://docs.paradime.io/app-help/documentation/dino-ai) to generate diagrams from simple prompts, eliminating the need to write complex syntax manually.
* **Simplified Visualization:** Transform abstract concepts like data models, ETL processes, and project timelines into clear, visual diagrams.
* **Built for Collaboration:** Store `.mmd` diagram files alongside your dbt™ code, version control them, and share them seamlessly with your team.
* **Real-Time Feedback:** Preview your diagrams in real-time while you edit, ensuring quick iterations and accuracy.
  {% endhint %}

From documenting database schemas to mapping workflows and planning releases, Mermaid's visualizations enhance collaboration and understanding across your data projects.

***

### **Getting Started with Mermaid**

Creating your first diagram in Paradime is simple using [DinoAI](https://docs.paradime.io/app-help/documentation/dino-ai):

1. **Launch DinoAI:** From Paradime's Code IDE, access DinoAI to start creating diagrams.
2. **Use a Simple Prompt:** Tell DinoAI what kind of diagram you want to create. For example:

{% code overflow="wrap" %}

```
- "Create a simple mermaid ERD diagram showing the relationships between my user, order, and product tables"

- "Generate a mermaid flowchart for my data pipeline process from raw data to analytics"

- "Build a mermaid sequence diagram showing the interaction between my API and database"
```

{% endcode %}

3. **Get Your Diagram:** DinoAI will generate a complete `.mmd` file with proper Mermaid syntax.
4. **Preview Your Work:** Click the eye icon (👁️) to preview your diagram in real-time as you edit.
5. **Iterate and Refine:** Modify the generated `.mmd` file directly, or ask DinoAI to make specific changes.

{% hint style="info" %}
**Quick Testing:** This method is perfect for testing and exploring Mermaid capabilities. For consistent, detailed work with Mermaid diagrams, we recommend using [.dinoprompts](https://docs.paradime.io/app-help/documentation/dino-ai/dino-prompts) for more structured and reusable mermaid prompts.
{% endhint %}

{% @arcade/embed flowId="EmaMjThVIRtvnr0jMixR" url="<https://app.arcade.software/share/EmaMjThVIRtvnr0jMixR>" %}

***

### **Creating Mermaid Diagrams with .dinoprompts**

You can create your own structured, reusable Mermaid prompts in [.dinoprompts](https://docs.paradime.io/app-help/documentation/dino-ai/dino-prompts) for consistent diagram generation. These custom prompts are perfect for teams that frequently create similar types of diagrams and want standardized templates.

**Creating Custom Mermaid Prompts**

1. **Add prompts to your .dinoprompts file** - Create custom Mermaid prompts.

<details>

<summary>Example Mermaid Diagram .dinoprompts</summary>

````yaml
prompts:
  # ERD Diagrams
  - name: mermaid_erd
    prompt: >
      Create an ERD diagram for model @${model_path}:

      Choose one of these formats:

      1. Simple ERD
      ============
      Features:
      • Show just entities and their relationships
      • Use underscore_notation for relationship labels
      • Basic cardinality notation ||--o{

      Example:
      ```
      erDiagram
          Customer ||--o{ Order : places
          Order ||--|{ LineItem : contains
      ```

      2. Detailed ERD
      =============
      Features:
      • Show all columns with data types
      • Include PK/FK indicators
      • Show full relationships and cardinality
      • Include both upstream and downstream dependencies

      Example:
      ```
      erDiagram
          Customer {
              int customer_id PK
              string name
              string email
          }
          Order {
              int order_id PK
              int customer_id FK
              date order_date
              string status
          }
          Customer ||--o{ Order : places
      ```

      Which format would you like to use? I'll help you create it.

  # Flowcharts
  - name: mermaid_flowchart
    prompt: >
      Create a flowchart diagram for ${process_name}:

      Choose one of these formats:

      1. Simple Flowchart
      ================
      Features:
      • Basic left-to-right flow
      • Essential nodes and connections

      Example:
      ```
      flowchart LR
          A[Start] --> B[Process]
          B --> C[End]
      ```

      2. Detailed Flowchart
      =================
      Features:
      • Organized subgraphs
      • Multiple node shapes
      • Conditional flows
      • Clear labels

      Example:
      ```
      flowchart TD
          subgraph Input
              A[Start] --> B{Valid?}
          end
          subgraph Processing
              B -->|Yes| C[Process Data]
              B -->|No| D[Error Handler]
              C --> E[Save Result]
          end
          subgraph Output
              E --> F[End]
              D --> F
          end
      ```

      Which format would you like to use? I'll help you create it.

  # Sequence Diagrams
  - name: mermaid_sequence
    prompt: >
      Create a sequence diagram:

      Choose one of these formats:

      1. Simple Sequence
      ===============
      Features:
      • Basic participant interactions
      • Essential messages

      Example:
      ```
      sequenceDiagram
          participant U as User
          participant S as System
          U->>S: Request
          S-->>U: Response
      ```

      2. Detailed Sequence
      ================
      Features:
      • Multiple participants
      • Activation blocks
      • Alternative flows
      • Notes and loops

      Example:
      ```
      sequenceDiagram
          participant U as User
          participant A as API
          participant DB as Database
          
          U->>+A: Submit Request
          A->>+DB: Query Data
          
          alt Success
              DB-->>-A: Return Results
              A-->>-U: Show Success
          else Error
              DB-->>-A: Error
              A-->>-U: Show Error
          end
          
          note over U,DB: Complete Flow
      ```

      Which format would you like to use? I'll help you create it.

  # Gantt Diagrams
  - name: mermaid_gantt
    prompt: >
      Create a Gantt chart:

      Choose one of these formats:

      1. Simple Gantt
      ============
      Features:
      • Basic tasks and dates
      • Simple timeline view

      Example:
      ```
      gantt
          title Simple Project Schedule
          dateFormat YYYY-MM-DD
          section Tasks
              Task 1 :2025-01-01, 30d
              Task 2 :2025-02-01, 20d
      ```

      2. Detailed Gantt
      =============
      Features:
      • Multiple sections
      • Dependencies
      • Milestones
      • Status tracking

      Example:
      ```
      gantt
          title Detailed Project Schedule
          dateFormat YYYY-MM-DD
          excludes weekends
          
          section Planning
              Requirements  :done, req, 2025-01-01, 15d
              Design       :active, des, after req, 20d
              
          section Development
              Implementation :impl, after des, 30d
              Testing       :test, after impl, 15d
              
          section Deployment
              Training    :train, after test, 10d
              Go Live    :milestone, after train, 0d
      ```

      Which format would you like to use? I'll help you create it.

  # Pie Chart Diagrams
  - name: mermaid_pie
    prompt: >
      Create a pie chart:

      Choose one of these formats:

      1. Simple Pie Chart
      ===============
      Features:
      • Basic segments
      • Simple percentage distribution

      Example:
      ```
      pie
          title Simple Distribution
          "A" : 40
          "B" : 60
      ```

      2. Detailed Pie Chart
      ================
      Features:
      • Multiple segments
      • Specific values
      • Data labels

      Example:
      ```
      pie
          title Market Share Analysis
          showData
          "Product A" : 30.5
          "Product B" : 25.7
          "Product C" : 20.3
          "Others" : 23.5
      ```

      Which format would you like to use? I'll help you create it.
````

</details>

2. **Customize for your needs** - Modify prompts to match your team's specific diagram requirements

**Using Your Custom Mermaid Prompts**

1. **Open DinoAI** by clicking the DinoAI icon (🪄) in the right panel
2. **Access .dinoprompts** by clicking the `Prompt` icon in the chat input
   * **Alternative**: Use the bracket symbol shortcut "\[" to quickly find prompts
3. **Select your custom prompt** from the dropdown (ex. mermaid\_erd)
4. **Choose the diagram type** based on the prompt selected
5. *Optional:* **Add additional** [**context**](https://docs.paradime.io/app-help/documentation/dino-ai/context) to your prompt like Files, Directories, etc.
6. *Optional:* **Edit/update prompt** based on your specific needs

{% @arcade/embed flowId="WGIK14wrUGGtqpxSAypk" url="<https://app.arcade.software/share/WGIK14wrUGGtqpxSAypk>" %}

***

### Common Mermaid Diagram

DinoAI can help you create any Mermaid diagram types. While these represent the most commonly used diagrams for data teams, you're not limited to only these options - DinoAI can generate any valid Mermaid diagram based on your specific needs.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Architecture Diagrams</strong></td><td>Visualize your data infrastructure, including cloud deployments, ETL services, and database organization.</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FSDiVB09ljIX4BMAZhQ6K%2Fact.png?alt=media&#x26;token=193a3b9d-ec5d-4e01-9851-f35fff053d18">act.png</a></td><td><a href="mermaid-js/architecture-diagrams">architecture-diagrams</a></td></tr><tr><td><strong>Entity Relationship Diagrams (ERDs)</strong></td><td>Map database schemas and relationships between tables to document data models.</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2Fs9q5EoS8yC9AtHA3sfHv%2Fimage.png?alt=media&#x26;token=e33cf92b-79d3-4721-9d24-757e0cbda904">image.png</a></td><td><a href="mermaid-js/entity-relationship-diagrams">entity-relationship-diagrams</a></td></tr><tr><td><strong>Class Diagrams</strong></td><td>Model data structures and transformations</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FtzRYqfBriJzgt70eyHHQ%2Fimage.png?alt=media&#x26;token=881c6179-1a83-49a9-ac49-6a4a9b3ad156">image.png</a></td><td><a href="mermaid-js/class-diagrams">class-diagrams</a></td></tr><tr><td>Block Diagrams</td><td>Create structured layouts of system components and data flows.</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FHbnZpGAmCE5pcMFuTcAC%2Fblock.png?alt=media&#x26;token=17259ae8-c0f8-4fed-8ee8-0bf231a71554">block.png</a></td><td><a href="mermaid-js/block-diagrams">block-diagrams</a></td></tr><tr><td>Sequence Diagrams</td><td>Document ETL processes, API interactions, and data validation workflows.</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2F4l4x75A1uZCpN0hUEnKC%2Fimage.png?alt=media&#x26;token=0a9057c5-da46-44c3-af25-dbd0d9e2b133">image.png</a></td><td><a href="mermaid-js/sequence-diagrams">sequence-diagrams</a></td></tr><tr><td>State Diagrams</td><td>Track job executions, pipeline statuses, and system states over time.</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2F1T1gZnISZ6ID85KVbTgi%2Fstate%201.webp?alt=media&#x26;token=feb8315a-11d3-43e1-a8ab-f8fa10d24a1a">state 1.webp</a></td><td><a href="mermaid-js/state-diagrams">state-diagrams</a></td></tr><tr><td>User Journey Diagrams</td><td>Map system interactions and user access patterns for improved workflows.</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2F608WEGQbNSqLxIlfHlhM%2Fimage.png?alt=media&#x26;token=b14eb044-4f42-40b1-a9c1-e1794b7fb549">image.png</a></td><td><a href="mermaid-js/user-journey-diagrams">user-journey-diagrams</a></td></tr><tr><td>ZenUML</td><td>Model complex workflows with simplified syntax for sequential processes.</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2Fn29Ju7zXVqrjPa6ktegB%2Fzen.png?alt=media&#x26;token=88f5cb5b-52b3-4dea-9dcc-0d8c83331451">zen.png</a></td><td><a href="mermaid-js/zenuml">zenuml</a></td></tr><tr><td>Gantt Diagrams</td><td>Plan project timelines, manage task dependencies, and track milestones.</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FzIw3mEVf1E4wItAF1BWx%2Fimage.png?alt=media&#x26;token=b0943559-fb4b-49a0-b054-ab0025ca7302">image.png</a></td><td><a href="mermaid-js/gantt-diagrams">gantt-diagrams</a></td></tr><tr><td><strong>GitGraph Diagrams</strong></td><td>Document version control strategies, feature development workflows, and release processes.</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2Fr0rptJdek9DJv9b7eNFr%2Fimage.png?alt=media&#x26;token=7af37fb8-d129-40e4-8c1e-c0930943d00b">image.png</a></td><td><a href="mermaid-js/gitgraph-diagrams">gitgraph-diagrams</a></td></tr><tr><td><strong>Timeline Diagrams</strong></td><td>Visualize project roadmaps, historical trends, and key milestones.</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2F3XgagMlOrvQRB7xptkym%2Fimage.png?alt=media&#x26;token=87c3936f-5977-42b3-b7a8-84bc3b50a1c6">image.png</a></td><td><a href="mermaid-js/timeline-diagrams">timeline-diagrams</a></td></tr><tr><td><strong>Requirement Diagrams</strong></td><td>Specify and track feature requirements and dependencies visually.</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2Flcb6UZG6eu0Vq8RTjFQd%2Fimage.png?alt=media&#x26;token=fd94d673-8aaa-4262-a412-281a155f3e05">image.png</a></td><td><a href="mermaid-js/requirement-diagrams">requirement-diagrams</a></td></tr><tr><td><strong>Pie Charts</strong></td><td>Show distributions, allocations, and proportional data in your projects.</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FTC4512UXI94e7JfqrEt6%2Fimage.png?alt=media&#x26;token=df20bb4e-cf34-42e7-89c5-56b952acb7a7">image.png</a></td><td><a href="mermaid-js/pie-chart-diagrams">pie-chart-diagrams</a></td></tr><tr><td><strong>XY Charts</strong></td><td>Display trends, metrics, and relationships using bar and line charts.</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FbkcCFKOrDdCDPpKqAd8O%2Fxy.png?alt=media&#x26;token=390e5741-df72-490f-9f61-43b92e27547a">xy.png</a></td><td><a href="mermaid-js/xy-chart">xy-chart</a></td></tr><tr><td><strong>Sankey Diagrams</strong></td><td>Visualize data flow volumes, resource usage, and energy transfers.</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FlIPUnWqBG8DTH0Lx5pFy%2Fimage.png?alt=media&#x26;token=30b82507-8bc9-4e1d-a083-db1bb7b35fe2">image.png</a></td><td><a href="mermaid-js/sankey-diagrams">sankey-diagrams</a></td></tr><tr><td><strong>Quadrant Charts</strong></td><td>Analyze impact and priority for features or projects.</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FBn4KII6a4z5VX7M35pXG%2Fimage.png?alt=media&#x26;token=6cf60da0-c09b-41e7-8c13-37fb767df031">image.png</a></td><td><a href="mermaid-js/quadrant-charts">quadrant-charts</a></td></tr><tr><td><strong>Mind Maps</strong></td><td>Organize ideas, project requirements, or data models hierarchically.</td><td><a href="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FjN9ZMNfQ6IDLDrVkmPBe%2Fimage.png?alt=media&#x26;token=996cc517-d442-456b-afcf-755df67b83cd">image.png</a></td><td><a href="mermaid-js/mindmaps">mindmaps</a></td></tr></tbody></table>

Each diagram type includes detailed documentation with syntax examples and best practices for data teams.
