mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 07:19:41 +02:00
183 lines
5.3 KiB
HTML
183 lines
5.3 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://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"
|
|
rel="stylesheet"
|
|
/>
|
|
<link
|
|
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
|
|
rel="stylesheet"
|
|
/>
|
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
<link
|
|
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap"
|
|
rel="stylesheet"
|
|
/>
|
|
<link
|
|
href="https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Kalam:wght@300;400;700&family=Rubik+Mono+One&display=swap"
|
|
rel="stylesheet"
|
|
/>
|
|
<link
|
|
href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Rubik+Mono+One&display=swap"
|
|
rel="stylesheet"
|
|
/>
|
|
|
|
<style>
|
|
body {
|
|
/* background: rgb(221, 208, 208); */
|
|
/* background: #333; */
|
|
font-family: 'Arial';
|
|
/* font-size: 18px !important; */
|
|
}
|
|
|
|
h1 {
|
|
color: grey;
|
|
}
|
|
|
|
.mermaid2 {
|
|
display: none;
|
|
}
|
|
|
|
.mermaid svg {
|
|
/* font-size: 18px !important; */
|
|
|
|
/* background-color: #efefef;
|
|
background-image: radial-gradient(#fff 51%, transparent 91%),
|
|
radial-gradient(#fff 51%, transparent 91%);
|
|
background-size: 20px 20px;
|
|
background-position:
|
|
0 0,
|
|
10px 10px;
|
|
background-repeat: repeat; */
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<pre id="diagram4" class="mermaid">
|
|
flowchart TB
|
|
%% ['triangle', 'slopedRect', 'tiltedCylinder', 'flippedTriangle', 'hourglass'];
|
|
node_0
|
|
noed_00 --> node_1@{ shape: triangle, label: "This is **bold** <br>and <strong>strong</strong>" }@
|
|
style node_1 fill:#f9f,stroke:#333,stroke-width:4px
|
|
|
|
node_2@{ shape: slopedRect }@
|
|
node_3@{ shape: tiltedCylinder }@
|
|
style node_0 fill:#f9f,stroke:#333,stroke-width:4px
|
|
style node_3 fill:#f9f,stroke:#333,stroke-width:4px
|
|
classDef customClazz fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
|
|
node_2:::customClazz
|
|
node_00:::customClazz
|
|
|
|
|
|
</pre>
|
|
<pre id="diagram4" class="mermaid2">
|
|
flowchart RL
|
|
n0 --> n00@{ shape: taggedRect, label: 'new shape' }@
|
|
style n00 fill:#f9f,stroke:#333,stroke-width:4px
|
|
n1 --> n11@{ shape: multiRect, label: 'new shape' }@
|
|
style n11 fill:#f9f,stroke:#333,stroke-width:4px"
|
|
</pre
|
|
>
|
|
<pre id="diagram4" class="mermaid2">
|
|
flowchart
|
|
|
|
%% without shape or label
|
|
node_0
|
|
%% with shape but no label
|
|
node_3@{ shape: triangle }@
|
|
|
|
%% with shape and label
|
|
node_1@{ shape: triangle, label: "This is a label" }@
|
|
|
|
%% with shape and long label
|
|
node_2@{ shape: triangle, label: "This is a long long long long long long label" }@
|
|
|
|
%% with shape and label && htmlLabel true
|
|
node_4@{ shape: triangle, label: "This is a label", htmlLabel: true }@
|
|
|
|
%% with shape and label && htmlLabel false
|
|
node_5@{ shape: triangle, label: "This is a label", htmlLabel: false }@
|
|
|
|
%% with shape and label handDrawn look ON
|
|
node_6@{ shape: triangle, label: "This is a label", handDrawn: true }@
|
|
|
|
|
|
|
|
</pre
|
|
>
|
|
<pre id="diagram4" class="mermaid2">
|
|
flowchart
|
|
|
|
A{"This is a label"}@{
|
|
shape: document,
|
|
icon: car,
|
|
labelAlt: "This is another label
|
|
**bit**",
|
|
path: [1,2,3]
|
|
}@
|
|
D@{ shape: roundedRect, icon: car
|
|
}@
|
|
|
|
A --> B & D
|
|
A@{
|
|
label: "This is the final label {}"
|
|
icon: car
|
|
}@ --> B
|
|
A(This is a label)
|
|
</pre
|
|
>
|
|
|
|
<script type="module">
|
|
import mermaid from './mermaid.esm.mjs';
|
|
import { layouts } from './mermaid-layout-elk.esm.mjs';
|
|
mermaid.registerLayoutLoaders(layouts);
|
|
mermaid.parseError = function (err, hash) {
|
|
console.error('Mermaid error: ', err);
|
|
};
|
|
window.callback = function () {
|
|
alert('A callback was triggered');
|
|
};
|
|
mermaid.initialize({
|
|
// theme: 'base',
|
|
// handdrawnSeed: 12,
|
|
look: 'classic',
|
|
// 'elk.nodePlacement.strategy': 'NETWORK_SIMPLEX',
|
|
'elk.nodePlacement.strategy': 'SIMPLE',
|
|
// 'elk.nodePlacement.strategy': 'LAYERED',
|
|
// 'elk.mergeEdges': true,
|
|
// layout: 'dagre',
|
|
layout: 'elk',
|
|
// layout: 'fixed',
|
|
// htmlLabels: false,
|
|
flowchart: { titleTopMargin: 10, padding: 8 },
|
|
// fontFamily: 'Caveat',
|
|
fontFamily: 'Kalam',
|
|
// fontFamily: 'courier',
|
|
sequence: {
|
|
actorFontFamily: 'courier',
|
|
noteFontFamily: 'courier',
|
|
messageFontFamily: 'courier',
|
|
},
|
|
fontSize: 12,
|
|
logLevel: 0,
|
|
securityLevel: 'loose',
|
|
});
|
|
function callback() {
|
|
alert('It worked');
|
|
}
|
|
mermaid.parseError = function (err, hash) {
|
|
console.error('In parse error:');
|
|
console.error(err);
|
|
};
|
|
</script>
|
|
</body>
|
|
</html>
|