DiagView
DiagView Header Layout
← Hub

Mermaid & SVG Integration

Combining dynamic Mermaid.js rendering with static SVG diagrams. DiagView handles both seamlessly.

▬ Header Bar Mode

Core Infrastructure

Mermaid
graph TD subgraph "Core System" LB[Load Balancer] --> Web1[Web Server 01] LB --> Web2[Web Server 02] LB --> Web3[Web Server 03] end subgraph "Data Layer" Web1 --> Cache[Redis Cluster] Web2 --> Cache Web3 --> Cache Cache --> DB_Master[(Postgres Master)] DB_Master --> DB_Slave1[(Postgres Replica 1)] DB_Master --> DB_Slave2[(Postgres Replica 2)] end style LB fill:#f9f,stroke:#333,stroke-width:2px style DB_Master fill:#bbf,stroke:#333,stroke-width:2px style Cache fill:#ff9,stroke:#333,stroke-width:2px

API Report Flow

Mermaid
sequenceDiagram participant User participant UI as Client Application participant API as Backend Service User->>UI: Clicks "Generate Report" UI->>API: POST /api/v1/reports/pdf Note right of API: API processes data... API-->>UI: Returns 200 OK (Report ID: 12345) UI-->>User: Shows "Download Ready" Notification

State Transition

SVG
Start Pending Processing Shipped Done

Analytics

Mermaid
pie title Language Usage "JavaScript" : 70 "CSS" : 20 "HTML" : 10

Performance Stress Test

2.5k Nodes

Click to open the 2,500 node grid

Why choose this layout?

Designed for real-world use cases where control placement matters.

Always Visible Controls

The toolbar is permanently rendered above each diagram. No hover required — users see search, export, and fullscreen at a glance on every load.

WCAG 2.1 Compliant

Header toolbar meets AA contrast ratios with full focus management, aria-labels, and keyboard operability out of the box.

📄

Ideal for Docs & Dashboards

The classic toolbar pattern matches what users already know from Google Docs, Figma, and GitHub. Zero learning curve.

Keyboard Reference

Every action is keyboard-accessible. No mouse required.

Zoom
+Zoom in
-Zoom out
Space / 0Reset & center
Pan
↑ ↓ ← →Pan diagram
ShiftFast pan
DragFree pan
Search
FOpen search
EscClear / close
Tools
MMeeting mode
RRotate 90°
LShare link

Integration

// Works with Mermaid.js — render first, then init
await mermaid.run();

DiagView.init({
  diagramSelector: '.mermaid, .diagram',
  layout:          'header',
  showKeyboardHelp: true,
  highResScale:    4
});

// Per-element accent & layout override
<div class="mermaid"
     data-diagview-layout="header"
     data-diagview-accent="#8b5cf6">
  graph TD; A-->B;
</div>
Compare all layouts → Try Off Layout →