-
Notifications
You must be signed in to change notification settings - Fork 0
/
eViz.html
172 lines (155 loc) · 6.72 KB
/
eViz.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
165
166
167
168
169
170
171
172
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Electoral System Visualization</title>
<!-- Third-Party Libraries -->
<script src="lib/jquery-2.1.4.js"></script>
<script src="lib/underscore-1.8.3.min.js"></script>
<!-- CSS -->
<link rel="stylesheet" href="css/electionViz.css"/>
<!-- JavaScript-->
<script src="js/electionViz.js"></script>
<script src="js/model.js"></script>
<script src="js/electoralSystemView.js"></script>
<script src="js/formView.js"></script>
</head>
<body>
<h1>Electoral System Visualization</h1>
<div id="electoral_system_views">
<div class="column electoral-system-view">
<h2>FPTP</h2>
<canvas id="fptp_electoral_system_view"></canvas>
</div>
<div class="column electoral-system-view">
<h2>Condorcet</h2>
<canvas id="condorcet_electoral_system_view"></canvas>
</div>
<div class="column electoral-system-view">
<h2>Borda</h2>
<canvas id="borda_electoral_system_view"></canvas>
</div>
<div class="column electoral-system-view">
<h2>IRV</h2>
<canvas id="irv_electoral_system_view"></canvas>
</div>
<div class="clear-float"></div>
</div>
<form id="form_view">
<div class="column">
<div class="field" id="candidates_field">
<label>Candidates</label>
<div id="candidate_1_fields">
<div class="column red">
<p></p>
</div>
<div class="column">
<input class="valid" id="candidate_1_x_coordinate_textfield" type="number" placeholder="X-Coordinate"/>
<div id="candidate_1_x_coordinate_error_message"></div>
</div>
<div class="column">
<input class="valid" id="candidate_1_y_coordinate_textfield" type="number" placeholder="Y-Coordinate"/>
<div id="candidate_1_y_coordinate_error_message"></div>
</div>
<div class="clear-float"></div>
</div>
<div id="candidate_2_fields">
<div class="column green">
<p></p>
</div>
<div class="column">
<input class="valid" id="candidate_2_x_coordinate_textfield" type="number" placeholder="X-Coordinate"/>
<div id="candidate_2_x_coordinate_error_message"></div>
</div>
<div class="column">
<input class="valid" id="candidate_2_y_coordinate_textfield" type="number" placeholder="Y-Coordinate"/>
<div id="candidate_2_y_coordinate_error_message"></div>
</div>
<div class="clear-float"></div>
</div>
<div id="candidate_3_fields">
<div class="column blue">
<p></p>
</div>
<div class="column">
<input class="valid" id="candidate_3_x_coordinate_textfield" type="number" placeholder="X-Coordinate"/>
<div id="candidate_3_x_coordinate_error_message"></div>
</div>
<div class="column">
<input class="valid" id="candidate_3_y_coordinate_textfield" type="number" placeholder="Y-Coordinate"/>
<div id="candidate_3_y_coordinate_error_message"></div>
</div>
<div class="clear-float"></div>
</div>
<div id="candidate_4_fields">
<div class="column yellow">
<p></p>
</div>
<div class="column">
<input class="valid" id="candidate_4_x_coordinate_textfield" type="number" placeholder="X-Coordinate"/>
<div id="candidate_4_x_coordinate_error_message"></div>
</div>
<div class="column">
<input class="valid" id="candidate_4_y_coordinate_textfield" type="number" placeholder="Y-Coordinate"/>
<div id="candidate_4_y_coordinate_error_message"></div>
</div>
<div class="clear-float"></div>
</div>
<div id="candidate_5_fields">
<div class="column purple">
<p></p>
</div>
<div class="column">
<input class="valid" id="candidate_5_x_coordinate_textfield" type="number" placeholder="X-Coordinate"/>
<div id="candidate_5_x_coordinate_error_message"></div>
</div>
<div class="column">
<input class="valid" id="candidate_5_y_coordinate_textfield" type="number" placeholder="Y-Coordinate"/>
<div id="candidate_5_y_coordinate_error_message"></div>
</div>
<div class="clear-float"></div>
</div>
<div id="candidate_6_fields">
<div class="column orange">
<p></p>
</div>
<div class="column">
<input class="valid" id="candidate_6_x_coordinate_textfield" type="number" placeholder="X-Coordinate"/>
<div id="candidate_6_x_coordinate_error_message"></div>
</div>
<div class="column">
<input class="valid" id="candidate_6_y_coordinate_textfield" type="number" placeholder="Y-Coordinate"/>
<div id="candidate_6_y_coordinate_error_message"></div>
</div>
<div class="clear-float"></div>
</div>
<button id="add_candidate_button">Add Candidate</button>
<button id="remove_candidate_button">Remove Candidate</button>
</div>
<div class="field">
<label>Number of Voters</label>
<input class="valid" id="num_voters_textfield" type="number"/>
</div>
<div id="num_voters_error_message"></div>
<div class="field">
<label>Standard Deviation</label>
<input class="valid" id="standard_deviation_textfield" type="number"/>
</div>
<div id="standard_deviation_error_message"></div>
<div class="field">
<label>Resolution</label>
<select class="valid" id="resolution_dropdown">
<option value="1">1×1</option>
<option value="2">2×2</option>
<option value="4">4×4</option>
<option value="8">8×8</option>
<option value="16">16×16</option>
</select>
</div>
<button id="simulate_button" type="button">Simulate</button>
</div>
<div class="clear-float"></div>
</form>
</body>
</html>