-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
59 lines (57 loc) · 1.82 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<html>
<body>
<div
style="
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
font-family: Arial, Helvetica, sans-serif;
"
>
<h1 style="margin: 0px">Encounter Hierarchy</h1>
<a
class="github-button"
href="https://github.com/loathers/encounter/fork"
data-color-scheme="no-preference: light; light: light; dark: dark;"
data-icon="octicon-repo-forked"
data-size="large"
aria-label="Fork loathers/encounter on GitHub"
>Fork the code powering this flowchart on GitHub</a
>
<div
id="container"
style="
align-self: stretch;
flex-grow: 1;
border: 1px solid black;
cursor: move;
"
></div>
</div>
<script src="https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.5.0/dist/svg-pan-zoom.min.js"></script>
<script async defer type="module">
import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs";
mermaid.initialize({ startOnLoad: false });
const request = await fetch(
"https://raw.githubusercontent.com/loathers/encounter/main/hierarchy.mermaid",
);
const markup = await request.text();
const container = document.getElementById("container");
const { svg } = await mermaid.render("chart", markup);
container.innerHTML = svg;
const chart = document.getElementById("chart");
chart.style.width = "100%";
chart.style.height = "100%";
const spz = svgPanZoom("#chart", {
zoomEnabled: true,
controlIconsEnabled: true,
fit: true,
center: true,
});
spz.resize();
</script>
<script async defer src="https://buttons.github.io/buttons.js"></script>
</body>
</html>