Skip to main content

Working with Mermaid Diagrams

Panduan lengkap untuk bekerja dengan Mermaid diagrams di dokumentasi ini.

🎯 Quick Actions

1. Zoom In/Out

  • Browser Zoom: Cmd/Ctrl + Scroll atau Cmd/Ctrl + Plus/Minus
  • Open in New Tab: Klik kanan pada diagram β†’ β€œOpen Image in New Tab”
  • Fullscreen: Tekan F11 untuk fullscreen mode

2. Download Diagram

  1. Copy code Mermaid dari dokumentasi
  2. Buka Mermaid Live Editor
  3. Paste code di editor
  4. Klik Actions β†’ Download:
    • PNG (untuk presentasi)
    • SVG (untuk editing lebih lanjut)
    • PDF (untuk dokumentasi)

Method B: Via Browser DevTools

  1. Klik kanan pada diagram β†’ Inspect Element
  2. Find <svg> element
  3. Klik kanan pada <svg> β†’ Copy β†’ Copy outerHTML
  4. Paste ke text editor dan save sebagai .svg
  5. Buka di browser atau convert ke PNG menggunakan tool online

Method C: Via Screenshot

  1. macOS: Cmd + Shift + 4 β†’ select area
  2. Windows: Win + Shift + S β†’ select area
  3. Linux: PrtScn atau screenshot tool

3. Edit Diagram

  1. Copy code Mermaid
  2. Buka Mermaid Live Editor
  3. Edit sesuai kebutuhan
  4. Download hasil edit

πŸ”§ Mermaid Live Editor Features

Mermaid Live Editor menyediakan:
  • βœ… Live Preview - Real-time rendering
  • βœ… Export Options - PNG, SVG, PDF
  • βœ… Theme Selection - Light/Dark/Custom themes
  • βœ… Share Link - Generate shareable link
  • βœ… Configuration - Customize diagram appearance

πŸ“‹ Example Workflow

Scenario: Download ERD Diagram

  1. Buka halaman dengan ERD diagram (contoh: /40-database/erd-diagram)
  2. Copy Mermaid code:
  1. Paste ke Mermaid Live:
  2. Customize (optional):
    • Pilih theme (default, dark, forest, etc.)
    • Adjust configuration
  3. Download:
    • Klik Actions β†’ Download SVG atau Download PNG
    • Save ke local machine

🎨 Advanced: Custom Styling

Anda bisa customize appearance diagram dengan Mermaid configuration:
%%{init: {
  'theme': 'base',
  'themeVariables': {
    'primaryColor': '#035478',
    'primaryTextColor': '#fff',
    'primaryBorderColor': '#0284c7',
    'lineColor': '#38bdf8',
    'secondaryColor': '#f0f9ff',
    'tertiaryColor': '#e0f2fe'
  }
}}%%
Tambahkan di awal code Mermaid untuk custom colors.

πŸ’‘ Pro Tips

Untuk Diagram Kompleks:
  • Gunakan Mermaid Live Editor untuk preview yang lebih baik
  • Download sebagai SVG untuk quality terbaik
  • Gunakan theme β€œdark” atau β€œforest” untuk readability
Browser Compatibility:
  • Mermaid diagrams require JavaScript enabled
  • Beberapa browser lama mungkin tidak support rendering
  • Gunakan Chrome/Firefox/Safari versi terbaru untuk hasil optimal

πŸš€ Quick Reference

ActionShortcut/Method
Zoom InCmd/Ctrl + Plus
Zoom OutCmd/Ctrl + Minus
Reset ZoomCmd/Ctrl + 0
FullscreenF11
Screenshot (macOS)Cmd + Shift + 4
Screenshot (Windows)Win + Shift + S
Open in New TabRight-click β†’ β€œOpen Image in New Tab”
Copy SVGDevTools β†’ Copy outerHTML

πŸ“ž Need Help?

Jika Anda mengalami kesulitan dengan Mermaid diagrams:
  1. Check Mermaid Documentation
  2. Try Mermaid Live Editor untuk troubleshooting
  3. Contact team untuk assistance