|
| 1 | +# Previewing the Dependency Graph |
| 2 | + |
| 3 | +This document explains how to preview the generated dependency graphs in different formats. |
| 4 | + |
| 5 | +## 1. Mermaid Format (Recommended for GitHub) |
| 6 | + |
| 7 | +The Mermaid format can be viewed directly in GitHub or using online Mermaid editors. |
| 8 | + |
| 9 | +### Option A: View in GitHub |
| 10 | + |
| 11 | +1. Open `docs/dependency_graph/dependencies.mmd` in GitHub |
| 12 | +1. GitHub will automatically render Mermaid diagrams |
| 13 | + |
| 14 | +### Option B: Online Mermaid Editor |
| 15 | + |
| 16 | +1. Copy the contents of `dependencies.mmd` |
| 17 | +1. Paste into one of these online editors: |
| 18 | + - https://mermaid.live/ |
| 19 | + - https://mermaid-js.github.io/mermaid-live-editor/ |
| 20 | + |
| 21 | +### Option C: View in VS Code |
| 22 | + |
| 23 | +If you have the Mermaid extension installed in VS Code, it will preview automatically. |
| 24 | + |
| 25 | +## 2. DOT Format (Graphviz) |
| 26 | + |
| 27 | +### Option A: Convert to Image (if Graphviz is installed) |
| 28 | + |
| 29 | +```bash |
| 30 | +# Generate PNG |
| 31 | +dot -Tpng docs/dependency_graph/dependencies.dot -o docs/dependency_graph/dependencies.png |
| 32 | + |
| 33 | +# Generate SVG (scalable) |
| 34 | +dot -Tsvg docs/dependency_graph/dependencies.dot -o docs/dependency_graph/dependencies.svg |
| 35 | + |
| 36 | +# Generate PDF |
| 37 | +dot -Tpdf docs/dependency_graph/dependencies.dot -o docs/dependency_graph/dependencies.pdf |
| 38 | +``` |
| 39 | + |
| 40 | +### Option B: Online Graphviz Editors |
| 41 | + |
| 42 | +1. Copy the contents of `dependencies.dot` |
| 43 | +1. Paste into one of these online tools: |
| 44 | + - https://dreampuf.github.io/GraphvizOnline/ |
| 45 | + - https://edotor.net/ |
| 46 | + - https://graphviz.christine.website/ |
| 47 | + |
| 48 | +## 3. JSON Format |
| 49 | + |
| 50 | +### Option A: Pretty Print in Terminal |
| 51 | + |
| 52 | +```bash |
| 53 | +cat docs/dependency_graph/dependencies.json | python3 -m json.tool | less |
| 54 | +``` |
| 55 | + |
| 56 | +### Option B: View in Browser |
| 57 | + |
| 58 | +```bash |
| 59 | +# Open in default browser (if you have a JSON viewer extension) |
| 60 | +xdg-open docs/dependency_graph/dependencies.json # Linux |
| 61 | +open docs/dependency_graph/dependencies.json # macOS |
| 62 | +``` |
| 63 | + |
| 64 | +### Option C: Use jq (if installed) |
| 65 | + |
| 66 | +```bash |
| 67 | +jq '.' docs/dependency_graph/dependencies.json | less |
| 68 | +``` |
| 69 | + |
| 70 | +## 4. Markdown Summary |
| 71 | + |
| 72 | +Simply view the file: |
| 73 | + |
| 74 | +```bash |
| 75 | +cat docs/dependency_graph/dependencies.md |
| 76 | +# or |
| 77 | +less docs/dependency_graph/dependencies.md |
| 78 | +``` |
| 79 | + |
| 80 | +Or open in any Markdown viewer/editor. |
| 81 | + |
| 82 | +## Quick Preview Commands |
| 83 | + |
| 84 | +Here are some quick commands to preview each format: |
| 85 | + |
| 86 | +```bash |
| 87 | +# View Mermaid (copy to online editor) |
| 88 | +cat docs/dependency_graph/dependencies.mmd |
| 89 | + |
| 90 | +# View Markdown summary |
| 91 | +cat docs/dependency_graph/dependencies.md |
| 92 | + |
| 93 | +# View JSON (pretty printed) |
| 94 | +python3 -m json.tool docs/dependency_graph/dependencies.json | less |
| 95 | + |
| 96 | +# Generate PNG from DOT (if Graphviz installed) |
| 97 | +dot -Tpng docs/dependency_graph/dependencies.dot -o /tmp/deps.png && xdg-open /tmp/deps.png |
| 98 | +``` |
0 commit comments