hugo-theme-relearn/shortcodes/mermaid/index.print.html
2024-10-13 14:26:50 +00:00

1063 lines
69 KiB
HTML

<!DOCTYPE html>
<html lang="en" dir="ltr" itemscope itemtype="http://schema.org/Article">
<head>
<meta charset="utf-8">
<meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0, minimum-scale=1.0">
<meta name="generator" content="Hugo 0.135.0">
<meta name="generator" content="Relearn 6.4.0+a68b5ec4d1b9a246993bb82840cdaeeeb44ff109">
<meta name="description" content="Generate diagrams and flowcharts from text">
<meta name="author" content="Sören Weber">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://mcshelby.github.io/hugo-theme-relearn/images/hero.png">
<meta name="twitter:title" content="Mermaid :: Hugo Relearn Theme">
<meta name="twitter:description" content="Generate diagrams and flowcharts from text">
<meta property="og:url" content="https://mcshelby.github.io/hugo-theme-relearn/shortcodes/mermaid/index.html">
<meta property="og:site_name" content="Hugo Relearn Theme">
<meta property="og:title" content="Mermaid :: Hugo Relearn Theme">
<meta property="og:description" content="Generate diagrams and flowcharts from text">
<meta property="og:locale" content="en">
<meta property="og:type" content="article">
<meta property="article:section" content="Shortcodes">
<meta property="og:image" content="https://mcshelby.github.io/hugo-theme-relearn/images/hero.png">
<meta itemprop="name" content="Mermaid :: Hugo Relearn Theme">
<meta itemprop="description" content="Generate diagrams and flowcharts from text">
<meta itemprop="wordCount" content="2296">
<meta itemprop="image" content="https://mcshelby.github.io/hugo-theme-relearn/images/hero.png">
<meta itemprop="keywords" content="Howto,Reference,CustomMermaidURL,Mermaid.force,MermaidInitialize,MermaidZoom,CustomMermaidURL,Mermaid.force,MermaidInitialize,MermaidZoom">
<title>Mermaid :: Hugo Relearn Theme</title>
<link href="https://mcshelby.github.io/hugo-theme-relearn/shortcodes/mermaid/index.html" rel="alternate" hreflang="x-default">
<link href="https://mcshelby.github.io/hugo-theme-relearn/shortcodes/mermaid/index.html" rel="alternate" hreflang="en">
<link href="https://mcshelby.github.io/hugo-theme-relearn/pir/shortcodes/mermaid/index.html" rel="alternate" hreflang="art-x-pir">
<link href="https://mcshelby.github.io/hugo-theme-relearn/shortcodes/mermaid/index.html" rel="canonical" type="text/html" title="Mermaid :: Hugo Relearn Theme">
<link href="/hugo-theme-relearn/shortcodes/mermaid/index.xml" rel="alternate" type="application/rss+xml" title="Mermaid :: Hugo Relearn Theme">
<link href="/hugo-theme-relearn/images/logo.svg?1728829597" rel="icon" type="image/svg+xml">
<link href="/hugo-theme-relearn/css/fontawesome-all.min.css?1728829597" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="/hugo-theme-relearn/css/fontawesome-all.min.css?1728829597" rel="stylesheet"></noscript>
<link href="/hugo-theme-relearn/css/nucleus.css?1728829597" rel="stylesheet">
<link href="/hugo-theme-relearn/css/auto-complete.css?1728829597" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="/hugo-theme-relearn/css/auto-complete.css?1728829597" rel="stylesheet"></noscript>
<link href="/hugo-theme-relearn/css/perfect-scrollbar.min.css?1728829597" rel="stylesheet">
<link href="/hugo-theme-relearn/css/fonts.css?1728829597" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="/hugo-theme-relearn/css/fonts.css?1728829597" rel="stylesheet"></noscript>
<link href="/hugo-theme-relearn/css/theme.css?1728829597" rel="stylesheet">
<link href="/hugo-theme-relearn/css/theme-relearn-auto.css?1728829597" rel="stylesheet" id="R-variant-style">
<link href="/hugo-theme-relearn/css/chroma-relearn-auto.css?1728829597" rel="stylesheet" id="R-variant-chroma-style">
<link href="/hugo-theme-relearn/css/print.css?1728829597" rel="stylesheet" media="print">
<link href="/hugo-theme-relearn/css/format-print.css?1728829597" rel="stylesheet">
<script src="/hugo-theme-relearn/js/variant.js?1728829597"></script>
<script>
window.relearn = window.relearn || {};
window.relearn.relBasePath='..\/..';
window.relearn.relBaseUri='..\/..\/..';
window.relearn.absBaseUri='https:\/\/mcshelby.github.io\/hugo-theme-relearn';
window.relearn.disableAnchorCopy=false;
window.relearn.disableAnchorScrolling=false;
// variant stuff
window.variants && variants.init( [ 'relearn-auto', 'relearn-light', 'relearn-dark', 'relearn-bright', 'zen-auto', 'zen-light', 'zen-dark', 'retro-auto', 'neon', 'learn', 'blue', 'green', 'red' ] );
// translations
window.T_Copy_to_clipboard = `Copy to clipboard`;
window.T_Copied_to_clipboard = `Copied to clipboard!`;
window.T_Copy_link_to_clipboard = `Copy link to clipboard`;
window.T_Link_copied_to_clipboard = `Copied link to clipboard!`;
window.T_Reset_view = `Reset view`;
window.T_View_reset = `View reset!`;
window.T_No_results_found = `No results found for "{0}"`;
window.T_N_results_found = `{1} results found for "{0}"`;
</script>
<style>
#R-body img.bg-white {
background-color: white;
}
</style>
</head>
<body class="mobile-support print disableInlineCopyToClipboard" data-url="/hugo-theme-relearn/shortcodes/mermaid/index.html">
<div id="R-body" class="default-animation">
<div id="R-body-overlay"></div>
<nav id="R-topbar">
<div class="topbar-wrapper">
<div class="topbar-sidebar-divider"></div>
<div class="topbar-area topbar-area-start" data-area="start">
<div class="topbar-button topbar-button-sidebar" data-content-empty="disable" data-width-s="show" data-width-m="hide" data-width-l="hide"><button class="topbar-control" onclick="toggleNav()" type="button" title="Menu (CTRL&#43;ALT&#43;n)"><i class="fa-fw fas fa-bars"></i></button>
</div>
<div class="topbar-button topbar-button-toc" data-content-empty="hide" data-width-s="show" data-width-m="show" data-width-l="show"><button class="topbar-control" onclick="toggleTopbarFlyout(this)" type="button" title="Table of Contents (CTRL&#43;ALT&#43;t)"><i class="fa-fw fas fa-list-alt"></i></button>
<div class="topbar-content">
<div class="topbar-content-wrapper">
<nav class="TableOfContents">
<ul>
<li><a href="#usage">Usage</a>
<ul>
<li><a href="#parameter">Parameter</a></li>
</ul>
</li>
<li><a href="#settings">Settings</a>
<ul>
<li><a href="#configuring-pan-and-zoom">Configuring Pan and Zoom</a></li>
<li><a href="#providing-initialization-options-for-the-mermaid-library">Providing Initialization Options for the Mermaid Library</a></li>
<li><a href="#loading-an-external-version-of-the-mermaid-library">Loading an External Version of the Mermaid Library</a></li>
<li><a href="#force-loading-of-the-mermaid-library">Force Loading of the Mermaid Library</a></li>
<li><a href="#setting-a-specific-mermaid-theme">Setting a Specific Mermaid Theme</a></li>
</ul>
</li>
<li><a href="#examples">Examples</a>
<ul>
<li><a href="#flowchart-with-yaml-title">Flowchart with YAML-Title</a></li>
<li><a href="#sequence-diagram-with-configuration-directive">Sequence Diagram with Configuration Directive</a></li>
<li><a href="#class-diagram">Class Diagram</a></li>
<li><a href="#state-diagram-aligned-to-the-right-using-shortcode-syntax">State Diagram Aligned to the Right Using Shortcode Syntax</a></li>
<li><a href="#entity-relationship-model-with-non-default-mermaid-theme">Entity Relationship Model with Non-Default Mermaid Theme</a></li>
<li><a href="#user-journey">User Journey</a></li>
<li><a href="#gantt-chart">GANTT Chart</a></li>
<li><a href="#pie-chart-without-zoom">Pie Chart without Zoom</a></li>
<li><a href="#quadrant-chart">Quadrant Chart</a></li>
<li><a href="#requirement-diagram">Requirement Diagram</a></li>
<li><a href="#git-graph">Git Graph</a></li>
<li><a href="#c4-diagrams">C4 Diagrams</a></li>
<li><a href="#mindmaps">Mindmaps</a></li>
<li><a href="#timeline">Timeline</a></li>
<li><a href="#sankey">Sankey</a></li>
<li><a href="#xychart">XYChart</a></li>
<li><a href="#block-diagram">Block Diagram</a></li>
<li><a href="#packet">Packet</a></li>
<li><a href="#architecture">Architecture</a></li>
</ul>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
<ol class="topbar-breadcrumbs breadcrumbs highlightable" itemscope itemtype="http://schema.org/BreadcrumbList"><li
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><a itemprop="item" href="/hugo-theme-relearn/shortcodes/index.html"><span itemprop="name">Shortcodes</span></a><meta itemprop="position" content="1">&nbsp;>&nbsp;</li><li
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><span itemprop="name">Mermaid</span><meta itemprop="position" content="2"></li>
</ol>
<div class="topbar-area topbar-area-end" data-area="end">
<div class="topbar-button topbar-button-edit" data-content-empty="disable" data-width-s="area-more" data-width-m="show" data-width-l="show"><a class="topbar-control" href="https://github.com/McShelby/hugo-theme-relearn/edit/main/exampleSite/content/shortcodes/mermaid.en.md" target="_self" title="Edit (CTRL&#43;ALT&#43;w)"><i class="fa-fw fas fa-pen"></i></a>
</div>
<div class="topbar-button topbar-button-print" data-content-empty="disable" data-width-s="area-more" data-width-m="show" data-width-l="show"><a class="topbar-control" href="/hugo-theme-relearn/shortcodes/mermaid/index.print.html" title="Print whole chapter (CTRL&#43;ALT&#43;p)"><i class="fa-fw fas fa-print"></i></a>
</div>
<div class="topbar-button topbar-button-prev" data-content-empty="disable" data-width-s="show" data-width-m="show" data-width-l="show"><a class="topbar-control" href="/hugo-theme-relearn/shortcodes/math/index.html" title="Math (🡐)"><i class="fa-fw fas fa-chevron-left"></i></a>
</div>
<div class="topbar-button topbar-button-next" data-content-empty="disable" data-width-s="show" data-width-m="show" data-width-l="show"><a class="topbar-control" href="/hugo-theme-relearn/shortcodes/notice/index.html" title="Notice (🡒)"><i class="fa-fw fas fa-chevron-right"></i></a>
</div>
<div class="topbar-button topbar-button-more" data-content-empty="hide" data-width-s="show" data-width-m="show" data-width-l="show"><button class="topbar-control" onclick="toggleTopbarFlyout(this)" type="button" title="More"><i class="fa-fw fas fa-ellipsis-v"></i></button>
<div class="topbar-content">
<div class="topbar-content-wrapper">
<div class="topbar-area topbar-area-more" data-area="more">
</div>
</div>
</div>
</div>
</div>
</div>
</nav>
<div id="R-main-overlay"></div>
<main id="R-body-inner" class="highlightable shortcodes" tabindex="-1">
<div class="flex-block-wrapper">
<article class="default">
<header class="headline">
</header>
<h1 id="mermaid">Mermaid</h1>
<p>The <code>mermaid</code> shortcode generates diagrams and flowcharts from text in a similar manner as Markdown using the <a href="https://mermaidjs.github.io/" rel="external" target="_self">Mermaid</a> library.</p>
<pre class="mermaid align-center zoomable">graph LR;
If --&gt; Then
Then --&gt; Else</pre>
<h2 id="usage">Usage</h2>
<div class="tab-panel" data-tab-group="shortcode-parameter">
<div class="tab-nav">
<div class="tab-nav-title">&#8203;</div>
<button
data-tab-item="codefence"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
onclick="switchTab('shortcode-parameter','codefence')"
>
<span class="tab-nav-text">codefence</span>
</button>
<button
data-tab-item="shortcode"
class="tab-nav-button tab-panel-style cstyle initial"
onclick="switchTab('shortcode-parameter','shortcode')"
>
<span class="tab-nav-text">shortcode</span>
</button>
<button
data-tab-item="partial"
class="tab-nav-button tab-panel-style cstyle initial"
onclick="switchTab('shortcode-parameter','partial')"
>
<span class="tab-nav-text">partial</span>
</button>
</div>
<div class="tab-content-container">
<div
data-tab-item="codefence"
class="tab-content tab-panel-style cstyle initial active">
<div class="tab-content-text">
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl">```mermaid {align=&#34;center&#34; zoom=&#34;true&#34;}
</span></span><span class="line"><span class="cl">graph LR;
</span></span><span class="line"><span class="cl"> If --&gt; Then
</span></span><span class="line"><span class="cl"> Then --&gt; Else
</span></span><span class="line"><span class="cl">```</span></span></code></pre></div>
</div>
</div>
<div
data-tab-item="shortcode"
class="tab-content tab-panel-style cstyle initial">
<div class="tab-content-text">
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="p">{{&lt;</span> <span class="nx">mermaid</span> <span class="nx">align</span><span class="p">=</span><span class="s">&#34;center&#34;</span> <span class="nx">zoom</span><span class="p">=</span><span class="s">&#34;true&#34;</span> <span class="p">&gt;}}</span>
</span></span><span class="line"><span class="cl"><span class="nx">graph</span> <span class="nx">LR</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"> <span class="nx">If</span> <span class="o">--</span><span class="p">&gt;</span> <span class="nx">Then</span>
</span></span><span class="line"><span class="cl"> <span class="nx">Then</span> <span class="o">--</span><span class="p">&gt;</span> <span class="nx">Else</span>
</span></span><span class="line"><span class="cl"><span class="p">{{&lt;</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">&gt;}}</span></span></span></code></pre></div>
</div>
</div>
<div
data-tab-item="partial"
class="tab-content tab-panel-style cstyle initial">
<div class="tab-content-text">
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="p">{{</span> <span class="nx">partial</span> <span class="s">&#34;shortcodes/mermaid.html&#34;</span> <span class="p">(</span><span class="nx">dict</span>
</span></span><span class="line"><span class="cl"> <span class="s">&#34;page&#34;</span> <span class="p">.</span>
</span></span><span class="line"><span class="cl"> <span class="s">&#34;content&#34;</span> <span class="s">&#34;graph LR;\n If --&gt; Then\n Then --&gt; Else&#34;</span>
</span></span><span class="line"><span class="cl"> <span class="s">&#34;align&#34;</span> <span class="s">&#34;center&#34;</span>
</span></span><span class="line"><span class="cl"> <span class="s">&#34;zoom&#34;</span> <span class="s">&#34;true&#34;</span>
</span></span><span class="line"><span class="cl"><span class="p">)}}</span></span></span></code></pre></div>
</div>
</div>
</div>
</div>
<p>Codefence syntax is widely available in other Markdown parsers like GitHub and therefore is the recommend syntax for generating portable Markdown.</p>
<h3 id="parameter">Parameter</h3>
<table>
<thead>
<tr>
<th style="text-align: left">Name</th>
<th style="text-align: left">Default</th>
<th style="text-align: left">Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left"><strong>align</strong></td>
<td style="text-align: left"><code>center</code></td>
<td style="text-align: left">The vertical alignment.<br><br>Allowed values are <code>left</code>, <code>center</code> or <code>right</code>.</td>
</tr>
<tr>
<td style="text-align: left"><strong>zoom</strong></td>
<td style="text-align: left">see notes</td>
<td style="text-align: left">Whether the graph is pan- and zoomable.<br><br>If not set the value is determined by the <a href="/hugo-theme-relearn/shortcodes/mermaid/index.html#configuring-pan-and-zoom"><code>mermaidZoom</code> setting</a> of your configurations options or the pages front matter or <code>false</code> if not set at all.<br><br>- <code>false</code>: no pan or zoom<br>- <code>true</code>: pan and zoom active</td>
</tr>
<tr>
<td style="text-align: left"><em><strong>&lt;content&gt;</strong></em></td>
<td style="text-align: left"><em>&lt;empty&gt;</em></td>
<td style="text-align: left">Your Mermaid graph.</td>
</tr>
</tbody>
</table>
<h2 id="settings">Settings</h2>
<h3 id="configuring-pan-and-zoom">Configuring Pan and Zoom</h3>
<p><span class="badge cstyle cyan badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-gears"></i></span><span class="badge-content">Option</span></span> <span class="badge cstyle green badge-with-title"><span class="badge-title"><i class="fa-fw fab fa-markdown"></i></span><span class="badge-content">Front Matter</span></span> The generated graphs can be panned by dragging them and zoomed by using the mousewheel. On mobile devices you can use finger gestures.</p>
<p>By default this is disabled. Set <code>mermaidZoom=true</code> to enable it.</p>
<p>Individual settings of a graphs <a href="/hugo-theme-relearn/shortcodes/mermaid/index.html#parameter"><code>zoom</code> parameter</a> have precedence over the page&rsquo;s front matter and configuration options in that order.</p>
<div class="tab-panel" data-tab-group="config-code">
<div class="tab-nav">
<div class="tab-nav-title">&#8203;</div>
<button
data-tab-item="toml"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
onclick="switchTab('config-code','toml')"
>
<span class="tab-nav-text">toml</span>
</button>
<button
data-tab-item="yaml"
class="tab-nav-button tab-panel-style cstyle initial"
onclick="switchTab('config-code','yaml')"
>
<span class="tab-nav-text">yaml</span>
</button>
<button
data-tab-item="json"
class="tab-nav-button tab-panel-style cstyle initial"
onclick="switchTab('config-code','json')"
>
<span class="tab-nav-text">json</span>
</button>
</div>
<div class="tab-content-container">
<div
data-tab-item="toml"
class="tab-content tab-panel-style cstyle initial active">
<div class="tab-content-text">
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="nx">mermaidZoom</span> <span class="p">=</span> <span class="kc">true</span></span></span></code></pre></div>
</div>
</div>
<div
data-tab-item="yaml"
class="tab-content tab-panel-style cstyle initial">
<div class="tab-content-text">
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">mermaidZoom</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span></span></span></code></pre></div>
</div>
</div>
<div
data-tab-item="json"
class="tab-content tab-panel-style cstyle initial">
<div class="tab-content-text">
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;mermaidZoom&#34;</span><span class="p">:</span> <span class="kc">true</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div>
</div>
</div>
</div>
</div>
<h3 id="providing-initialization-options-for-the-mermaid-library">Providing Initialization Options for the Mermaid Library</h3>
<p><span class="badge cstyle cyan badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-gears"></i></span><span class="badge-content">Option</span></span> <span class="badge cstyle green badge-with-title"><span class="badge-title"><i class="fa-fw fab fa-markdown"></i></span><span class="badge-content">Front Matter</span></span> The Mermaid library is configured with default settings for initialization.</p>
<p>You can overwrite the settings by providing a JSON object in <code>mermaidInitialize</code>. See <a href="https://mermaid-js.github.io/mermaid/#/Setup?id=mermaidapi-configuration-defaults" rel="external" target="_self">Mermaid&rsquo;s documentation</a> for all allowed settings.</p>
<p>Keep in mind that initialization settings of your pages front matter overwrite all settings of your configuration options.</p>
<p>In addition, you can merge settings for each individual graph through <a href="https://mermaid-js.github.io/mermaid/#/directives?id=directives" rel="external" target="_self">diagram directives</a> on top of the settings of your page&rsquo;s front matter or configuration options.</p>
<div class="tab-panel" data-tab-group="config-code">
<div class="tab-nav">
<div class="tab-nav-title">&#8203;</div>
<button
data-tab-item="toml"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
onclick="switchTab('config-code','toml')"
>
<span class="tab-nav-text">toml</span>
</button>
<button
data-tab-item="yaml"
class="tab-nav-button tab-panel-style cstyle initial"
onclick="switchTab('config-code','yaml')"
>
<span class="tab-nav-text">yaml</span>
</button>
<button
data-tab-item="json"
class="tab-nav-button tab-panel-style cstyle initial"
onclick="switchTab('config-code','json')"
>
<span class="tab-nav-text">json</span>
</button>
</div>
<div class="tab-content-container">
<div
data-tab-item="toml"
class="tab-content tab-panel-style cstyle initial active">
<div class="tab-content-text">
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="nx">mermaidInitialize</span> <span class="p">=</span> <span class="s1">&#39;{ &#34;securityLevel&#34;: &#34;loose&#34; }&#39;</span></span></span></code></pre></div>
</div>
</div>
<div
data-tab-item="yaml"
class="tab-content tab-panel-style cstyle initial">
<div class="tab-content-text">
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">mermaidInitialize</span><span class="p">:</span><span class="w"> </span><span class="s1">&#39;{ &#34;securityLevel&#34;: &#34;loose&#34; }&#39;</span></span></span></code></pre></div>
</div>
</div>
<div
data-tab-item="json"
class="tab-content tab-panel-style cstyle initial">
<div class="tab-content-text">
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;mermaidInitialize&#34;</span><span class="p">:</span> <span class="s2">&#34;{ \&#34;securityLevel\&#34;: \&#34;loose\&#34; }&#34;</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div>
</div>
</div>
</div>
</div>
<h3 id="loading-an-external-version-of-the-mermaid-library">Loading an External Version of the Mermaid Library</h3>
<p><span class="badge cstyle cyan badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-gears"></i></span><span class="badge-content">Option</span></span> <span class="badge cstyle green badge-with-title"><span class="badge-title"><i class="fa-fw fab fa-markdown"></i></span><span class="badge-content">Front Matter</span></span> The theme uses the shipped Mermaid library by default.</p>
<p>In case you want do use a different version of the Mermaid library but don&rsquo;t want to override the shipped version, you can set <code>customMermaidURL</code> to the URL of the external Mermaid library.</p>
<div class="tab-panel" data-tab-group="config-code">
<div class="tab-nav">
<div class="tab-nav-title">&#8203;</div>
<button
data-tab-item="toml"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
onclick="switchTab('config-code','toml')"
>
<span class="tab-nav-text">toml</span>
</button>
<button
data-tab-item="yaml"
class="tab-nav-button tab-panel-style cstyle initial"
onclick="switchTab('config-code','yaml')"
>
<span class="tab-nav-text">yaml</span>
</button>
<button
data-tab-item="json"
class="tab-nav-button tab-panel-style cstyle initial"
onclick="switchTab('config-code','json')"
>
<span class="tab-nav-text">json</span>
</button>
</div>
<div class="tab-content-container">
<div
data-tab-item="toml"
class="tab-content tab-panel-style cstyle initial active">
<div class="tab-content-text">
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="nx">customMermaidURL</span> <span class="p">=</span> <span class="s1">&#39;https://unpkg.com/mermaid/dist/mermaid.min.js&#39;</span></span></span></code></pre></div>
</div>
</div>
<div
data-tab-item="yaml"
class="tab-content tab-panel-style cstyle initial">
<div class="tab-content-text">
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">customMermaidURL</span><span class="p">:</span><span class="w"> </span><span class="l">https://unpkg.com/mermaid/dist/mermaid.min.js</span></span></span></code></pre></div>
</div>
</div>
<div
data-tab-item="json"
class="tab-content tab-panel-style cstyle initial">
<div class="tab-content-text">
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;customMermaidURL&#34;</span><span class="p">:</span> <span class="s2">&#34;https://unpkg.com/mermaid/dist/mermaid.min.js&#34;</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div>
</div>
</div>
</div>
</div>
<h3 id="force-loading-of-the-mermaid-library">Force Loading of the Mermaid Library</h3>
<p><span class="badge cstyle cyan badge-with-title"><span class="badge-title"><i class="fa-fw fas fa-gears"></i></span><span class="badge-content">Option</span></span> <span class="badge cstyle green badge-with-title"><span class="badge-title"><i class="fa-fw fab fa-markdown"></i></span><span class="badge-content">Front Matter</span></span> The Mermaid library will be loaded if the page contains an <code>mermaid</code> shortcode or codefence.</p>
<p>You can force loading the Mermaid library if no shortcode or codefence was used by setting <code>mermaid.force=true</code>. If a shortcode or codefence was found, this option has no effect. This comes handy in case you are using scripting to render a graph.</p>
<div class="tab-panel" data-tab-group="config-code">
<div class="tab-nav">
<div class="tab-nav-title">&#8203;</div>
<button
data-tab-item="toml"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
onclick="switchTab('config-code','toml')"
>
<span class="tab-nav-text">toml</span>
</button>
<button
data-tab-item="yaml"
class="tab-nav-button tab-panel-style cstyle initial"
onclick="switchTab('config-code','yaml')"
>
<span class="tab-nav-text">yaml</span>
</button>
<button
data-tab-item="json"
class="tab-nav-button tab-panel-style cstyle initial"
onclick="switchTab('config-code','json')"
>
<span class="tab-nav-text">json</span>
</button>
</div>
<div class="tab-content-container">
<div
data-tab-item="toml"
class="tab-content tab-panel-style cstyle initial active">
<div class="tab-content-text">
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">mermaid</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">force</span> <span class="p">=</span> <span class="kc">true</span></span></span></code></pre></div>
</div>
</div>
<div
data-tab-item="yaml"
class="tab-content tab-panel-style cstyle initial">
<div class="tab-content-text">
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">mermaid</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">force</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span></span></span></code></pre></div>
</div>
</div>
<div
data-tab-item="json"
class="tab-content tab-panel-style cstyle initial">
<div class="tab-content-text">
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;mermaid&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;force&#34;</span><span class="p">:</span> <span class="kc">true</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div>
</div>
</div>
</div>
</div>
<h3 id="setting-a-specific-mermaid-theme">Setting a Specific Mermaid Theme</h3>
<p>While you can configure the Mermaid theme to render your graph by using one of the <a href="/hugo-theme-relearn/shortcodes/mermaid/index.html#providing-initialization-options-for-the-mermaid-library">initialization options</a>, the recommended way is to set the default value using the <code>--MERMAID-theme</code> variable in your <a href="/hugo-theme-relearn/configuration/branding/generator/index.html">color variant stylesheet</a>. This allows your graphs to look pretty when the user switches the color variant.</p>
<h2 id="examples">Examples</h2>
<h3 id="flowchart-with-yaml-title">Flowchart with YAML-Title</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>---
</span></span><span class="line"><span class="cl">title: Example Diagram
</span></span><span class="line"><span class="cl">---
</span></span><span class="line"><span class="cl">graph LR;
</span></span><span class="line"><span class="cl"> A[Hard edge] --&gt;|Link text| B(Round edge)
</span></span><span class="line"><span class="cl"> B --&gt; C{&lt;strong&gt;Decision&lt;/strong&gt;}
</span></span><span class="line"><span class="cl"> C --&gt;|One| D[Result one]
</span></span><span class="line"><span class="cl"> C --&gt;|Two| E[Result two]
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">---
title: Example Diagram
---
graph LR;
A[Hard edge] --&gt;|Link text| B(Round edge)
B --&gt; C{&lt;strong&gt;Decision&lt;/strong&gt;}
C --&gt;|One| D[Result one]
C --&gt;|Two| E[Result two]</pre>
<h3 id="sequence-diagram-with-configuration-directive">Sequence Diagram with Configuration Directive</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>%%{init:{&#34;fontFamily&#34;:&#34;monospace&#34;, &#34;sequence&#34;:{&#34;showSequenceNumbers&#34;:true}}}%%
</span></span><span class="line"><span class="cl">sequenceDiagram
</span></span><span class="line"><span class="cl"> Alice-&gt;&gt;John: Hello John, how are you?
</span></span><span class="line"><span class="cl"> loop Healthcheck
</span></span><span class="line"><span class="cl"> John-&gt;&gt;John: Fight against hypochondria
</span></span><span class="line"><span class="cl"> end
</span></span><span class="line"><span class="cl"> Note right of John: Rational thoughts!
</span></span><span class="line"><span class="cl"> John--&gt;&gt;Alice: Great!
</span></span><span class="line"><span class="cl"> John-&gt;&gt;Bob: How about you?
</span></span><span class="line"><span class="cl"> Bob--&gt;&gt;John: Jolly good!
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">%%{init:{&#34;fontFamily&#34;:&#34;monospace&#34;, &#34;sequence&#34;:{&#34;showSequenceNumbers&#34;:true}}}%%
sequenceDiagram
Alice-&gt;&gt;John: Hello John, how are you?
loop Healthcheck
John-&gt;&gt;John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John--&gt;&gt;Alice: Great!
John-&gt;&gt;Bob: How about you?
Bob--&gt;&gt;John: Jolly good!</pre>
<h3 id="class-diagram">Class Diagram</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>classDiagram
</span></span><span class="line"><span class="cl"> Animal &lt;|-- Duck
</span></span><span class="line"><span class="cl"> Animal &lt;|-- Fish
</span></span><span class="line"><span class="cl"> Animal &lt;|-- Zebra
</span></span><span class="line"><span class="cl"> Animal : +int age
</span></span><span class="line"><span class="cl"> Animal : +String gender
</span></span><span class="line"><span class="cl"> Animal: +isMammal()
</span></span><span class="line"><span class="cl"> Animal: +mate()
</span></span><span class="line"><span class="cl"> class Duck{
</span></span><span class="line"><span class="cl"> +String beakColor
</span></span><span class="line"><span class="cl"> +swim()
</span></span><span class="line"><span class="cl"> +quack()
</span></span><span class="line"><span class="cl"> }
</span></span><span class="line"><span class="cl"> class Fish{
</span></span><span class="line"><span class="cl"> -int sizeInFeet
</span></span><span class="line"><span class="cl"> -canEat()
</span></span><span class="line"><span class="cl"> }
</span></span><span class="line"><span class="cl"> class Zebra{
</span></span><span class="line"><span class="cl"> +bool is_wild
</span></span><span class="line"><span class="cl"> +run()
</span></span><span class="line"><span class="cl"> }
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">classDiagram
Animal &lt;|-- Duck
Animal &lt;|-- Fish
Animal &lt;|-- Zebra
Animal : &#43;int age
Animal : &#43;String gender
Animal: &#43;isMammal()
Animal: &#43;mate()
class Duck{
&#43;String beakColor
&#43;swim()
&#43;quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
&#43;bool is_wild
&#43;run()
}</pre>
<h3 id="state-diagram-aligned-to-the-right-using-shortcode-syntax">State Diagram Aligned to the Right Using Shortcode Syntax</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="p">{{&lt;</span> <span class="nx">mermaid</span> <span class="nx">align</span><span class="p">=</span><span class="s">&#34;right&#34;</span> <span class="p">&gt;}}</span>
</span></span><span class="line"><span class="cl"><span class="nx">stateDiagram</span><span class="o">-</span><span class="nx">v2</span>
</span></span><span class="line"><span class="cl"> <span class="nx">open</span><span class="p">:</span> <span class="nx">Open</span> <span class="nx">Door</span>
</span></span><span class="line"><span class="cl"> <span class="nx">closed</span><span class="p">:</span> <span class="nx">Closed</span> <span class="nx">Door</span>
</span></span><span class="line"><span class="cl"> <span class="nx">locked</span><span class="p">:</span> <span class="nx">Locked</span> <span class="nx">Door</span>
</span></span><span class="line"><span class="cl"> <span class="nx">open</span> <span class="o">--</span><span class="p">&gt;</span> <span class="nx">closed</span><span class="p">:</span> <span class="nx">Close</span>
</span></span><span class="line"><span class="cl"> <span class="nx">closed</span> <span class="o">--</span><span class="p">&gt;</span> <span class="nx">locked</span><span class="p">:</span> <span class="nx">Lock</span>
</span></span><span class="line"><span class="cl"> <span class="nx">locked</span> <span class="o">--</span><span class="p">&gt;</span> <span class="nx">closed</span><span class="p">:</span> <span class="nx">Unlock</span>
</span></span><span class="line"><span class="cl"> <span class="nx">closed</span> <span class="o">--</span><span class="p">&gt;</span> <span class="nx">open</span><span class="p">:</span> <span class="nx">Open</span>
</span></span><span class="line"><span class="cl"><span class="p">{{&lt;</span> <span class="o">/</span><span class="nx">mermaid</span> <span class="p">&gt;}}</span></span></span></code></pre></div>
<pre class="mermaid align-right zoomable">
stateDiagram-v2
open: Open Door
closed: Closed Door
locked: Locked Door
open --&gt; closed: Close
closed --&gt; locked: Lock
locked --&gt; closed: Unlock
closed --&gt; open: Open
</pre>
<h3 id="entity-relationship-model-with-non-default-mermaid-theme">Entity Relationship Model with Non-Default Mermaid Theme</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>%%{init:{&#34;theme&#34;:&#34;forest&#34;}}%%
</span></span><span class="line"><span class="cl">erDiagram
</span></span><span class="line"><span class="cl"> CUSTOMER }|..|{ DELIVERY-ADDRESS : has
</span></span><span class="line"><span class="cl"> CUSTOMER ||--o{ ORDER : places
</span></span><span class="line"><span class="cl"> CUSTOMER ||--o{ INVOICE : &#34;liable for&#34;
</span></span><span class="line"><span class="cl"> DELIVERY-ADDRESS ||--o{ ORDER : receives
</span></span><span class="line"><span class="cl"> INVOICE ||--|{ ORDER : covers
</span></span><span class="line"><span class="cl"> ORDER ||--|{ ORDER-ITEM : includes
</span></span><span class="line"><span class="cl"> PRODUCT-CATEGORY ||--|{ PRODUCT : contains
</span></span><span class="line"><span class="cl"> PRODUCT ||--o{ ORDER-ITEM : &#34;ordered in&#34;
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">%%{init:{&#34;theme&#34;:&#34;forest&#34;}}%%
erDiagram
CUSTOMER }|..|{ DELIVERY-ADDRESS : has
CUSTOMER ||--o{ ORDER : places
CUSTOMER ||--o{ INVOICE : &#34;liable for&#34;
DELIVERY-ADDRESS ||--o{ ORDER : receives
INVOICE ||--|{ ORDER : covers
ORDER ||--|{ ORDER-ITEM : includes
PRODUCT-CATEGORY ||--|{ PRODUCT : contains
PRODUCT ||--o{ ORDER-ITEM : &#34;ordered in&#34;</pre>
<h3 id="user-journey">User Journey</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>journey
</span></span><span class="line"><span class="cl"> title My working day
</span></span><span class="line"><span class="cl"> section Go to work
</span></span><span class="line"><span class="cl"> Make tea: 5: Me
</span></span><span class="line"><span class="cl"> Go upstairs: 3: Me
</span></span><span class="line"><span class="cl"> Do work: 1: Me, Cat
</span></span><span class="line"><span class="cl"> section Go home
</span></span><span class="line"><span class="cl"> Go downstairs: 5: Me
</span></span><span class="line"><span class="cl"> Sit down: 3: Me
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 3: Me</pre>
<h3 id="gantt-chart">GANTT Chart</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>gantt
</span></span><span class="line"><span class="cl"> dateFormat YYYY-MM-DD
</span></span><span class="line"><span class="cl"> title Adding GANTT diagram functionality to Mermaid
</span></span><span class="line"><span class="cl"> section A section
</span></span><span class="line"><span class="cl"> Completed task :done, des1, 2014-01-06,2014-01-08
</span></span><span class="line"><span class="cl"> Active task :active, des2, 2014-01-09, 3d
</span></span><span class="line"><span class="cl"> Future task : des3, after des2, 5d
</span></span><span class="line"><span class="cl"> Future task2 : des4, after des3, 5d
</span></span><span class="line"><span class="cl"> section Critical tasks
</span></span><span class="line"><span class="cl"> Completed task in the critical line :crit, done, 2014-01-06,24h
</span></span><span class="line"><span class="cl"> Implement parser and jison :crit, done, after des1, 2d
</span></span><span class="line"><span class="cl"> Create tests for parser :crit, active, 3d
</span></span><span class="line"><span class="cl"> Future task in critical line :crit, 5d
</span></span><span class="line"><span class="cl"> Create tests for renderer :2d
</span></span><span class="line"><span class="cl"> Add to Mermaid :1d
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">gantt
dateFormat YYYY-MM-DD
title Adding GANTT diagram functionality to Mermaid
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison :crit, done, after des1, 2d
Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d
Create tests for renderer :2d
Add to Mermaid :1d</pre>
<h3 id="pie-chart-without-zoom">Pie Chart without Zoom</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl">```mermaid {zoom=&#34;false&#34;}
</span></span><span class="line"><span class="cl">pie title Pets adopted by volunteers
</span></span><span class="line"><span class="cl"> &#34;Dogs&#34; : 386
</span></span><span class="line"><span class="cl"> &#34;Cats&#34; : 85
</span></span><span class="line"><span class="cl"> &#34;Rats&#34; : 15
</span></span><span class="line"><span class="cl">```</span></span></code></pre></div>
<pre class="mermaid align-center zoomable">pie title Pets adopted by volunteers
&#34;Dogs&#34; : 386
&#34;Cats&#34; : 85
&#34;Rats&#34; : 15</pre>
<h3 id="quadrant-chart">Quadrant Chart</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>quadrantChart
</span></span><span class="line"><span class="cl"> title Reach and engagement of campaigns
</span></span><span class="line"><span class="cl"> x-axis Low Reach --&gt; High Reach
</span></span><span class="line"><span class="cl"> y-axis Low Engagement --&gt; High Engagement
</span></span><span class="line"><span class="cl"> quadrant-1 We should expand
</span></span><span class="line"><span class="cl"> quadrant-2 Need to promote
</span></span><span class="line"><span class="cl"> quadrant-3 Re-evaluate
</span></span><span class="line"><span class="cl"> quadrant-4 May be improved
</span></span><span class="line"><span class="cl"> Campaign A: [0.3, 0.6]
</span></span><span class="line"><span class="cl"> Campaign B: [0.45, 0.23]
</span></span><span class="line"><span class="cl"> Campaign C: [0.57, 0.69]
</span></span><span class="line"><span class="cl"> Campaign D: [0.78, 0.34]
</span></span><span class="line"><span class="cl"> Campaign E: [0.40, 0.34]
</span></span><span class="line"><span class="cl"> Campaign F: [0.35, 0.78]
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">quadrantChart
title Reach and engagement of campaigns
x-axis Low Reach --&gt; High Reach
y-axis Low Engagement --&gt; High Engagement
quadrant-1 We should expand
quadrant-2 Need to promote
quadrant-3 Re-evaluate
quadrant-4 May be improved
Campaign A: [0.3, 0.6]
Campaign B: [0.45, 0.23]
Campaign C: [0.57, 0.69]
Campaign D: [0.78, 0.34]
Campaign E: [0.40, 0.34]
Campaign F: [0.35, 0.78]</pre>
<h3 id="requirement-diagram">Requirement Diagram</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>requirementDiagram
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> requirement test_req {
</span></span><span class="line"><span class="cl"> id: 1
</span></span><span class="line"><span class="cl"> text: the test text.
</span></span><span class="line"><span class="cl"> risk: high
</span></span><span class="line"><span class="cl"> verifymethod: test
</span></span><span class="line"><span class="cl"> }
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> element test_entity {
</span></span><span class="line"><span class="cl"> type: simulation
</span></span><span class="line"><span class="cl"> }
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> test_entity - satisfies -&gt; test_req
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -&gt; test_req</pre>
<h3 id="git-graph">Git Graph</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>gitGraph
</span></span><span class="line"><span class="cl"> commit
</span></span><span class="line"><span class="cl"> commit
</span></span><span class="line"><span class="cl"> branch develop
</span></span><span class="line"><span class="cl"> checkout develop
</span></span><span class="line"><span class="cl"> commit
</span></span><span class="line"><span class="cl"> commit
</span></span><span class="line"><span class="cl"> checkout main
</span></span><span class="line"><span class="cl"> merge develop
</span></span><span class="line"><span class="cl"> commit
</span></span><span class="line"><span class="cl"> commit
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">gitGraph
commit
commit
branch develop
checkout develop
commit
commit
checkout main
merge develop
commit
commit</pre>
<h3 id="c4-diagrams">C4 Diagrams</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>C4Context
</span></span><span class="line"><span class="cl"> title System Context diagram for Internet Banking System
</span></span><span class="line"><span class="cl"> Enterprise_Boundary(b0, &#34;BankBoundary0&#34;) {
</span></span><span class="line"><span class="cl"> Person(customerA, &#34;Banking Customer A&#34;, &#34;A customer of the bank, with personal bank accounts.&#34;)
</span></span><span class="line"><span class="cl"> Person(customerB, &#34;Banking Customer B&#34;)
</span></span><span class="line"><span class="cl"> Person_Ext(customerC, &#34;Banking Customer C&#34;, &#34;desc&#34;)
</span></span><span class="line"><span class="cl"> Person(customerD, &#34;Banking Customer D&#34;, &#34;A customer of the bank, &lt;br/&gt; with personal bank accounts.&#34;)
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> System(SystemAA, &#34;Internet Banking System&#34;, &#34;Allows customers to view information about their bank accounts, and make payments.&#34;)
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> Enterprise_Boundary(b1, &#34;BankBoundary&#34;) {
</span></span><span class="line"><span class="cl"> SystemDb_Ext(SystemE, &#34;Mainframe Banking System&#34;, &#34;Stores all of the core banking information about customers, accounts, transactions, etc.&#34;)
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> System_Boundary(b2, &#34;BankBoundary2&#34;) {
</span></span><span class="line"><span class="cl"> System(SystemA, &#34;Banking System A&#34;)
</span></span><span class="line"><span class="cl"> System(SystemB, &#34;Banking System B&#34;, &#34;A system of the bank, with personal bank accounts. next line.&#34;)
</span></span><span class="line"><span class="cl"> }
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> System_Ext(SystemC, &#34;E-mail system&#34;, &#34;The internal Microsoft Exchange e-mail system.&#34;)
</span></span><span class="line"><span class="cl"> SystemDb(SystemD, &#34;Banking System D Database&#34;, &#34;A system of the bank, with personal bank accounts.&#34;)
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> Boundary(b3, &#34;BankBoundary3&#34;, &#34;boundary&#34;) {
</span></span><span class="line"><span class="cl"> SystemQueue(SystemF, &#34;Banking System F Queue&#34;, &#34;A system of the bank.&#34;)
</span></span><span class="line"><span class="cl"> SystemQueue_Ext(SystemG, &#34;Banking System G Queue&#34;, &#34;A system of the bank, with personal bank accounts.&#34;)
</span></span><span class="line"><span class="cl"> }
</span></span><span class="line"><span class="cl"> }
</span></span><span class="line"><span class="cl"> }
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> BiRel(customerA, SystemAA, &#34;Uses&#34;)
</span></span><span class="line"><span class="cl"> BiRel(SystemAA, SystemE, &#34;Uses&#34;)
</span></span><span class="line"><span class="cl"> Rel(SystemAA, SystemC, &#34;Sends e-mails&#34;, &#34;SMTP&#34;)
</span></span><span class="line"><span class="cl"> Rel(SystemC, customerA, &#34;Sends e-mails to&#34;)
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> UpdateElementStyle(customerA, $fontColor=&#34;red&#34;, $bgColor=&#34;grey&#34;, $borderColor=&#34;red&#34;)
</span></span><span class="line"><span class="cl"> UpdateRelStyle(customerA, SystemAA, $textColor=&#34;blue&#34;, $lineColor=&#34;blue&#34;, $offsetX=&#34;5&#34;)
</span></span><span class="line"><span class="cl"> UpdateRelStyle(SystemAA, SystemE, $textColor=&#34;blue&#34;, $lineColor=&#34;blue&#34;, $offsetY=&#34;-10&#34;)
</span></span><span class="line"><span class="cl"> UpdateRelStyle(SystemAA, SystemC, $textColor=&#34;blue&#34;, $lineColor=&#34;blue&#34;, $offsetY=&#34;-40&#34;, $offsetX=&#34;-50&#34;)
</span></span><span class="line"><span class="cl"> UpdateRelStyle(SystemC, customerA, $textColor=&#34;red&#34;, $lineColor=&#34;red&#34;, $offsetX=&#34;-50&#34;, $offsetY=&#34;20&#34;)
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> UpdateLayoutConfig($c4ShapeInRow=&#34;3&#34;, $c4BoundaryInRow=&#34;1&#34;)
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">C4Context
title System Context diagram for Internet Banking System
Enterprise_Boundary(b0, &#34;BankBoundary0&#34;) {
Person(customerA, &#34;Banking Customer A&#34;, &#34;A customer of the bank, with personal bank accounts.&#34;)
Person(customerB, &#34;Banking Customer B&#34;)
Person_Ext(customerC, &#34;Banking Customer C&#34;, &#34;desc&#34;)
Person(customerD, &#34;Banking Customer D&#34;, &#34;A customer of the bank, &lt;br/&gt; with personal bank accounts.&#34;)
System(SystemAA, &#34;Internet Banking System&#34;, &#34;Allows customers to view information about their bank accounts, and make payments.&#34;)
Enterprise_Boundary(b1, &#34;BankBoundary&#34;) {
SystemDb_Ext(SystemE, &#34;Mainframe Banking System&#34;, &#34;Stores all of the core banking information about customers, accounts, transactions, etc.&#34;)
System_Boundary(b2, &#34;BankBoundary2&#34;) {
System(SystemA, &#34;Banking System A&#34;)
System(SystemB, &#34;Banking System B&#34;, &#34;A system of the bank, with personal bank accounts. next line.&#34;)
}
System_Ext(SystemC, &#34;E-mail system&#34;, &#34;The internal Microsoft Exchange e-mail system.&#34;)
SystemDb(SystemD, &#34;Banking System D Database&#34;, &#34;A system of the bank, with personal bank accounts.&#34;)
Boundary(b3, &#34;BankBoundary3&#34;, &#34;boundary&#34;) {
SystemQueue(SystemF, &#34;Banking System F Queue&#34;, &#34;A system of the bank.&#34;)
SystemQueue_Ext(SystemG, &#34;Banking System G Queue&#34;, &#34;A system of the bank, with personal bank accounts.&#34;)
}
}
}
BiRel(customerA, SystemAA, &#34;Uses&#34;)
BiRel(SystemAA, SystemE, &#34;Uses&#34;)
Rel(SystemAA, SystemC, &#34;Sends e-mails&#34;, &#34;SMTP&#34;)
Rel(SystemC, customerA, &#34;Sends e-mails to&#34;)
UpdateElementStyle(customerA, $fontColor=&#34;red&#34;, $bgColor=&#34;grey&#34;, $borderColor=&#34;red&#34;)
UpdateRelStyle(customerA, SystemAA, $textColor=&#34;blue&#34;, $lineColor=&#34;blue&#34;, $offsetX=&#34;5&#34;)
UpdateRelStyle(SystemAA, SystemE, $textColor=&#34;blue&#34;, $lineColor=&#34;blue&#34;, $offsetY=&#34;-10&#34;)
UpdateRelStyle(SystemAA, SystemC, $textColor=&#34;blue&#34;, $lineColor=&#34;blue&#34;, $offsetY=&#34;-40&#34;, $offsetX=&#34;-50&#34;)
UpdateRelStyle(SystemC, customerA, $textColor=&#34;red&#34;, $lineColor=&#34;red&#34;, $offsetX=&#34;-50&#34;, $offsetY=&#34;20&#34;)
UpdateLayoutConfig($c4ShapeInRow=&#34;3&#34;, $c4BoundaryInRow=&#34;1&#34;)</pre>
<h3 id="mindmaps">Mindmaps</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>mindmap
</span></span><span class="line"><span class="cl"> root((mindmap))
</span></span><span class="line"><span class="cl"> Origins
</span></span><span class="line"><span class="cl"> Long history
</span></span><span class="line"><span class="cl"> ::icon(fa fa-book)
</span></span><span class="line"><span class="cl"> Popularisation
</span></span><span class="line"><span class="cl"> British popular psychology author Tony Buzan
</span></span><span class="line"><span class="cl"> Research
</span></span><span class="line"><span class="cl"> On effectiveness&lt;br/&gt;and features
</span></span><span class="line"><span class="cl"> On Automatic creation
</span></span><span class="line"><span class="cl"> Uses
</span></span><span class="line"><span class="cl"> Creative techniques
</span></span><span class="line"><span class="cl"> Strategic planning
</span></span><span class="line"><span class="cl"> Argument mapping
</span></span><span class="line"><span class="cl"> Tools
</span></span><span class="line"><span class="cl"> Pen and paper
</span></span><span class="line"><span class="cl"> Mermaid
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">mindmap
root((mindmap))
Origins
Long history
::icon(fa fa-book)
Popularisation
British popular psychology author Tony Buzan
Research
On effectiveness&lt;br/&gt;and features
On Automatic creation
Uses
Creative techniques
Strategic planning
Argument mapping
Tools
Pen and paper
Mermaid</pre>
<h3 id="timeline">Timeline</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>timeline
</span></span><span class="line"><span class="cl"> title History of Social Media Platform
</span></span><span class="line"><span class="cl"> 2002 : LinkedIn
</span></span><span class="line"><span class="cl"> 2004 : Facebook
</span></span><span class="line"><span class="cl"> : Google
</span></span><span class="line"><span class="cl"> 2005 : Youtube
</span></span><span class="line"><span class="cl"> 2006 : Twitter
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">timeline
title History of Social Media Platform
2002 : LinkedIn
2004 : Facebook
: Google
2005 : Youtube
2006 : Twitter</pre>
<h3 id="sankey">Sankey</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>sankey-beta
</span></span><span class="line"><span class="cl"> %% source,target,value
</span></span><span class="line"><span class="cl"> Electricity grid,Over generation / exports,104.453
</span></span><span class="line"><span class="cl"> Electricity grid,Heating and cooling - homes,113.726
</span></span><span class="line"><span class="cl"> Electricity grid,H2 conversion,27.14
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">sankey-beta
%% source,target,value
Electricity grid,Over generation / exports,104.453
Electricity grid,Heating and cooling - homes,113.726
Electricity grid,H2 conversion,27.14</pre>
<h3 id="xychart">XYChart</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>xychart-beta
</span></span><span class="line"><span class="cl"> title &#34;Sales Revenue&#34;
</span></span><span class="line"><span class="cl"> x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
</span></span><span class="line"><span class="cl"> y-axis &#34;Revenue (in $)&#34; 4000 --&gt; 11000
</span></span><span class="line"><span class="cl"> bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
</span></span><span class="line"><span class="cl"> line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">xychart-beta
title &#34;Sales Revenue&#34;
x-axis [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec]
y-axis &#34;Revenue (in $)&#34; 4000 --&gt; 11000
bar [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]
line [5000, 6000, 7500, 8200, 9500, 10500, 11000, 10200, 9200, 8500, 7000, 6000]</pre>
<h3 id="block-diagram">Block Diagram</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>block-beta
</span></span><span class="line"><span class="cl"> columns 1
</span></span><span class="line"><span class="cl"> db((&#34;DB&#34;))
</span></span><span class="line"><span class="cl"> blockArrowId6&lt;[&#34;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#34;]&gt;(down)
</span></span><span class="line"><span class="cl"> block:ID
</span></span><span class="line"><span class="cl"> A
</span></span><span class="line"><span class="cl"> B[&#34;A wide one in the middle&#34;]
</span></span><span class="line"><span class="cl"> C
</span></span><span class="line"><span class="cl"> end
</span></span><span class="line"><span class="cl"> space
</span></span><span class="line"><span class="cl"> D
</span></span><span class="line"><span class="cl"> ID --&gt; D
</span></span><span class="line"><span class="cl"> C --&gt; D
</span></span><span class="line"><span class="cl"> style B fill:#969,stroke:#333,stroke-width:4px
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">block-beta
columns 1
db((&#34;DB&#34;))
blockArrowId6&lt;[&#34;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#34;]&gt;(down)
block:ID
A
B[&#34;A wide one in the middle&#34;]
C
end
space
D
ID --&gt; D
C --&gt; D
style B fill:#969,stroke:#333,stroke-width:4px</pre>
<h3 id="packet">Packet</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>---
</span></span><span class="line"><span class="cl">title: &#34;TCP Packet&#34;
</span></span><span class="line"><span class="cl">---
</span></span><span class="line"><span class="cl">packet-beta
</span></span><span class="line"><span class="cl"> 0-15: &#34;Source Port&#34;
</span></span><span class="line"><span class="cl"> 16-31: &#34;Destination Port&#34;
</span></span><span class="line"><span class="cl"> 32-63: &#34;Sequence Number&#34;
</span></span><span class="line"><span class="cl"> 64-95: &#34;Acknowledgment Number&#34;
</span></span><span class="line"><span class="cl"> 96-99: &#34;Data Offset&#34;
</span></span><span class="line"><span class="cl"> 100-105: &#34;Reserved&#34;
</span></span><span class="line"><span class="cl"> 106: &#34;URG&#34;
</span></span><span class="line"><span class="cl"> 107: &#34;ACK&#34;
</span></span><span class="line"><span class="cl"> 108: &#34;PSH&#34;
</span></span><span class="line"><span class="cl"> 109: &#34;RST&#34;
</span></span><span class="line"><span class="cl"> 110: &#34;SYN&#34;
</span></span><span class="line"><span class="cl"> 111: &#34;FIN&#34;
</span></span><span class="line"><span class="cl"> 112-127: &#34;Window&#34;
</span></span><span class="line"><span class="cl"> 128-143: &#34;Checksum&#34;
</span></span><span class="line"><span class="cl"> 144-159: &#34;Urgent Pointer&#34;
</span></span><span class="line"><span class="cl"> 160-191: &#34;(Options and Padding)&#34;
</span></span><span class="line"><span class="cl"> 192-255: &#34;Data (variable length)&#34;
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">---
title: &#34;TCP Packet&#34;
---
packet-beta
0-15: &#34;Source Port&#34;
16-31: &#34;Destination Port&#34;
32-63: &#34;Sequence Number&#34;
64-95: &#34;Acknowledgment Number&#34;
96-99: &#34;Data Offset&#34;
100-105: &#34;Reserved&#34;
106: &#34;URG&#34;
107: &#34;ACK&#34;
108: &#34;PSH&#34;
109: &#34;RST&#34;
110: &#34;SYN&#34;
111: &#34;FIN&#34;
112-127: &#34;Window&#34;
128-143: &#34;Checksum&#34;
144-159: &#34;Urgent Pointer&#34;
160-191: &#34;(Options and Padding)&#34;
192-255: &#34;Data (variable length)&#34;</pre>
<h3 id="architecture">Architecture</h3>
<div class="highlight wrap-code"><pre tabindex="0" class="chroma"><code class="language-md" data-lang="md"><span class="line"><span class="cl"><span class="s">```mermaid
</span></span></span><span class="line"><span class="cl"><span class="s"></span>architecture-beta
</span></span><span class="line"><span class="cl"> group api(cloud)[API]
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> service db(database)[Database] in api
</span></span><span class="line"><span class="cl"> service disk1(disk)[Storage] in api
</span></span><span class="line"><span class="cl"> service disk2(disk)[Storage] in api
</span></span><span class="line"><span class="cl"> service server(server)[Server] in api
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> db:L -- R:server
</span></span><span class="line"><span class="cl"> disk1:T -- B:server
</span></span><span class="line"><span class="cl"> disk2:T -- B:db
</span></span><span class="line"><span class="cl"><span class="s">```</span></span></span></code></pre></div>
<pre class="mermaid align-center zoomable">architecture-beta
group api(cloud)[API]
service db(database)[Database] in api
service disk1(disk)[Storage] in api
service disk2(disk)[Storage] in api
service server(server)[Server] in api
db:L -- R:server
disk1:T -- B:server
disk2:T -- B:db</pre>
<footer class="footline">
<div class="R-taxonomy taxonomy-categories cstyle" title="Categories" style="--VARIABLE-TAGS-BG-color: var(--INTERNAL-TAG-BG-color);">
<i class="fa-fw fas fa-layer-group"></i>
<ul>
<li><a class="term-link" href="/hugo-theme-relearn/categories/howto/index.html">Howto</a></li>
<li><a class="term-link" href="/hugo-theme-relearn/categories/reference/index.html">Reference</a></li>
</ul>
</div>
</footer>
</article>
</div>
</main>
</div>
<script src="/hugo-theme-relearn/js/clipboard.min.js?1728829597" defer></script>
<script src="/hugo-theme-relearn/js/perfect-scrollbar.min.js?1728829597" defer></script>
<script src="/hugo-theme-relearn/js/d3/d3-color.min.js?1728829597" defer></script>
<script src="/hugo-theme-relearn/js/d3/d3-dispatch.min.js?1728829597" defer></script>
<script src="/hugo-theme-relearn/js/d3/d3-drag.min.js?1728829597" defer></script>
<script src="/hugo-theme-relearn/js/d3/d3-ease.min.js?1728829597" defer></script>
<script src="/hugo-theme-relearn/js/d3/d3-interpolate.min.js?1728829597" defer></script>
<script src="/hugo-theme-relearn/js/d3/d3-selection.min.js?1728829597" defer></script>
<script src="/hugo-theme-relearn/js/d3/d3-timer.min.js?1728829597" defer></script>
<script src="/hugo-theme-relearn/js/d3/d3-transition.min.js?1728829597" defer></script>
<script src="/hugo-theme-relearn/js/d3/d3-zoom.min.js?1728829597" defer></script>
<script src="/hugo-theme-relearn/js/js-yaml.min.js?1728829597" defer></script>
<script src="/hugo-theme-relearn/js/mermaid.min.js?1728829597" defer></script>
<script>
window.themeUseMermaid = JSON.parse("{ \"securityLevel\": \"loose\" }");
</script>
<script src="/hugo-theme-relearn/js/theme.js?1728829597" defer></script>
</body>
</html>