mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-11-04 12:54:08 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			149 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			149 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<html>
 | 
						|
  <head>
 | 
						|
    <link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
 | 
						|
    <link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet" />
 | 
						|
    <link
 | 
						|
      rel="stylesheet"
 | 
						|
      href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
 | 
						|
    />
 | 
						|
    <link
 | 
						|
      href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
 | 
						|
      rel="stylesheet"
 | 
						|
    />
 | 
						|
    <style>
 | 
						|
      body {
 | 
						|
        /* background: rgb(221, 208, 208); */
 | 
						|
        /* background:#333; */
 | 
						|
        font-family: 'Arial';
 | 
						|
      }
 | 
						|
      h1 {
 | 
						|
        color: #333;
 | 
						|
        font-size: 20px;
 | 
						|
        text-decoration: underline;
 | 
						|
      }
 | 
						|
      .mermaid2 {
 | 
						|
        display: none;
 | 
						|
      }
 | 
						|
      .dark {
 | 
						|
        background: #333;
 | 
						|
      }
 | 
						|
      .dark h1 {
 | 
						|
        color: #f4f4f4;
 | 
						|
      }
 | 
						|
      .size {
 | 
						|
        width: 33%;
 | 
						|
        height: 250px;
 | 
						|
      }
 | 
						|
    </style>
 | 
						|
  </head>
 | 
						|
  <body>
 | 
						|
    <div class="flex flex-wrap">
 | 
						|
      <div class="size">
 | 
						|
        <h1>Default</h1>
 | 
						|
        <pre class="mermaid">
 | 
						|
  %%{init: { 'logLevel': 0, 'theme': 'default'} }%%
 | 
						|
  graph TD
 | 
						|
            A(Start) --> B[/Another/]
 | 
						|
            A[/Another/] --> C[End]
 | 
						|
            subgraph section
 | 
						|
              B
 | 
						|
              C
 | 
						|
            end
 | 
						|
        </pre>
 | 
						|
      </div>
 | 
						|
      <div class="size">
 | 
						|
        <h1>Forest</h1>
 | 
						|
        <pre class="mermaid">
 | 
						|
  %%{init: { 'logLevel': 1, 'theme': 'forest'} }%%
 | 
						|
  graph TD
 | 
						|
            A(Start) --> B[/Another/]
 | 
						|
            A[/Another/] --> C[End]
 | 
						|
            subgraph section
 | 
						|
              B
 | 
						|
              C
 | 
						|
            end
 | 
						|
        </pre>
 | 
						|
      </div>
 | 
						|
      <div class="size">
 | 
						|
        <h1>Neutral</h1>
 | 
						|
        <pre class="mermaid">
 | 
						|
        %%{init: { 'logLevel': 1, 'theme': 'neutral'} }%%
 | 
						|
  graph TD
 | 
						|
            A(Start) --> B[/Another/]
 | 
						|
            A[/Another/] --> C[End]
 | 
						|
            subgraph section
 | 
						|
              B
 | 
						|
              C
 | 
						|
            end
 | 
						|
        </pre>
 | 
						|
      </div>
 | 
						|
      <div class="size dark">
 | 
						|
        <h1>Dark</h1>
 | 
						|
        <pre class="mermaid">
 | 
						|
        %%{init: { 'logLevel': 1, 'theme': 'dark'} }%%
 | 
						|
  graph TD
 | 
						|
            A(Start) --> B[/Another/]
 | 
						|
            A[/Another/] --> C[End]
 | 
						|
            subgraph section
 | 
						|
              B
 | 
						|
              C
 | 
						|
            end
 | 
						|
        </pre>
 | 
						|
      </div>
 | 
						|
      <div class="size">
 | 
						|
        <h1>Base with overriding themeVariable</h1>
 | 
						|
        <pre class="mermaid">
 | 
						|
        %%{init: { 'theme': 'base', 'themeVariables':{ 'primaryColor': '#ff0000'}}}%%
 | 
						|
 | 
						|
  graph TD
 | 
						|
            A(Start) --> B[/Another/]
 | 
						|
            A[/Another/] --> C[End]
 | 
						|
            subgraph section
 | 
						|
              B
 | 
						|
              C
 | 
						|
            end
 | 
						|
        </pre>
 | 
						|
      </div>
 | 
						|
      <div class="size">
 | 
						|
        <h1>Nothing set, should be Default</h1>
 | 
						|
        <pre class="mermaid">
 | 
						|
        %%{init: { 'logLevel': 1} }%%
 | 
						|
 | 
						|
  graph TD
 | 
						|
            A(Start) --> B[/Another/]
 | 
						|
            A[/Another/] --> C[End]
 | 
						|
            subgraph section
 | 
						|
              B
 | 
						|
              C
 | 
						|
            end
 | 
						|
        </pre>
 | 
						|
      </div>
 | 
						|
    </div>
 | 
						|
 | 
						|
    <script src="./mermaid.js"></script>
 | 
						|
    <script>
 | 
						|
      mermaid.parseError = function (err, hash) {
 | 
						|
        // console.error('Mermaid error: ', err);
 | 
						|
      };
 | 
						|
      mermaid.initialize({
 | 
						|
        // theme: 'dark',
 | 
						|
        // theme: 'dark',
 | 
						|
        // arrowMarkerAbsolute: true,
 | 
						|
        // themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
 | 
						|
        logLevel: 0,
 | 
						|
        // flowchart: { useMaxWidth: true },
 | 
						|
        graph: { curve: 'cardinal', htmlLabels: false },
 | 
						|
        // gantt: { axisFormat: '%m/%d/%Y' },
 | 
						|
        sequence: { actorMargin: 50, showSequenceNumbers: true },
 | 
						|
        // sequenceDiagram: { actorMargin: 300 } // deprecated
 | 
						|
        fontFamily: '"arial", sans-serif',
 | 
						|
        curve: 'cardinal',
 | 
						|
        securityLevel: 'strict',
 | 
						|
      });
 | 
						|
      function callback() {
 | 
						|
        alert('It worked');
 | 
						|
      }
 | 
						|
    </script>
 | 
						|
  </body>
 | 
						|
</html>
 |