mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-11-04 04:44:08 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			107 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			107 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<!doctype html>
 | 
						|
<html lang="en">
 | 
						|
  <head>
 | 
						|
    <meta charset="utf-8" />
 | 
						|
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
 | 
						|
    <title>Mindmap Mermaid Quick Test Page</title>
 | 
						|
    <link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
 | 
						|
    <style>
 | 
						|
      div.mermaid {
 | 
						|
        /* font-family: 'trebuchet ms', verdana, arial; */
 | 
						|
        font-family: 'Courier New', Courier, monospace !important;
 | 
						|
      }
 | 
						|
    </style>
 | 
						|
  </head>
 | 
						|
 | 
						|
  <body>
 | 
						|
    <h1>Mindmap diagram demo</h1>
 | 
						|
    <pre class="mermaid">
 | 
						|
        mindmap
 | 
						|
        root
 | 
						|
            child1((Circle))
 | 
						|
                grandchild 1
 | 
						|
                grandchild 2
 | 
						|
            child2(Round rectangle)
 | 
						|
                grandchild 3
 | 
						|
                grandchild 4
 | 
						|
            child3[Square]
 | 
						|
                grandchild 5
 | 
						|
                ::icon(mdi mdi-fire)
 | 
						|
                gc6((grand<br/>child 6))
 | 
						|
                ::icon(mdi mdi-fire)
 | 
						|
                gc7((grand<br/>grand<br/>child 8))
 | 
						|
    </pre>
 | 
						|
 | 
						|
    <h2>Mindmap with root wrapping text and a shape</h2>
 | 
						|
    <pre class="mermaid">
 | 
						|
        mindmap
 | 
						|
            root[A root with a long text that wraps to keep the node size in check]
 | 
						|
    </pre>
 | 
						|
 | 
						|
    <script type="module">
 | 
						|
      import mermaid from './mermaid.esm.mjs';
 | 
						|
 | 
						|
      const ALLOWED_TAGS = [
 | 
						|
        'a',
 | 
						|
        'b',
 | 
						|
        'blockquote',
 | 
						|
        'br',
 | 
						|
        'dd',
 | 
						|
        'div',
 | 
						|
        'dl',
 | 
						|
        'dt',
 | 
						|
        'em',
 | 
						|
        'foreignObject',
 | 
						|
        'h1',
 | 
						|
        'h2',
 | 
						|
        'h3',
 | 
						|
        'h4',
 | 
						|
        'h5',
 | 
						|
        'h6',
 | 
						|
        'h7',
 | 
						|
        'h8',
 | 
						|
        'hr',
 | 
						|
        'i',
 | 
						|
        'li',
 | 
						|
        'ul',
 | 
						|
        'ol',
 | 
						|
        'p',
 | 
						|
        'pre',
 | 
						|
        'span',
 | 
						|
        'strike',
 | 
						|
        'strong',
 | 
						|
        'table',
 | 
						|
        'tbody',
 | 
						|
        'td',
 | 
						|
        'tfoot',
 | 
						|
        'th',
 | 
						|
        'thead',
 | 
						|
        'tr',
 | 
						|
      ];
 | 
						|
      mermaid.parseError = function (err, hash) {
 | 
						|
        // console.error('Mermaid error: ', err);
 | 
						|
      };
 | 
						|
      mermaid.initialize({
 | 
						|
        theme: 'base',
 | 
						|
        startOnLoad: true,
 | 
						|
        logLevel: 0,
 | 
						|
        flowchart: {
 | 
						|
          useMaxWidth: false,
 | 
						|
          htmlLabels: true,
 | 
						|
        },
 | 
						|
        gantt: {
 | 
						|
          useMaxWidth: false,
 | 
						|
        },
 | 
						|
        useMaxWidth: false,
 | 
						|
      });
 | 
						|
      function callback() {
 | 
						|
        alert('It worked');
 | 
						|
      }
 | 
						|
      mermaid.parseError = function (err, hash) {
 | 
						|
        console.error('In parse error:');
 | 
						|
        console.error(err);
 | 
						|
      };
 | 
						|
    </script>
 | 
						|
  </body>
 | 
						|
</html>
 |