-
Notifications
You must be signed in to change notification settings - Fork 27
/
index.html
89 lines (77 loc) · 3.92 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>PubNub x D3</title>
<meta name="description" content="D3">
<meta name="author" content="Tomomi Imura @girlie_mac">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Lobster+Two:400,700italic" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-PZWSZ2"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-PZWSZ2');</script>
<!-- End Google Tag Manager -->
<header>
<h1>PubNub ❤ D3</h1>
<h2>D3 Bubble Chart with PubNub Data Stream!</h2>
</header>
<fieldset>
<section id="chart"></section>
<p>data center:<br><span id="region"></span></p>
<legend>
Select a data center location:<br>
<select id="dataCenterPicker">
<option value="amsterdam">Amsterdam</option>
<option value="california">California</option>
<option value="ireland">Ireland</option>
<option value="saopaulo">São Paulo</option>
<option value="tokyo">東京 (Tokyo)</option>
<option value="virginia">Virginia</option>
</select>
<div data-category="North America" class="noram"></div>
<div data-category="Latin America and the Caribbean" class="latam"></div>
<div data-category="Europe" class="eu"></div>
<div data-category="Africa" class="africa"></div>
<div data-category="Asia" class="asia"></div>
<div data-category="Oceania" class="oceania"></div>
<div data-category="Unclassified" class="other"></div>
<input type="button" id="toggle" value="Stop me!">
</legend>
</fieldset>
<footer>So what does this chart indicates? It shows message volume per country from an each PubNub data center.<br>
The size of each bubble corresponds with volume. To simplify the tutorial, the country names are not labeled, however, you can take a look at the generated source code in dev console to see abbriviated country codes as class name!</footer>
<a href="https://github.com/pubnub/d3-bubble"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/52760788cde945287fbb584134c4cbc2bc36f904/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f77686974655f6666666666662e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png"></a>
<script src="https://cdn.pubnub.com/pubnub-3.15.2.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"></script>
<script src="js/app.min.js"></script>
<!-- Tracking -->
<script>
piAId='29622';
piCId='23596';
(function(){
function async_load(){
var s=document.createElement('script');s.type='text/javascript';
s.src=('https:'==document.location.protocol?'https://pi':'http://cdn')
+'.pardot.com/pd.js';
var c=document.getElementsByTagName('script')[0];
c.parentNode.insertBefore(s,c);}
if(window.attachEvent){window.attachEvent('onload',async_load);}
else{window.addEventListener('load',async_load,false);}})();
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create','UA-16927549-1');
ga('send','pageview');
</script>
</body>
</html>