# PraisonAI Diagram

> Turn Mermaid flowcharts, sequence diagrams, and YAML specs into interactive, offline animated walkthroughs.

**PraisonAI Diagram** (`aidiagram` on PyPI, `aidiagram-js` on npm) turns ordinary Mermaid diagrams and concise YAML specs into interactive, theme-aware, step-by-step animated walkthroughs with zero runtime dependencies.

Click any node below, press **Play**, or press `←` / `→` to step through the pipeline:

```mermaid
flowchart LR
  subgraph Author["1. Write Anywhere"]
    MD["Mermaid Markdown<br/>or YAML Spec"]
  end
  subgraph Engine["2. PraisonAI Diagram"]
    IMP["Fidelity Importer<br/>Zero silent loss"]
  end
  subgraph Output["3. Output"]
    WEB["Interactive View<br/>Play · Pan · Export"]
    FB["Mermaid.js Fallback<br/>Source preserved"]
  end
  MD --> IMP
  IMP -->|"8 layouts"| WEB
  IMP -.->|"unsupported / off"| FB
  style IMP fill:#e0b25a
```

## 3 Steps to Your First Diagram

1. **Install** the runtime you need:
   - Python CLI / offline HTML: `pip install aidiagram`
   - Browser / React / JS: `npm install aidiagram-js`
2. **Write** standard Mermaid (`flowchart`, `graph`, `sequenceDiagram`) or a native YAML layout (`flow`, `graph`, `sequence`, `loop`, `stack`, `fan`, `timeline`, `map`).
3. **Render** interactively in the browser, export a single offline HTML file (`aidiagram html`), or drop directly into a PraisonAIUI docs site.

## Why PraisonAI Diagram?

| Feature | Classic Static Mermaid | PraisonAI Diagram |
|---|---|---|
| Step-by-step **Play / Pause** & `←` / `→` walkthrough | No | Built-in |
| **Hover path focus** (highlights connected edges & nodes) | No | Built-in |
| **Click-to-inspect** descriptions, copyable CLI snippets, links | No | Built-in |
| **Animated data pulses** (respects `prefers-reduced-motion`) | No | Built-in |
| **Drag-pan, zoom, fullscreen, SVG & 2x PNG export** | Partial | Built-in |
| **Zero silent conversion loss** | N/A | Strict fail-closed fallback |
| **Runtime dependencies** | Heavy bundle | **0 dependencies** (~15 kB gzip) |

## Where to Go Next

- **[60-Second Quick Start](https://diagram.praison.ai/docs/getting-started/quickstart.md)** — Step-by-step setup for Python, HTML, and JS.
- **[Keep Writing Mermaid](https://diagram.praison.ai/docs/getting-started/mermaid.md)** — Exact supported syntax, bidirectional arrows, sequence notes, and fallback rules.
- **[All 8 Layouts](https://diagram.praison.ai/docs/layouts.md)** — Live interactive examples for `flow`, `graph`, `sequence`, `loop`, `stack`, `fan`, `timeline`, and `map`.
- **[PraisonAIUI Integration](https://diagram.praison.ai/docs/guides/praisonaiui.md)** — Auto-upgrade Mermaid blocks and author `diagram` fences in Markdown docs.
