mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
139 lines
4.1 KiB
HTML
139 lines
4.1 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"
|
|
/>
|
|
<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;
|
|
}
|
|
.malware {
|
|
position: fixed;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 150px;
|
|
background: red;
|
|
color: black;
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
font-family: monospace;
|
|
font-size: 72px;
|
|
}
|
|
/* tspan {
|
|
font-size: 6px !important;
|
|
} */
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre style="background:black;color:white">
|
|
swimlane LR
|
|
subgraph "`one`"
|
|
start -- l1 --> cat --> rat
|
|
end
|
|
subgraph "`two`"
|
|
monkey -- l2 --> dog --> done2
|
|
end
|
|
subgraph "`three`"
|
|
cow --> horse --> done3
|
|
cow --> sheep --> done3
|
|
end
|
|
cat --> monkey
|
|
cow --> dog
|
|
</pre>
|
|
<pre id="diagram" class="mermaid">
|
|
swimlane LR
|
|
subgraph "`one`"
|
|
start -- l1 --> cat --> rat
|
|
end
|
|
subgraph "`two`"
|
|
monkey -- l2 --> dog --> done2
|
|
end
|
|
subgraph "`three`"
|
|
cow --> horse --> done3
|
|
cow --> sheep --> done3
|
|
end
|
|
cat --> monkey
|
|
cow --> dog
|
|
sheep --> dog
|
|
|
|
</pre>
|
|
|
|
|
|
monkey dog --> cat monkey --> cow -->
|
|
<!-- <div id="cy"></div> -->
|
|
<!-- <script src="http://localhost:9000/packages/mermaid-mindmap/dist/mermaid-mindmap-detector.js"></script> -->
|
|
<!-- <script src="./mermaid-example-diagram-detector.js"></script> -->
|
|
<!-- <script src="//cdn.jsdelivr.net/npm/mermaid@9.1.7/dist/mermaid.min.js"></script> -->
|
|
<!-- <script src="./mermaid.js"></script> -->
|
|
|
|
<script type="module">
|
|
// import mindmap from '../../packages/mermaid-mindmap/src/detector';
|
|
// import example from '../../packages/mermaid-example-diagram/src/mermaid-example-diagram.core.mjs';
|
|
import mermaid from './mermaid.esm.mjs';
|
|
// await mermaid.registerExternalDiagrams([example]);
|
|
mermaid.parseError = function (err, hash) {
|
|
// console.error('Mermaid error: ', err);
|
|
};
|
|
mermaid.initialize({
|
|
// theme: 'forest',
|
|
startOnLoad: true,
|
|
logLevel: 0,
|
|
flowchart: {
|
|
// defaultRenderer: 'elk',
|
|
useMaxWidth: false,
|
|
// htmlLabels: false,
|
|
htmlLabels: true,
|
|
},
|
|
// htmlLabels: false,
|
|
gantt: {
|
|
useMaxWidth: false,
|
|
},
|
|
useMaxWidth: false,
|
|
});
|
|
function callback() {
|
|
alert('It worked');
|
|
}
|
|
mermaid.parseError = function (err, hash) {
|
|
console.error('In parse error:');
|
|
console.error(err);
|
|
};
|
|
// mermaid.test1('first_slow', 1200).then((r) => console.info(r));
|
|
// mermaid.test1('second_fast', 200).then((r) => console.info(r));
|
|
// mermaid.test1('third_fast', 200).then((r) => console.info(r));
|
|
// mermaid.test1('forth_slow', 1200).then((r) => console.info(r));
|
|
</script>
|
|
</body>
|
|
</html>
|