mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
Adding treemap
This commit is contained in:
86
demos/treemap.html
Normal file
86
demos/treemap.html
Normal file
@@ -0,0 +1,86 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Mermaid Treemap Diagram Demo</title>
|
||||
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Montserrat', sans-serif;
|
||||
margin: 0 auto;
|
||||
max-width: 900px;
|
||||
padding: 20px;
|
||||
}
|
||||
.mermaid {
|
||||
margin: 30px 0;
|
||||
}
|
||||
h1,
|
||||
h2 {
|
||||
color: #333;
|
||||
}
|
||||
pre {
|
||||
background-color: #f5f5f5;
|
||||
padding: 15px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Treemap Diagram Demo</h1>
|
||||
<p>This is a demo of the new treemap diagram type in Mermaid.</p>
|
||||
|
||||
<h2>Basic Treemap Example</h2>
|
||||
<pre><code>
|
||||
treemap
|
||||
"Root"
|
||||
"Branch 1"
|
||||
"Leaf 1.1": 10
|
||||
"Leaf 1.2": 15
|
||||
"Branch 2"
|
||||
"Leaf 2.1": 20
|
||||
"Leaf 2.2": 25
|
||||
"Leaf 2.3": 30
|
||||
</code></pre>
|
||||
<div class="mermaid">
|
||||
treemap Root Branch 1 Leaf 1.1: 10 Leaf 1.2: 15 Branch 2 Leaf 2.1: 20 Leaf 2.2: 25 Leaf 2.3:
|
||||
30
|
||||
</div>
|
||||
|
||||
<h2>Technology Stack Treemap Example</h2>
|
||||
<pre><code>
|
||||
treemap
|
||||
Technology Stack
|
||||
Frontend
|
||||
React: 35
|
||||
CSS: 15
|
||||
HTML: 10
|
||||
Backend
|
||||
Node.js: 25
|
||||
Express: 10
|
||||
MongoDB: 15
|
||||
DevOps
|
||||
Docker: 10
|
||||
Kubernetes: 15
|
||||
CI/CD: 5
|
||||
</code></pre>
|
||||
<div class="mermaid">
|
||||
treemap Technology Stack Frontend React: 35 CSS: 15 HTML: 10 Backend Node.js: 25 Express: 10
|
||||
MongoDB: 15 DevOps Docker: 10 Kubernetes: 15 CI/CD: 5
|
||||
</div>
|
||||
|
||||
<script type="module">
|
||||
import mermaid from '../dist/mermaid.esm.min.mjs';
|
||||
mermaid.initialize({
|
||||
startOnLoad: true,
|
||||
theme: 'default',
|
||||
securityLevel: 'loose',
|
||||
treemap: {
|
||||
useMaxWidth: true,
|
||||
padding: 15,
|
||||
showValues: true,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user