-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
105 lines (91 loc) · 2.81 KB
/
index.html
File metadata and controls
105 lines (91 loc) · 2.81 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Majority Graph Builder</title>
<link rel="stylesheet" href="styles.css" />
<script src="script.js" defer></script>
</head>
<body>
<div class="app">
<header class="app-header">
<h1>Majority Graph Builder</h1>
<p>
Build majority graphs using LaTeX-like labels and export or save your work.
</p>
</header>
<!-- TOP CONTROLS -->
<section class="controls">
<div class="control-group small-group">
<h2>Add Node</h2>
<form id="node-form">
<label for="node-label">Node label</label>
<input
id="node-label"
type="text"
placeholder="e.g. λ_i, x^2, \frac{a}{b}"
autocomplete="off"
required
/>
<button type="submit">Add Node</button>
</form>
</div>
<div class="control-group small-group">
<h2>Add Edge</h2>
<form id="edge-form">
<label>From</label>
<select id="from-node" required></select>
<label>To</label>
<select id="to-node" required></select>
<button type="submit">Add Edge</button>
</form>
</div>
</section>
<!-- TABS -->
<section class="tabs">
<div class="tab-buttons">
<button class="tab-btn active" data-tab="graph-tab">Graph</button>
<button class="tab-btn" data-tab="edges-tab">Edges</button>
</div>
<div class="tab-content">
<!-- GRAPH TAB -->
<div id="graph-tab" class="tab-pane active">
<div class="canvas-section">
<canvas id="graph-canvas" width="900" height="600"></canvas>
</div>
<!-- SAVE / EXPORT BELOW GRAPH -->
<div class="below-graph">
<div class="control-group">
<h3>Export</h3>
<button id="download-jpg">JPG</button>
<button id="download-png">PNG</button>
<button id="download-svg">SVG</button>
<button id="clear-graph">Clear Graph</button>
</div>
<div class="control-group">
<h3>Save</h3>
<button id="save-graph">Save</button>
<button id="load-graph">Load</button>
<input id="load-file" type="file" accept=".json" style="display:none" />
</div>
</div>
</div>
<!-- EDGES TAB -->
<div id="edges-tab" class="tab-pane">
<h2>Edges</h2>
<table class="edges-table">
<thead>
<tr>
<th>From</th>
<th>To</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="edges-body"></tbody>
</table>
</div>
</div>
</section>
</div>
</body>
</html>