> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Mermaid

> Learn how to use Mermaid in Paradime to create diagrams that document your dbt projects. Create ERDs, workflows, and architecture diagrams using code.

export const Arcade = ({src, title}) => <div style={{
  position: 'relative',
  paddingBottom: 'calc(56.2225% + 41px)',
  height: 0,
  width: '100%'
}}>
    <iframe src={src} title={title} frameBorder="0" loading="lazy" allow="clipboard-write" allowFullScreen style={{
  position: 'absolute',
  top: 0,
  left: 0,
  width: '100%',
  height: '100%',
  colorScheme: 'light'
}} />
  </div>;

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.

<Info>
  **Why Use Mermaid in Paradime?**

  * **AI-Powered Creation:** Use [DinoAI](/products/dino-ai/index) 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.
</Info>

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](/products/dino-ai/index):

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:

```
- "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"
```

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.

<Info>
  **Quick Testing:** This method is perfect for testing and exploring Mermaid capabilities. For consistent, detailed work with Mermaid diagrams, we recommend using [.dinoprompts](/products/dino-ai/copilot/dino-prompts) for more structured and reusable mermaid prompts.
</Info>

<Arcade src="https://demo.arcade.software/EmaMjThVIRtvnr0jMixR?embed&embed_mobile=tab&embed_desktop=inline&show_copy_link=true" title="Mermaid" />

***

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

You can create your own structured, reusable Mermaid prompts in [.dinoprompts](/products/dino-ai/copilot/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.

<Accordion title="Example Mermaid Diagram .dinoprompts">
  ````yaml theme={"system"}
  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.
  ````
</Accordion>

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**](/products/dino-ai/copilot/context/index) to your prompt like Files, Directories, etc.
6. *Optional:* **Edit/update prompt** based on your specific needs

<Arcade src="https://demo.arcade.software/WGIK14wrUGGtqpxSAypk?embed&embed_mobile=tab&embed_desktop=inline&show_copy_link=true" title="Mermaid" />

***

### 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.

<CardGroup cols={2}>
  <Card title="Architecture Diagrams" href="/images/act.png" horizontal>
    Visualize your data infrastructure, including cloud deployments, ETL services, and database organization.
  </Card>

  <Card title="Entity Relationship Diagrams (ERDs)" href="/images/image-1-1-1-1-1-2-1.png" horizontal>
    Map database schemas and relationships between tables to document data models.
  </Card>

  <Card title="Class Diagrams" href="/images/image-12-1-1.png" horizontal>
    Model data structures and transformations
  </Card>

  <Card title="Block Diagrams" href="/images/block.png" horizontal>
    Create structured layouts of system components and data flows.
  </Card>

  <Card title="Sequence Diagrams" href="/images/image-9-1-1-2-1.png" horizontal>
    Document ETL processes, API interactions, and data validation workflows.
  </Card>

  <Card title="State Diagrams" href="/images/state-1.webp" horizontal>
    Track job executions, pipeline statuses, and system states over time.
  </Card>

  <Card title="User Journey Diagrams" href="/images/image-11-1-1.png" horizontal>
    Map system interactions and user access patterns for improved workflows.
  </Card>

  <Card title="ZenUML" href="/images/zen.png" horizontal>
    Model complex workflows with simplified syntax for sequential processes.
  </Card>

  <Card title="Gantt Diagrams" href="/images/image-2-1-1-1-1-2-1.png" horizontal>
    Plan project timelines, manage task dependencies, and track milestones.
  </Card>

  <Card title="GitGraph Diagrams" href="/images/image-3-1-1-1-1-1-2-1-1.png" horizontal>
    Document version control strategies, feature development workflows, and release processes.
  </Card>

  <Card title="Timeline Diagrams" href="/images/image-12-1-1-1.png" horizontal>
    Visualize project roadmaps, historical trends, and key milestones.
  </Card>

  <Card title="Requirement Diagrams" href="/images/image-7-1-1-2-1.png" horizontal>
    Specify and track feature requirements and dependencies visually.
  </Card>

  <Card title="Pie Charts" href="/images/image-5-1-1-2-1.png" horizontal>
    Show distributions, allocations, and proportional data in your projects.
  </Card>

  <Card title="XY Charts" href="/images/xy.png" horizontal>
    Display trends, metrics, and relationships using bar and line charts.
  </Card>

  <Card title="Sankey Diagrams" href="/images/image-8-1-1-2-1.png" horizontal>
    Visualize data flow volumes, resource usage, and energy transfers.
  </Card>

  <Card title="Quadrant Charts" href="/images/image-6-1-1-2-1.png" horizontal>
    Analyze impact and priority for features or projects.
  </Card>

  <Card title="Mind Maps" href="/images/image-4-1-1-2-1.png" horizontal>
    Organize ideas, project requirements, or data models hierarchically.
  </Card>
</CardGroup>

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


## Related topics

- [Pie Chart](/integrations/mermaid-js/pie-chart-diagrams.md)
- [Accelerating Data Governance](/guides/paradime-101/getting-started-with-the-paradime-ide/dinoai-accelerating-your-analytics-engineering-workflow/accelerating-data-governance.md)
- [Zenuml](/integrations/mermaid-js/zenuml.md)
- [Mindmaps](/integrations/mermaid-js/mindmaps.md)
- [User Journey Diagrams](/integrations/mermaid-js/user-journey-diagrams.md)
