Skip to content

rajeshgithub001/MermaidPad

 
 

Repository files navigation

MermaidPad

A minimal cross-platform-ready Mermaid diagram editor built with .NET 9 + Avalonia. The editor uses MermaidJS to render Mermaid Diagrams. It is cross-platform and runs on:

  • Windows x86/x64/arm64
  • Linux x64/arm64
  • macOS x64/arm64

It has an optional "Live Preview" feature to render in real-time. I plan to add syntax highlighting and SVG/PNG exporting. If there are features you'd like to see, open a feature request.

I hope you enjoy it and feel welcome to contribute!

Features

  • Paste/edit Mermaid markup on the left, click Render to preview on the right.
  • Click Clear to clear the Editor pane.
  • Bundled mermaid.min.js for offline use.
  • On startup attempts to fetch the latest Mermaid version (if online) and self-updates the local bundle.
  • Persists last diagram in user settings (AppData\MermaidPad\settings.json).
  • Drag the divider to resize the editor pane.

Planned

  • Syntax highlighting (AvaloniaEdit custom definition)
  • SVG/PNG export

Usage

image

Examples

Here are some examples - you can find these here.

Graphs

graph TD
    A[Start Build] --> B{runtimeFlavor specified?}
    B -->|No| C[Default to CoreCLR + subset logic]
    B -->|Yes| D{Which flavor?}
    D -->|coreclr| E[CoreCLR only mode]
    D -->|mono| F[Mono only mode]
    C --> G[Build CoreCLR components + whatever's in subset]
    E --> H{subset contains mono?}
    F --> I{needs CoreCLR deps?}
    H -->|Yes| J[CONFLICT - can't build mono in CoreCLR-only mode]
    H -->|No| K[Build CoreCLR only]
    I -->|Yes| L[FAIL - missing corehost dependencies]
    I -->|No| M[Build Mono only]
    G --> N[SUCCESS - builds both as needed]
image

Sequence Diagrams

sequenceDiagram
    participant User
    participant System
    User->>System: Request data
    System-->>User: Send data
    User->>System: Process data
    System-->>User: Confirmation
    User->>System: Logout
image

Class Diagrams

classDiagram
    class Animal {
        +String name
        +int age
        +makeSound()
    }
    class Dog {
        +String breed
        +bark()
    }
    Animal <|-- Dog
    class Cat {
        +String color
        +meow()
    }
    Animal <|-- Cat
    class Bird {
        +String species
        +fly()
    }
    Animal <|-- Bird
    class Fish {
        +String type
        +swim()
    }
    Animal <|-- Fish
    class Reptile {
        +String habitat
        +crawl()
    }
    Animal <|-- Reptile
    class Insect {
        +String wingspan
        +buzz()
    }
    Animal <|-- Insect
image

State Diagrams

stateDiagram
    [*] --> Idle
    Idle --> Processing : start
    Processing --> Completed : finish
    Processing --> Error : fail
    Completed --> Idle : reset
    Error --> Idle : reset
image

Gantt Charts

gantt
    title Project Timeline
    dateFormat  YYYY-MM-DD
    section Planning
    Task 1 :a1, 2023-10-01, 30d
    Task 2 :after a1, 20d
    section Development
    Task 3 :2023-11-01, 40d
    Task 4 :after a3, 30d
    section Testing
    Task 5 :2024-01-01, 20d
    Task 6 :after a5, 15d
image

Pie Charts

pie
    title Browser Usage
    "Chrome": 45
    "Firefox": 30
    "Safari": 15
    "Others": 10
image

About

A UI scratchpad for Mermaid charts and diagrams

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 94.0%
  • HTML 6.0%