-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
174 lines (155 loc) · 7.11 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
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<meta name=viewport content="width=device-width, initial-scale=1">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet"
integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<link href="/lib/bootstrap.min.css" rel="stylesheet">
<link href="/lib/style.css" rel="stylesheet">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/img/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
<meta name="theme-color" content="#F4C300">
<script type="text/javascript" src="/lib/common.js"></script>
<title>The Gamma</title>
</head>
<body>
<div id="sizer" style="position:absolute;z-index:-1000;background:transparent;height:90vh;width:80vw;max-width:1000px;"></div>
<header>
<div class="container">
<div class="content">
<div class="col-lg-12">
<a href="/">
<h1><span>The Gamma</span></h1>
</a>
</div>
</div>
</div>
</header>
<script type="text/thegamma" id="demo">let data =
olympics
.'group data'.'by Athlete'.'sum Gold'.then
.'sort data'.'by Gold descending'.then
.paging.take(10)
.'get series'.'with key Athlete'.'and value Gold'
chart.column(data)
</script>
<article>
<div class="container">
<div class="col-lg-12">
<div id="out1" class="ia-output">
<div class="placeholder" style="background:white;padding:100px 20px 100px 20px">
Loading the visualization...
</div>
</div>
<button class="btn btn-success" id="editbtn">Edit source code</button>
</div>
</div>
</article>
<footer>
<div class="container">
<div class="hidden-xs col-sm-4 col-md-3" style="text-align:center;">
<h1>The Gamma</h1>
</div>
</div>
<div class="container">
<div class="col-sm-3 hidden-xs" style="text-align:center;">
<img src="/img/logo.png" style="width:100px;" />
</div>
<div class="col-sm-5 text">
<p>For more information about The Gamma and related projects, follow us
at <a href="http://twitter.com/thegamma_net">@thegamma_net</a>. If you want to speak
to us, contact <a href="http://tomasp.net">Tomas Petricek</a> at
<a href="mailto:tomas@tomasp.net">tomas@tomasp.net</a>.
</p>
<p>
All source code is licensed under <a href="https://github.com/the-gamma/thegamma-script/blob/master/LICENSE.md">MIT</a>
and is available on <a href="http://github.com/the-gamma">GitHub</a>. If you have an interesting
project idea, do get in touch!
</p>
</div>
<div class="col-sm-4 text">
<p>To receive the latest news enter your email below. We will not spam you.</p>
<form action="https://docs.google.com/forms/d/1QhOoo9g6M6WhtZcMxOcURH1pQLpLLVIuTN1omvJLbWA/formResponse"
method="POST" id="ss-form" target="_self" onsubmit="" class="form-inline">
<input placeholder="hello@thegamma.net" type="text" name="entry.902762028" value=""
style="width:100%;" class="form-control ss-q-short" id="entry_902762028" dir="auto" aria-label="Email" title="">
<input style="margin-top:5px;width:100%;" type="submit" name="submit" class="btn btn-success" value="#" id="ss-submit">
<input type="hidden" name="draftResponse" value="[,,"-2799700618843047135"]">
<input type="hidden" name="pageHistory" value="0">
<input type="hidden" name="fvv" value="0">
<input type="hidden" name="fbzx" value="-2799700618843047135">
</form>
</div>
</div>
</footer>
<div class="modal fade" id="editor" tabindex="-1" role="dialog">
<div class="modal-dialog" style="width:80vw; max-width:1000px">
<div class="modal-content" style="height:90vh">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
<h4 class="modal-title">Editor</h4>
</div>
<div class="modal-body">
<div id="ed1" class="ia-monaco"></div>
<div class="ia-errors"></div>
</div>
</div>
</div>
</div>
<!-- Third-party standard references -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/numeral.js/1.5.3/numeral.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser-polyfill.min.js"></script>
<script src="https://code.jquery.com/jquery-2.1.4.js"
integrity="sha256-siFczlgw4jULnUICcdm9gjQPZkw/YPDqhQ9+nAOScE4=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<!-- Loading Monaco and TheGamma scripts -->
<script src="/node_modules/babel-standalone/babel.min.js"></script>
<script src="/node_modules/requirejs/require.js"></script>
<script>
require.config({
paths:{'vs':'node_modules/monaco-editor/min/vs'},
map:{ "*":{"monaco":"vs/editor/editor.main"}}
});
require(["monaco","node_modules/thegamma-script/dist/thegamma.js"], function (_,g) {
//var services = "http://127.0.0.1:10042/";
var code = document.getElementById("demo").innerText;
var services = "http://thegamma-services.azurewebsites.net/";
var providers =
g.providers.createProviders({
"libraries": g.providers.library("/node_modules/thegamma-script/dist/libraries.json?s"),
"olympics": g.providers.pivot(services + "pdata/olympics") });
var ctx = g.gamma.createContext(providers);
ctx.evaluate(code, "out1");
var opts =
{ height: document.getElementById("sizer").clientHeight - 100,
width: document.getElementById("sizer").clientWidth - 40,
monacoOptions: function(m) {
m.fontFamily = "Inconsolata";
m.fontSize = 15;
m.lineHeight = 20;
m.lineNumbers = false;
} };
var created = false;
editbtn.onclick = function() {
$('#editor').modal();
if (!created) ctx.createEditor("ed1", code, opts);
created = true;
}
});
</script>
<!-- More fancy libraries -->
<script type="text/javascript" src="//www.google.com/jsapi"></script>
<script type="text/javascript" src="/lib/charts.js"></script>
<script>
(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','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-65311433-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>