-
Notifications
You must be signed in to change notification settings - Fork 2
/
statistics.html
199 lines (188 loc) · 8.15 KB
/
statistics.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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<!DOCTYPE html>
<html>
<head>
<title>Exposure checker | Statistics</title>
<link rel="stylesheet" media="screen" href="assets/bootstrap/css/bootstrap.min.css" type="text/css" charset="utf-8">
<link rel="stylesheet" media="screen" href="assets/eyeball.css" type="text/css" charset="utf-8">
<meta charset="utf-8">
<meta name="author" content="Peter Melchior, Erin Sheldon, Alex Drlica-Wagner">
<link rel="icon" href="assets/DESC_logo_trans.png" type="image/png">
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
svg { padding: 10px 0 0 10px; }
</style>
</head>
<body>
<div id="wrapper">
<div class='container'>
<div class="navbar">
<div class="navbar-inner">
<a class="brand" href="index.html">Exposure checker</a>
<ul class="nav">
<li><a href="viewer.html">Viewer</a></li>
<li><a href="tutorial.html">Tutorial</a></li>
<li><a href="faq.html">FAQ</a></li>
<li class="active"><a href="statistics.html">Statistics</a></li>
<li><a href="api.html">API</a></li>
<li><a href="gallery.html">Gallery</a></li>
<li><a href="hodgepodge.html">Hodge-podge</a></li>
</ul>
<ul class="nav pull-right hide">
<!--#include file="release_selector.shtml"-->
</ul>
</div>
</div>
<!-- content area -->
<div class="span6">
<h1>Statistics</h1>
<p>On the right, you can see how many images have been checked so far,
and how many of them during the last 24 hours.
The pie chart shows how many of the checked images have been found
<b style="color:#46a546">Fine</b> or
<b style="color:#9d261d">Problematic</b>.</p>
<p>Below you find a break-up of the images that have been found problematic.
<b style="color: #9d261d">Red</b> areas denote the percentage of those image with a given problem,
while <b style="color: #006dcc">Blue</b> areas indicate the corresponding false-positive fraction
(see our <a href="tutorial.html">Tutorial</a> if you have questions about the
false positives).
When you click on any of the pie charts, you can see examples of images
that have been found with this kind of problem.</p>
<small class="muted">There can be multiple problems in any given image,
therefore the proportion do not necessarily add up to one.</small>
</div>
<div class="span6" id="basic_stats" style="padding-top: 40px">
</div>
<div class="span12" id="problem_stats" style="padding-top:20px"></div>
<div class="span12" style="padding-top: 20px">
<p>Also check out our <a href="heat_map.html">Heat map</a> for aggregated results for all chips. If you want to acess our problem reports directly, use our <a href="api.html">API</a>.</p>
</div>
</div>
<div id="push"></div>
</div>
<!--#include file="footer.shtml"-->
</body>
<script type="text/javascript" src="assets/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>
<script type="text/javascript" src="assets/jquery.cookie.js"></script>
<script type="text/javascript" src="assets/common.js"></script>
<script type="text/javascript" src="assets/bootstrap/js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
// set up release
setRelease($.cookie('default-release'));
// define donut shapes
var radius1 = 100;
var arc1 = d3.svg.arc()
.outerRadius(radius1)
.innerRadius(radius1 - 40);
var radius2 = 60;
var arc2 = d3.svg.arc()
.outerRadius(radius2)
.innerRadius(radius2 - 24);
var pie = d3.layout.pie().sort(null);
// get data and show stats
d3.json("stats.php?release="+ release + "&total&today&breakup", function(error, response) {
// checked chart: simply show the numbers as text
var svg = d3.select("#basic_stats").append("svg")
.attr("width", radius1*2)
.attr("height", radius1*2);
var g = svg.selectAll(".arc")
.data([response.total])
.enter().append("g");
g.append("text")
.attr("transform", "translate(" + radius1 + ", 0)")
.style("text-anchor", "middle")
.attr("dy", "55px")
.style("font-size", "60px")
.style("font-weight", "bold")
.text(function(d) { return d.toString(); });
g.append("text")
.attr("transform", "translate(" + radius1 + ", 0)")
.style("text-anchor", "middle")
.attr("dy", "75px")
.style("font-size", "14px")
.text("images checked");
var g = svg.selectAll(".arc")
.data([response.today])
.enter().append("g");
g.append("text")
.attr("transform", "translate(" + radius1 + ", 0)")
.style("text-anchor", "middle")
.attr("dy", "148px")
.style("fill", "#46a546")
.style("font-size", "60px")
.style("font-weight", "bold")
.text(function(d) { return d.toString(); });
g.append("text")
.attr("transform", "translate(" + radius1 + ", 0)")
.style("text-anchor", "middle")
.attr("dy", "168px")
.style("font-size", "14px")
.style("fill", "#46a546")
.text("today");
// fine chart
svg = d3.select("#basic_stats").append("svg")
.attr("width", radius1*2)
.attr("height", radius1*2);
g = svg.selectAll(".arc")
.data(pie([response.fine/response.checked, (response.checked - response.fine)/response.checked]))
.enter().append("g")
.attr("transform", "translate(" + radius1 + "," + radius1 + ")")
//.attr("class", "arc");
g.append("path")
.attr("class", "arc")
.attr("d", arc1)
.style("fill", function(d, i) { if (i == 0) return '#46a546'; else return '#9d261d'; });
g.append("text")
.attr("transform", function(d) { return "translate(" + arc1.centroid(d) + ")"; })
.attr("dy", ".35em")
.style("text-anchor", "middle")
.style("fill", "#fff")
.style("font-size", "10px")
.text(function(d, i) { if (d.data > 0.05) return (100*d.data).toString().split(".").shift() + '%'; else return null; });
svg.append("text")
.attr("dy", ".35em")
.attr("transform", "translate(" + radius1 + "," + radius1 + ")")
.style("text-anchor", "middle")
.text("OK");
// one chart per problem
svg = d3.select("#problem_stats").selectAll(".pie")
.data(response.breakup)
.enter().append("svg")
.attr("class", "pie")
.attr("width", radius2 * 2)
.attr("height", radius2 * 2);
g = svg.selectAll(".arc")
.data(function(d) { return pie([(d.all-d.false_positive)/(response.checked - response.fine), d.false_positive/(response.checked - response.fine), (response.checked - response.fine - d.all)/(response.checked - response.fine)]); })
.enter().append("g")
.attr("transform", "translate(" + radius2 + "," + radius2 + ")") .attr("class", "arc");
g.append("path")
.attr("class", "arc")
.attr("d", arc2)
.style("fill", function(d, i) { if (i == 0) return '#9d261d'; if (i==1) return '#006dcc'; return '#ddd'; });
g.append("text")
.attr("transform", function(d) { return "translate(" + arc2.centroid(d) + ")"; })
.attr("dy", ".35em")
.style("text-anchor", "middle")
.style("fill", "#fff")
.style("font-size", "10px")
.text(function(d, i) { if (i<2 && d.data > 0.05) return (100*d.data).toString().split(".").shift() + '%'; else return null; });
svg.append("a")
.attr("xlink:href", function(d) {
if (d.name != "Other...")
return "viewer.html?release=" + release + "&problem=" + d.name + "&show_marks";
else
return "hodgepodge.html";
})
.append("text")
.attr("dy", ".35em")
.attr("transform", "translate(" + radius2 + "," + radius2 + ")")
.style("text-anchor", "middle")
.text(function(d) { return d.name; });
});
});
</script>
</html>