# UML Viewer vs. Mermaid Chart - Organization & UX Analysis
**Date**: November 23, 2025
**Objective**: Compare our UML Viewer with Mermaid Chart's interface to identify organizational improvements
---
## 🎯 Executive Summary
Our UML Viewer is **functionally complete** but can benefit from Mermaid's **superior organization and workflow design**. The key differences lie in **layout clarity, code-first workflow, and panel management**.
**Key Finding**: Mermaid Chart prioritizes the **code editor** with live preview, while our viewer prioritizes the **visual diagram**. Both approaches are valid but serve different use cases.
---
## 📊 Side-by-Side Comparison
### Layout Architecture
| Aspect | **Mermaid Chart** | **Our UML Viewer** | Winner |
|--------|-------------------|---------------------|---------|
| **Primary Panel** | Code Editor (left) | Diagram Viewer (center) | Depends on use case |
| **Secondary Panel** | Live Preview (right) | File List (left sidebar) | Mermaid (more flexible) |
| **Tertiary Panel** | None | Node Details (optional) | Viewer (more info) |
| **Panel Resize** | ✅ Draggable splitters | ❌ Fixed widths | **Mermaid** |
| **Panel Collapse** | ✅ Full collapse | ❌ No collapse | **Mermaid** |
| **Layout Modes** | Multiple (editor-focus, preview-focus, split) | Single fixed layout | **Mermaid** |
### Navigation & Organization
| Aspect | **Mermaid Chart** | **Our UML Viewer** | Winner |
|--------|-------------------|---------------------|---------|
| **File Navigation** | Folder tree with search | Grouped flat list | **Mermaid** |
| **Diagram Grouping** | Folders, tags, categories | Static type groups (Mermaid/PlantUML/GraphViz) | **Mermaid** |
| **Search** | ✅ Full-text search | ❌ No search | **Mermaid** |
| **Recently Viewed** | ✅ Quick access | ❌ No history | **Mermaid** |
| **Favorites** | ✅ Star diagrams | ❌ No favorites | **Mermaid** |
| **Diagram Count Badge** | ✅ Visible counts | ❌ No counts | **Mermaid** |
### Toolbar & Controls
| Aspect | **Mermaid Chart** | **Our UML Viewer** | Winner |
|--------|-------------------|---------------------|---------|
| **Zoom Controls** | ✅ +/- buttons + slider | ✅ +/- buttons | Tie |
| **Fit to Screen** | ✅ One-click | ✅ One-click | Tie |
| **Export Options** | ✅ PNG, SVG, PDF, Source | ✅ PNG, SVG, Source | **Mermaid** (PDF) |
| **Theme Switcher** | ✅ Light/Dark mode | ❌ Light only | **Mermaid** |
| **Settings Panel** | ✅ Diagram config | ❌ No settings | **Mermaid** |
| **Share Button** | ✅ Copy link | ❌ No sharing | **Mermaid** |
### Visual Design
| Aspect | **Mermaid Chart** | **Our UML Viewer** | Winner |
|--------|-------------------|---------------------|---------|
| **Color Scheme** | Soft blue/white | NDE blue (#0a3dfa) | **Viewer** (brand consistency) |
| **Typography** | Inter/System fonts | System fonts | Tie |
| **Spacing** | Generous padding | Moderate padding | **Mermaid** |
| **Visual Hierarchy** | Clear depth (shadows) | Flat borders | **Mermaid** |
| **Icons** | Lucide icons | Lucide icons | Tie |
| **Animation** | Smooth transitions | Basic transitions | **Mermaid** |
### User Workflow
| Aspect | **Mermaid Chart** | **Our UML Viewer** | Winner |
|--------|-------------------|---------------------|---------|
| **Primary Use Case** | Create/Edit diagrams | View existing diagrams | N/A (different goals) |
| **Code Editing** | ✅ Full editor (Monaco) | ❌ View-only (collapsed) | **Mermaid** |
| **Live Preview** | ✅ Real-time updates | N/A | **Mermaid** |
| **Syntax Validation** | ✅ Error highlighting | ❌ Parse errors only | **Mermaid** |
| **Auto-format** | ✅ Code formatting | ❌ No formatting | **Mermaid** |
| **Undo/Redo** | ✅ Full history | N/A | **Mermaid** |
---
## 🔍 Detailed Feature Analysis
### 1. **Code Editor vs. Visual-First Approach**
**Mermaid Chart**:
- **Code is primary**: Left panel = Monaco editor (full IDE experience)
- **Diagram is secondary**: Right panel = live preview of code
- **Workflow**: Write code → See diagram instantly
- **Target User**: Developers creating diagrams from scratch
**Our UML Viewer**:
- **Diagram is primary**: Center panel = interactive D3.js visualization
- **Code is secondary**: Collapsed source viewer at bottom
- **Workflow**: Select file → View diagram → Export
- **Target User**: Stakeholders reviewing generated diagrams
**Recommendation**:
- **Keep visual-first** for our use case (viewing LinkML-generated diagrams)
- **Add code panel toggle** for power users who want to edit
---
### 2. **Panel Resize & Layout Flexibility**
**Mermaid Chart**:
```
┌─────────────┬────────────────┐
│ │ │
│ EDITOR │ PREVIEW │
│ (resize) │ (resize) │
│ │ │
└─────────────┴────────────────┘
^ Draggable splitter
```
**Our UML Viewer**:
```
┌────────┬─────────────────────┐
│ │ │
│ FILES │ DIAGRAM │
│ (320px)│ (flex: 1) │
│ │ │
└────────┴─────────────────────┘
^ Fixed width (no resize)
```
**Recommendation**:
- **Add draggable splitter** between sidebar and main area
- Use `react-resizable-panels` or similar library
- **Allow sidebar collapse** (hamburger icon)
---
### 3. **File Navigation & Organization**
**Mermaid Chart Structure**:
```
📁 My Diagrams
├─ 📁 Architecture
│ ├─ 📄 System Overview
│ └─ 📄 Database Schema
├─ 📁 User Flows
│ └─ 📄 Registration Flow
└─ 📁 Recent (auto-generated)
```
**Our UML Viewer Structure**:
```
UML Diagrams
├─ Mermaid Class Diagrams
│ ├─ Custodian Multi-Aspect
│ └─ Custodian Name Modular
├─ ER Diagrams
│ ├─ Custodian ER Diagram
│ └─ Custodian Name Modular (ER)
└─ PlantUML / GraphViz
```
**Recommendation**:
- **Add search bar** above file list (fuzzy search)
- **Group by schema version** (20251121, 20251122, etc.)
- **Add recently viewed** section at top
- **Show diagram metadata** (date generated, node count, complexity)
---
### 4. **Toolbar Organization**
**Mermaid Chart Toolbar**:
```
┌────────────────────────────────────────────────┐
│ [≡] [Save] [Export ▾] [Share] ... [Theme] [?] │
└────────────────────────────────────────────────┘
^Left-aligned actions ^Right-aligned settings
```
**Our UML Viewer Toolbar**:
```
┌────────────────────────────────────────────────┐
│ Custodian... [+] [-] [⊡] [↻] [PNG] [SVG] [...] │
└────────────────────────────────────────────────┘
^Title ^Zoom controls ^Export buttons
```
**Recommendation**:
- **Separate zoom and export** with visual divider (vertical line)
- **Add dropdown for export formats** (cleaner than 3 buttons)
- **Add settings icon** for diagram config (layout algorithm, colors)
---
### 5. **Visual Hierarchy & Depth**
**Mermaid Chart Design**:
- Uses **subtle shadows** (`box-shadow: 0 2px 8px rgba(0,0,0,0.1)`)
- **Layered panels** (editor over background)
- **Rounded corners** everywhere (8px border-radius)
- **Hover states** with color transitions
**Our UML Viewer Design**:
- Uses **flat borders** (`border: 1px solid #e0e0e0`)
- **Minimal depth** (no shadows)
- **Rounded corners** (6-8px)
- **Hover states** with background color
**Recommendation**:
- **Add subtle shadows** to sidebar and toolbar (depth perception)
- **Use elevation system** (sidebar = z-10, toolbar = z-20, modals = z-50)
- **Add backdrop blur** for modals/overlays
---
## 🎨 Specific UX Improvements
### Priority 1: Layout Flexibility (High Impact, Medium Effort)
**Implementation**:
```tsx
import { Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels';
Download Source