-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
109 lines (94 loc) · 3.93 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
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Reddit Communities Detection</title>
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="./js/jquery.elevateZoom-3.0.8.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/StephanWagner/jBox@v1.3.2/dist/jBox.all.min.js"></script>
<link href="https://cdn.jsdelivr.net/gh/StephanWagner/jBox@v1.3.2/dist/jBox.all.min.css" rel="stylesheet">
<link rel="stylesheet" href="./styles/main.css" />
<link rel="icon" type="image/x-icon" href="./favicon.ico">
<script src="./js/main.js"></script>
<py-config>
packages = ["matplotlib", "pandas", "networkx", "scipy", "numpy"]
[[fetch]]
from = "https://raw.githubusercontent.com/Yoimer-Davila/reddit-communities/develop/"
files = [
"py/graph.py",
"py/__init__.py",
"py/web.py",
"py/main.py"
]
</py-config>
</head>
<body>
<div class="form body-item">
<div class="container">
<div class="left">
<div class="options">
<div class="form-item">
<input type="number" id="number" name="number" value="50" min="50" max="5000" required>
<label for="number">Insert a number (50 - 5000)</label>
</div>
<div class="form-item">
<select name="size" id="size" >
<option value="S600P">600PX</option>
<option value="S720P" selected>720PX</option>
<option value="S1080P">1080PX</option>
<option value="S1440P">1440P</option>
<option value="S4K">4K</option>
</select>
<label for="size">Select a image size</label>
</div>
<div class="form-item">
<select name="zoom" id="zoom">
<option value="use">Use</option>
<option value="not-use" selected>Not Use</option>
</select>
<label for="zoom">Use zoom?</label>
</div>
<div class="form-item">
<button onclick="generate()" id="form-submit" type="button">
Generate
</button>
</div>
</div>
<div id="graph-area" class="body-item">
<div id="graph"></div>
<div id="graph-spinner" class="graph-spinner hide"></div>
</div>
</div>
<div class="right">
<div>
<div class="form-item" id="communities-div">
<div id="communities">
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="footer body-item">
<div>
Reddit Communities Detector.
<br />
All rights reserved. ©
<a href="https://github.com/Yoimer-Davila/reddit-communities" target="_blank">Source code</a>
</div>
</footer>
<py-script>
from py import run_program, size_switch_option
from js import addZoomToGraph
from pyscript import Element
async def run():
div_target = "graph"
option = str(Element("size").value)
enable_zoom = str(Element("zoom").value) == "use"
display(run_program(int(Element("number").value), image_size=size_switch_option(option)), target=div_target, append=False)
addZoomToGraph(enable_zoom)
</py-script>
</body>
</html>