forked from udienz/vis-ubuntu-pkg
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
101 lines (79 loc) · 2.59 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
<!DOCTYPE html>
<html><head>
<style type="text/css">
@import url(https://fonts.googleapis.com/css?family=Ubuntu:300);
body {
font-family: Ubuntu, Arial, sans-serif;
margin: 4em;
}
</style>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="out/data.js"></script>
<script type="text/javascript">
google.load('visualization', '1.0', {'packages':['corechart']});
google.setOnLoadCallback(draw);
function groupSize(data) {
var f = data.clone();
for (var i=0; i<f.getNumberOfRows(); i++) {
for (var j=1; j<=4; j++) {
var value = f.getValue(i, j);
var mb = value / 1024 / 1024;
f.setValue(i, j, mb);
f.setFormattedValue(i, j, parseInt(mb).toString() + ' MB')
}
}
return f;
}
function draw() {
var data = getData();
new google.visualization.ColumnChart(document.getElementById('package-i386')).
draw(data['packages']['i386'],
{width: 800,
height: 400,
vAxis: {title: "Packages"},
hAxis: {title: "Releases"},
isStacked: true}
);
new google.visualization.ColumnChart(document.getElementById('size-i386')).
draw(groupSize(data['sizes']['i386']),
{width: 800,
height: 400,
vAxis: {title: "Size", format: "#,### MB"},
hAxis: {title: "Releases"},
isStacked: true}
);
new google.visualization.ColumnChart(document.getElementById('package-amd64')).
draw(data['packages']['amd64'],
{width: 800,
height: 400,
vAxis: {title: "Packages"},
hAxis: {title: "Releases"},
isStacked: true}
);
new google.visualization.ColumnChart(document.getElementById('size-amd64')).
draw(groupSize(data['sizes']['amd64']),
{width: 800,
height: 400,
vAxis: {title: "Size", format: "#,### MB"},
hAxis: {title: "Releases"},
isStacked: true}
);
}
document.onload = function() {
start();
}
</script>
</head><body>
<h1>Debian Repository: Packages and Sizes</h1>
<h2>i386</h2>
<h3>Total Packages</h3>
<div id="package-i386"></div>
<h3>Total Package Size</h3>
<div id="size-i386"></div>
<h2>amd64</h2>
<h3>Total Packages</h3>
<div id="package-amd64"></div>
<h3>Total Package Size</h3>
<div id="size-amd64"></div>
<a href="https://github.com/debian-id/vis-debian-pkg"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png" alt="Fork me on GitHub"></a>
</body></html>