This repository was archived by the owner on Nov 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdomain.html
More file actions
214 lines (175 loc) · 8.7 KB
/
domain.html
File metadata and controls
214 lines (175 loc) · 8.7 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
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<title>Crossref Labs Chronograph</title>
<!-- Bootstrap core CSS -->
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<link href="navbar.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="graph.css">
<link type="text/css" rel="stylesheet" href="legend.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<link rel="apple-touch-icon" sizes="57x57" href="https://assets.crossref.org/favicon/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://assets.crossref.org/favicon/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://assets.crossref.org/favicon/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://assets.crossref.org/favicon/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://assets.crossref.org/favicon/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://assets.crossref.org/favicon/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://assets.crossref.org/favicon/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://assets.crossref.org/favicon/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://assets.crossref.org/favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://assets.crossref.org/favicon/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://assets.crossref.org/favicon/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://assets.crossref.org/favicon/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://assets.crossref.org/favicon/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://assets.crossref.org/favicon/manifest.json">
<link rel="mask-icon" href="https://assets.crossref.org/favicon/safari-pinned-tab.svg" color="#5bbad5">
<meta name="apple-mobile-web-app-title" content="Crossref">
<meta name="application-name" content="Crossref">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="https://assets.crossref.org/favicon/mstile-144x144.png">
<meta name="theme-color" content="#ffffff">
</head>
<body>
<div class="container">
<nav class="navbar">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="/">Chronograph</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="index.html">Home</a></li>
<li><a href="top.html">Top 10</a></li>
<li><a href="http-https.html">HTTP vs HTTPS</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><img src="https://assets.crossref.org/logo/crossref-logo-200.svg" width="100" alt="Crossref logo"></li>
</ul>
</div>
</div>
</nav>
<div>
<h1>DOI Referrals from <strong id="domainname"></strong> <span id="unit"></span></h1>
<div id="chartarea" class="col-sm-12">
<div class="col-sm-12">
<p><span id="firstdate"></span> to <span id="lastdate"></span></p>
</div>
<div class="col-sm-12">
<div id="chart_container">
<div id="y_axis"></div>
<div id="chart"></div>
</div>
<div id="listcontainer"></div>
</div>
</div>
<div class="alert alert-danger" role="alert" id="notfound" style="display: none;">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only">Sorry</span>
There's no data for that domain.
</div>
</div>
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-body">
This is a <a href="http://labs.crossref.org">Crossref labs</a> project.
</div>
</div>
</div>
</div>
</div>
<script src="http://code.shutterstock.com/rickshaw/vendor/d3.v3.js"></script>
<script src="http://code.shutterstock.com/rickshaw/rickshaw.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.min.js"></script>
<script src="cryptojs/components/core.js"></script>
<script src="cryptojs/components/md5.js"></script>
<script src="chronograph.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/ie10-viewport-bug-workaround.js"></script>
<script>
$(function() {
var domain = window.location.search.substring(1);
var DOMAIN_PREFIX_LENGTH = 3;
if (domain.startsWith("domain")) {
domain = domain.substring(7);
} else {
window.location = "/";
}
$("#domainname").text(domain);
function renderChunk(chunk) {
if (chunk == null) {
$("#notfound").show();
$("#chartarea").hide();
} else {
var data = csvChunkToDateChartData(chunk);
$("#firstdate").text(chunk[0].split(",")[0]);
$("#lastdate").text(chunk[chunk.length-1].split(",")[0]);
var graph = new Rickshaw.Graph( {
element: document.getElementById("chart"),
renderer: 'bar',
interpolation: 'linear',
height: 300,
width: 1000,
series: [
{
data: data,
color: "#c05020"
}]
});
var x_axis = new Rickshaw.Graph.Axis.Time({
graph: graph
});
var y_axis = new Rickshaw.Graph.Axis.Y({
graph: graph,
orientation: 'left',
tickFormat: Rickshaw.Fixtures.Number.formatKMBT,
element: document.getElementById('y_axis'),
});
graph.render();
}}
function renderSeeAlsoDomainsList(domains) {
var list = $("<ul></ul>");
$.each(domains, function(i, domain){
list.append("<li><a href='/domain.html?domain=" + domain +"'>" + domain + "</li>");
});
$("#listcontainer").append("<h2>See also</h2>");
$("#listcontainer").append(list);
}
// Try fetching the "domain". Failing that try fetching the "full domain". Failing that fail that.
fetchChunk(domain, DOMAIN_PREFIX_LENGTH, window.BASE_URL + "day-filtered-domain.csv-chunks_", function(chunk) {
if (chunk != null) {
renderChunk(chunk);
$("#unit").text("per day");
// If it is a domain fetch the list of full-domains for it.
fetchChunk(domain, DOMAIN_PREFIX_LENGTH, window.BASE_URL + "filtered-grouped-fulldomain.csv-chunks_", renderSeeAlsoDomainsList);
} else {
// If we failed to retrieve anything, try it as a full-domain.
fetchChunk(domain, DOMAIN_PREFIX_LENGTH, window.BASE_URL + "month-filtered-fulldomain.csv-chunks_", function(chunk) {
// renderChunk will take a null show show an error if not exists.
renderChunk(chunk);
if (chunk != null) {
$("#unit").text("per month");
// If it is a domain fetch the single-length of domains for this fulldomain.
fetchChunk(domain, DOMAIN_PREFIX_LENGTH, window.BASE_URL + "fulldomain-domain.csv-chunks_", renderSeeAlsoDomainsList);
}
});
}
});
})
</script>
</body>
</html>