-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
81 lines (77 loc) · 2.27 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>UK General Election 2015</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<style>
#map {
border: 1px solid gray;
position: relative;
}
.infoPanel {
position: absolute;
top: 10px;
left: 10px;
padding: 4px;
border: 1px solid gray;
border-radius: 4px;
background-color: #e8e8e8;
display: block;
}
.infoPanel.hide {
display: none;
}
.axis path,
.axis line {
fill: none;
stroke: #D4D8DA;
stroke-width: 1px;
shape-rendering: crispEdges;
}
</style>
</head>
<body>
<div class="container">
<h2>UK General Election 2015/17</h2>
<div class="col-md-12">
<div class="row">
<button class="btn btn-sm btn-default result-button" data-resultsyear="2015">2015 results</button>
<button class="btn btn-sm btn-primary result-button" data-resultsyear="2017">2017 results</button>
<br>
<div class="panel">
<div id="map">
</div>
</div>
</div>
</div>
<footer>
Move mouse to pan the map and mouse-wheel to zoom in and out. <br>
Click a constituency to see voting data.<br>
Double click a constituency to view MPs details on <a href="https://www.theyworkforyou.com" target="_blank">They Work For You</a>
</footer>
</div>
<div id="infoPanelTemplate" style="display:none;">
<h4><span id="constituencyName"></span></h4>
<strong><span id="winningCandidateName"></span></strong><br>
<strong><span id="winningPartyName"></span></strong><br>
<div id="partyColourBlock"></div>
<strong>Vote statistics</strong><br>
<span id="electorate"></span><br>
<span id="turnout"></span><br>
<span id="votes"></span><br>
<span id="share"></span><br>
<strong>Vote breakdown</strong>
<div id="voteBarChart">
<svg id="svgVotes">
</svg>
</div>
</div>
<!-- Latest compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://d3js.org/d3.v5.min.js"></script>
<script src="https://d3js.org/topojson.v2.min.js"></script>
<script src="./app.js"></script>
</body>
</html>