-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
228 lines (192 loc) · 9.36 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
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Visualiza tu línea de tiempo. Visualize your timeline. ShowTimeLine! HacksHackers Buenos Aires</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="hhba.info">
<!-- Le styles -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="assets/css/docs.css" rel="stylesheet">
<link href="assets/js/google-code-prettify/prettify.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="assets/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
<script src='javascripts/raphael-min.js' type='text/javascript'></script>
<script src='javascripts/get_data.js' type='text/javascript'></script>
<script src='javascripts/preprocess.js' type="text/javascript"></script>
<script src='JSOptimizer/js/taoptimizer.js' type="text/javascript"></script>
<script src='javascripts/timelineproblem.js' type="text/javascript"></script>
<script src='javascripts/graficador.js' type="text/javascript"></script>
</head>
<body data-spy="scroll" data-target=".subnav" data-offset="50">
<!-- Navbar
================================================== -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="./index.html">Bootstrap</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active">
<a href="./index.html">Inicio</a>
</li>
<li class="">
<a href="./index.html">Hack/Hackers</a>
</li>
<li class="divider-vertical"></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<form name="myForm">
<div class="row-fluid">
<span class="span2">
<h1>ShowTimeLine!</h1>
<h2>How to use</h2>
<p>The source data for this visualization comes from a Google Docs Spreadsheet. To create your own timeline use this Google Docs template.<br/><br/>
<a class="btn btn-primary btn-large" href="https://docs.google.com/previewtemplate?id=0Ah8aJJcr8vfjdFh1WmlxWVlGUkVfM2VTRFBCRUZoSXc&mode=public" target="_blank">Google Doc Template</a><br/><br/>
Once you have your information properly organized in columns [order] [characther] [group] you must get a RSS link. To do that, go to your Spreadsheet and select:
<ol>
<li>File... </li>
<li>Publish to the web </li>
<li>Select the sheet </li>
<li>Click on "Start Publishing" (if not selected) </li>
<li>Click on [x] automatically republish </li>
<li>Get a link to the published data: RSS </li>
<li>Once you have the link, past it in the URL field (replace the one already pasted by default) </li>
</ol>
</p>
</span>
<span class="span10">
<div class="clearfix">
<label>Paste the URL here</label>
<div class="input">
<input type="text" class="input-xxlarge" name="url" id='url' value='https://spreadsheets.google.com/feeds/list/0AroKqlZ3hHf0dEhKRS02cGs0QW9WcGpRTXRETm51Q0E/od5/public/basic?alt=rss' /><a class="btn btn-primary btn-large" id='btn'>Visualize</a>
<a class="btn btn-primary btn-large" id="btn-download">Descargar SVG</a>
</div>
</div>
<div id='cost'></div>
<div id='graph' style='width: 1200px; height: 500px; overflow: hidden;'></div>
</span>
</div>
</form>
<!-- Footer
================================================== -->
<footer class="footer">
<div class="row-fluid">
<span class="span2">
<a href="http://meetupba.hackshackers.com" target="_blank"><img src="assets/img/hhba.jpg" alt="Hacks/Hackers Buenos Aires Logo" /></a>
</span>
<span class="span10">
<p class="pull-right"><a href="#">Back to top</a></p>
<p>Designed and built with all the love in the world <a href="http://twitter.com/twitter" target="_blank">@twitter</a> by <a href="http://twitter.com/mdo" target="_blank">@mdo</a> and <a href="http://twitter.com/fat" target="_blank">@fat</a>.</p>
<p>Code licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License v2.0</a>. Documentation licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
<p>Icons from <a href="http://glyphicons.com">Glyphicons Free</a>, licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
</span>
</div>
</footer>
</div><!-- /container -->
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<script src="assets/js/jquery.js"></script>
<script src="assets/js/google-code-prettify/prettify.js"></script>
<script src="assets/js/bootstrap-transition.js"></script>
<script src="assets/js/bootstrap-alert.js"></script>
<script src="assets/js/bootstrap-modal.js"></script>
<script src="assets/js/bootstrap-dropdown.js"></script>
<script src="assets/js/bootstrap-scrollspy.js"></script>
<script src="assets/js/bootstrap-tab.js"></script>
<script src="assets/js/bootstrap-tooltip.js"></script>
<script src="assets/js/bootstrap-popover.js"></script>
<script src="assets/js/bootstrap-button.js"></script>
<script src="assets/js/bootstrap-collapse.js"></script>
<script src="assets/js/bootstrap-carousel.js"></script>
<script src="assets/js/bootstrap-typeahead.js"></script>
<script src="assets/js/application.js"></script>
<script>
$(function() {
document.showtimeline = {running: false, firstTime: true};
$('#btn-download').click(function() {
var svgdata = $('#graph').html();
document.location.href = 'data:application/octet-stream, ' + encodeURIComponent(svgdata);
});
$("#btn").click(function() {
if (document.showtimeline.running == true) {
document.showtimeline.worker.terminate();
document.showtimeline.running = false;
$('#btn').html('Visualizar');
return;
}
document.showtimeline.firstTime = false;
get_data(document.getElementById('url').value, function(data) {
// data a procesar
var preprocessed_data = preprocessData(data);
// parametros de la optimizacion
var params = {
maxE: -1000000,
minE: 1000000,
initialThreshold: 300,
scaleIterationFactor: 0.99,
maxThresholdIter: 200,
maxIter: 2000000,
stepIter: 6000,
debug: true
};
// parametros del graficador
var grafico = new Graficador('graph', {
width: 1100,//px
height: 600,//px
'margin-top': 50,//px
'margin-right': 50,//px
'margin-bottom': 50,//px
'margin-left': 50,//px
textoffset: 5, // -textoffset px
kx: 10,
ky: 4,
});
// worker que va a optimizar
document.showtimeline.worker = new Worker('javascripts/worker.js');
// Handle worker events
document.showtimeline.worker.addEventListener('message', function(e) {
var cmd = e.data.cmd;
if (cmd == 'redraw') {
var o = e.data.optimizer;
grafico.loadData(o.solution, o.instance.groupPosition);
$('#cost').html('<p><strong>costo:</strong> ' + Math.round(e.data.cost) + '</p>');
} else if (cmd == 'finish') {
console.log('Finished!');
}
});
// Start optimization
var startComand = {
'cmd': 'run',
'problemData': preprocessed_data,
'params': params,
};
document.showtimeline.worker.postMessage(startComand);
document.showtimeline.running = true;
$('#btn').html('Detener');
})
})
})
</script>
</body>
</html>