-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
164 lines (162 loc) · 5.55 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!--Icons-->
<link
rel="icon"
type="image/svg+xml"
href="/logo-dark.svg"
media="(prefers-color-scheme: light)"
/>
<link
rel="icon"
type="image/svg+xml"
href="/logo-light.svg"
media="(prefers-color-scheme: dark)"
/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Binary Tree Visualization</title>
<script defer type="module" src="./src/scripts/index.ts"></script>
<link rel="stylesheet" href="./src/styles.scss" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css"
integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
</head>
<body>
<div id="root">
<div id="inspector">
<label id="tree-input-label" for="tree-input">Tree Input</label>
<input id="tree-input" placeholder="Tree input" />
<button class="icon-button" id="recenter-button">
<i class="fa-solid fa-arrows-to-dot"></i>
</button>
<button class="icon-button" id="info-button">
<i class="fa-solid fa-circle-info"></i>
</button>
</div>
<div id="scene">
<div id="scroll-area">
<div id="grid"></div>
</div>
<div id="error-overlay" class="hide">
<p id="error-title"></p>
<p id="error-message"></p>
</div>
<div id="info-overlay" class="hide">
<div id="info-card">
<div id="info-card-heading">
<div class="row">
<img
src="./src/assets/icon.png"
alt="Application icon"
width="18px"
/>
<p>Binary Tree Visualization</p>
</div>
<button class="icon-button" id="info-close-button">
<i class="fa-solid fa-circle-xmark"></i>
</button>
</div>
<div id="info-card-body">
<p class="heading">
<b>Tree Input</b>
</p>
<p>
Tree input is a string that represents the structure of the
binary tree. It consists of space-separated 32-bit signed
integer values and the alphabet 'N' (case-insensitive) indicates
a <b>NULL</b> node.
</p>
<br />
<p>
The values are essentially the result of level order traversal
of the resulting binary tree. To indicate a null node the
alphabet 'N' (case-insensitive) is used. Null nodes have no
children so they are skipped when rendering the next level
(children of the current level) of the binary tree.
</p>
<br />
<p>Some Examples:</p>
<br />
<div id="examples">
<div class="example-stack">
<img
class="example-img"
src="./src/assets/example0.png"
alt="First Example"
/>
<p>1 2 3</p>
</div>
<div class="example-stack">
<img
class="example-img"
src="./src/assets/example1.png"
alt="Second Example"
/>
<p>1 N 3</p>
</div>
<div class="example-stack">
<img
class="example-img"
src="./src/assets/example2.png"
alt="Third Example"
/>
<p>1 N 3 4 5</p>
</div>
</div>
<br />
<br />
<p class="heading">
<b>Hover on node</b>
</p>
<div id="hover-example-container">
<p>
Sometimes, the value of a node is too large to fit inside the
node. <b>Hover</b> on any node to expand it and make the full
value visible. In mobile devices, click on a node to expand
it.
</p>
<img src="./src/assets/hover.gif" alt="Hover preview" />
</div>
<br />
<br />
<p class="heading">
<i class="fa-solid fa-arrows-to-dot"></i>
<b>Recenter Button</b>
</p>
<p>
When the tree is generated, press this button to scroll the view
to the root node if lost.
</p>
<br />
<br />
<p class="heading">
<b>About the project</b>
</p>
<p>
Here is the
<a
href="https://github.com/kay-af/binary-tree-visualization"
target="_blank"
rel="noreferer noopener"
class="github-anchor"
>
<i class="fa-brands fa-github"></i>
</a>
repository of the project. If you like my work, please leave a
star ⭐️
</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>