-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
158 lines (154 loc) · 5.74 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Network Models Phase Transition</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.19.0/cytoscape.min.css"
/>
<link rel="stylesheet" href="index.css" />
<script src="https://unpkg.com/webcola/WebCola/cola.min.js"></script>
<script src="cytoscape-cola.js"></script>
<script src=" https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.0.1/chart.umd.js"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.26.0/cytoscape.min.js"
integrity="sha512-rOsRHy2O7kykGotH99Bi0+LyynL6rfQpaMiKOwYa1K1jYAFksJUwXE1gE6Relgo88g6lQ/uf8NaWeyzi1T53Zg=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<link
rel="apple-touch-icon"
sizes="180x180"
href="/assets/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/assets/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/assets/favicon-16x16.png"
/>
<link rel="manifest" href="/assets/site.webmanifest" />
<link
rel="mask-icon"
href="/assets/safari-pinned-tab.svg"
color="#5bbad5"
/>
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#ffffff" />
</head>
<body>
<div id="main">
<div id="sidebar">
<div id="model-selection-container" class="sidebar-section">
<div class="sidebar-section-title">Model</div>
<select id="model-select">
<option value="erdos-renyi">Erdős-Rényi</option>
<option value="barabasi-albert">Barabási-Albert</option>
<option value="watts-strogatz">Watts-Strogatz</option>
</select>
</div>
<div class="sidebar-section">
<div class="sidebar-section-title">Global Parameters</div>
<label for="n">N</label>
<input type="number" id="n" value="10" step="1" min="1" max="100" />
</div>
<div id="erdos-renyi-parameters" class="sidebar-section">
<div class="sidebar-section-title">Parameters</div>
<label for="p">p</label>
<input type="number" id="p" value="0.2" step="0.01" min="0" max="1" />
</div>
<div id="barabasi-albert-parameters" class="sidebar-section">
<div class="sidebar-section-title">Parameters</div>
<label for="m0">m0</label>
<input type="number" id="m0" value="4" step="1" min="1" max="10" />
<label for="m">m</label>
<input type="number" id="m" value="1" step="1" min="1" max="35" />
</div>
<div id="watts-strogatz-parameters" class="sidebar-section">
<div class="sidebar-section-title">Parameters</div>
<label for="k">k</label>
<input type="number" id="k" value="2" step="2" min="2" max="10" />
<label for="p-watts">p</label>
<input
type="number"
id="p-watts"
value="0.2"
step="0.01"
min="0"
max="1"
/>
</div>
<div id="metrics" class="sidebar-section">
<div class="sidebar-section-title">Metrics</div>
<div id="nodes" class="metric">
<label for="nodes">Nodes:</label>
<span id="nodes-value">0</span>
</div>
<div id="edges" class="metric">
<label for="edges">Edges:</label>
<span id="edges-value">0</span>
</div>
<div id="avg-degree" class="metric">
<label for="avg-degree">Avg Degree:</label>
<span id="avg-degree-value">0</span>
</div>
<div id="density" class="metric">
<label for="density">Density:</label>
<span id="density-value">0</span>
</div>
<div id="max-degree" class="metric">
<label for="max-degree">Max Degree:</label>
<span id="max-degree-value">0</span>
</div>
<div id="avg-clustering-coefficient" class="metric">
<label for="avg-clustering-coefficient">Avg Clustering:</label>
<span id="avg-clustering-coefficient-value">0</span>
</div>
<div id="avg-path-length" class="metric">
<label for="avg-path-length">Avg Path Length:</label>
<span id="avg-path-length-value">0</span>
</div>
</div>
<div id="control" class="sidebar-section">
<div class="sidebar-section-title">Control</div>
<div class="control-item">
Charts 📊
<label class="switch">
<input type="checkbox" id="degree-distribution-switch" checked />
<span class="slider round"></span>
</label>
</div>
<div class="control-item">
Node Size
<label class="switch">
<input type="checkbox" id="node-size-switch" checked />
<span class="slider round"></span>
</label>
</div>
</div>
<div style="position: absolute; bottom: 1rem; font-size: smaller">
Made with 💙 by <a href="https://murfy.netlify.app/">@murf</a>
</div>
</div>
<div id="degree-distribution">
<canvas id="degree-distribution-line" width="200" height="200"></canvas>
<canvas id="degree-distribution-bar" width="200" height="200"></canvas>
<canvas
id="clustering-coefficient-chart"
width="200"
height="200"
></canvas>
</div>
<div id="cy"></div>
</div>
<script src="index.js"></script>
</body>
</html>