forked from juba/uniquanti
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bivariate.html
463 lines (430 loc) · 17.4 KB
/
bivariate.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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
<!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>Bivariate quantitative variable analysis</title>
<!-- Bootstrap core CSS -->
<link href="bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap theme -->
<link href="bootstrap-3.3.7-dist/css/bootstrap-theme.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/style.css" rel="stylesheet">
<!-- 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.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body id="bivariate">
<!-- Fixed navbar -->
<nav class="navbar navbar-inverse navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="navbar-brand" href="#"><span class="glyphicon glyphicon-equalizer" aria-hidden="true"></span></div>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="index.html">Univariate</a></li>
<li class="active"><a href="#">Bivariate</a></li>
<li><a href="about.html">About</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="#">en</a></li>
<li><a href="bivariate-fr.html">fr</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container-fluid">
<!-- - Tabs -->
<div class="row">
<div class="col-md-4 col-lg-3 sidebar">
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<!-- Panel données -->
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingData">
<h4 class="panel-title">
<span class="glyphicon glyphicon-th" aria-hidden="true"></span>
<a role="button" data-toggle="collapse" href="#collapseData" aria-expanded="true" aria-controls="collapseData">
Data
</a>
</h4>
</div>
<div id="collapseData" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingData">
<div class="panel-body">
<!-- Formulaire données -->
<div>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#tab-data-manual" aria-controls="tab-data-manual" role="tab" data-toggle="tab">Manual</a></li>
<li role="presentation"><a href="#tab-data-random" aria-controls="tab-data-random" role="tab" data-toggle="tab">Random</a></li>
<li role="presentation"><a href="#tab-dataset" aria-controls="tab-dataset" role="tab" data-toggle="tab">Dataset</a></li>
</ul>
<div class="tab-content">
<!-- Données manuelles -->
<div role="tabpanel" class="tab-pane fade in active" id="tab-data-manual">
<form id="form_manual_data" action="#">
<div class="form-group">
<label for="data_manual_x">Horizontal axis values (x)</label>
<input id="data_manual_x" type="text" class="form-control" value="8, 12, 14, 10, 16, 4, 11, 7, 18, 9, 6" placeholder="Ex : 125, 57, 198, 12, 45...">
</div>
<div class="form-group">
<label for="data_manual_y">Vertical axis values (y)</label>
<input id="data_manual_y" type="text" class="form-control" value="6, 13, 10, 9, 17, 8, 9, 8, 16, 10, 11" placeholder="Ex : 120, 67, 204, 2, 25...">
</div>
<button type="submit" class="btn btn-primary btn-sm" id="data_manual_submit">Update</button>
</form>
</div>
<!-- Données aléatoires -->
<div role="tabpanel" class="tab-pane fade" id="tab-data-random">
<form id="form_random_data" action="#">
<!-- X -->
<div class="form-group">
<label for="data_law_x">Horizontal axis (x) distribution</label>
<select class="form-control" id="data_law_x">
<option value="uniforme" selected>Uniform</option>
<option value="normale">Normal</option>
</select>
</div>
<div class="form-horizontal" id="data_uniform_args_x">
<div class="form-group">
<label for="data_uniform_min_x" class="col-sm-5 control-label">Minimum</label>
<div class="col-sm-7">
<input type="number" class="form-control" id="data_uniform_min_x" value="0" />
</div>
</div>
<div class="form-group">
<label for="data_uniform_max_x" class="col-sm-5 control-label">Maximum</label>
<div class="col-sm-7">
<input type="number" class="form-control" id="data_uniform_max_x" value="100" />
</div>
</div>
</div>
<div class="form-horizontal" id="data_normal_args_x">
<div class="form-group">
<label for="data_normal_mean_x" class="col-sm-5 control-label">Mean</label>
<div class="col-sm-7">
<input type="number" class="form-control" id="data_normal_mean_x" value="50" />
</div>
</div>
<div class="form-group">
<label for="data_normal_sd_x" class="col-sm-5 control-label">Standard deviation</label>
<div class="col-sm-7">
<input type="number" class="form-control" id="data_normal_sd_x" value="5" />
</div>
</div>
</div>
<!-- Y -->
<div class="form-group">
<label for="data_law_y">Vertical axis (y) distribution</label>
<select class="form-control" id="data_law_y">
<option value="uniforme" selected>Uniform</option>
<option value="normale">Normal</option>
</select>
</div>
<div class="form-horizontal" id="data_uniform_args_y">
<div class="form-group">
<label for="data_uniform_min_y" class="col-sm-5 control-label">Minimum</label>
<div class="col-sm-7">
<input type="number" class="form-control" id="data_uniform_min_y" value="0" />
</div>
</div>
<div class="form-group">
<label for="data_uniform_max_y" class="col-sm-5 control-label">Maximum</label>
<div class="col-sm-7">
<input type="number" class="form-control" id="data_uniform_max_y" value="100" />
</div>
</div>
</div>
<div class="form-horizontal" id="data_normal_args_y">
<div class="form-group">
<label for="data_normal_mean_y" class="col-sm-5 control-label">Mean</label>
<div class="col-sm-7">
<input type="number" class="form-control" id="data_normal_mean_y" value="50" />
</div>
</div>
<div class="form-group">
<label for="data_normal_sd_y" class="col-sm-5 control-label">Standard deviation</label>
<div class="col-sm-7">
<input type="number" class="form-control" id="data_normal_sd_y" value="5" />
</div>
</div>
</div>
<div class="form-group">
<label for="nb_values">Number of observations</label>
<input type="number" class="form-control" id="nb_values" min="2" max="5000" value="100" />
</div>
<button class="btn btn-primary btn-sm" type="submit" id="data_random_submit">Generate</button>
</form>
</div>
<!-- Jeux de données -->
<div role="tabpanel" class="tab-pane fade in" id="tab-dataset">
<form id="form_dataset" action="#">
<div class="form-group">
<label for="data_dataset">Dataset</label>
<select class="form-control" id="data_dataset">
<option value="lifeexp_gdp_europe_2007" selected>Life expectancy vs GDP per capita (Europe, 2007)</option>
<option value="lifeexp_gdp_world_2007">Life expectancy vs GDP per capita (World, 2007)</option>
<option value="galton_1886">Child and parents heights (Galton, 1886)</option>
</select>
</div>
<button type="submit" class="btn btn-primary btn-sm" id="data_dataset_submit">Load</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Panel points -->
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingPoints">
<h4 class="panel-title">
<span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span>
<a class="collapsed" role="button" data-toggle="collapse" href="#collapsePoints" aria-expanded="false" aria-controls="collapsePoints">
Points
</a>
</h4>
</div>
<div id="collapsePoints" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingPoints">
<div class="panel-body">
<div class="form-group">
<label for="points_size">Points size</label>
<input id="points_size" type="range" min="5" max="500" value="120" />
</div>
<div class="form-group">
<label for="points_opacity">Points opacity</label>
<input id="points_opacity" type="range" min="0.01" max="1" value="0.8" step="0.01"/>
</div>
<div class="checkbox" id="points_show_rugs">
<label>
<input id="show_rugs" type="checkbox" checked="checked"> Show rugs
</label>
</div>
<div class="checkbox" id="points_show_labels">
<label>
<input id="show_labels" type="checkbox" value=""> Show labels
</label>
</div>
</div>
</div>
</div>
<!-- Panel indicateurs -->
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingIndicateurs">
<h4 class="panel-title">
<span class="glyphicon glyphicon-map-marker" aria-hidden="true"></span>
<a class="collapsed" role="button" data-toggle="collapse" href="#collapseIndicateurs" aria-expanded="false" aria-controls="collapseIndicateurs">
Statistics
</a>
</h4>
</div>
<div id="collapseIndicateurs" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingIndicateurs">
<div class="panel-body">
<div class="checkbox">
<label>
<input id="stats_mean" type="checkbox"> Mean
</label>
</div>
<div class="checkbox">
<label>
<input id="stats_sd" type="checkbox"> Standard deviation
</label>
</div>
<div class="checkbox">
<label>
<input id="stats_cov" type="checkbox"> Covariance and correlation
</label>
</div>
</div>
</div>
</div>
<!-- Panel graphiques -->
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingGraphiques">
<h4 class="panel-title">
<span class="glyphicon glyphicon-minus" aria-hidden="true"></span>
<a class="collapsed" role="button" data-toggle="collapse" href="#collapseGraphiques" aria-expanded="false" aria-controls="collapseGraphiques">
Regression
</a>
</h4>
</div>
<div id="collapseGraphiques" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingGraphiques">
<div class="panel-body">
<div class="checkbox">
<label>
<input id="manual_line" type="checkbox"> Manual line
</label>
</div>
<div class="form-horizontal" id="manual_line_options">
<div class="form-group">
<label for="manual_slope" class="col-sm-5 control-label">Slope</label>
<div class="col-sm-7">
<input type="number" class="form-control" id="manual_slope" value="1" />
</div>
</div>
<div class="form-group">
<label for="manual_intercept" class="col-sm-5 control-label">Intercept</label>
<div class="col-sm-7">
<input type="number" class="form-control" id="manual_intercept" value="0" />
</div>
</div>
<div class="checkbox" style="margin-left: 30px;">
<label>
<input id="manual_errors" type="checkbox"> Show residuals
</label>
</div>
</div>
<div class="checkbox">
<label>
<input id="reg_line" type="checkbox"> Linear regression line
</label>
</div>
<div class="form-horizontal" id="reg_line_options">
<div class="form-group">
<label for="reg_predict" class="col-sm-5 control-label">Predict value</label>
<div class="col-sm-7">
<input type="number" step="any" class="form-control" id="reg_predict" value="" />
</div>
</div>
<div class="checkbox" style="margin-left: 30px;">
<label>
<input id="reg_errors" type="checkbox"> Show residuals
</label>
</div>
</div>
</div>
</div>
</div>
<!-- Panel axe -->
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingAxe">
<h4 class="panel-title">
<span class="glyphicon glyphicon-resize-horizontal" aria-hidden="true"></span>
<a class="collapsed" role="button" data-toggle="collapse" href="#collapseAxe" aria-expanded="false" aria-controls="collapseAxe">
Axes
</a>
</h4>
</div>
<div id="collapseAxe" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingAxe">
<div class="panel-body">
<div class="checkbox">
<label>
<input id="coord_fixed" type="checkbox"> Fixed ratio
</label>
</div>
<button type="submit" class="btn btn-sm" id="coord_switch">Switch axes</button>
<div class="checkbox">
<label>
<input id="x_manual" type="checkbox"> Manual x limits
</label>
</div>
<div class="form-horizontal" id="x_limits">
<div class="form-group">
<label for="x_min" class="col-sm-5 control-label">x minimum</label>
<div class="col-sm-7">
<input type="number" class="form-control" id="x_min" value="0" />
</div>
</div>
<div class="form-group">
<label for="x_max" class="col-sm-5 control-label">x maximum</label>
<div class="col-sm-7">
<input type="number" class="form-control" id="x_max" value="100" />
</div>
</div>
</div>
<div class="checkbox">
<label>
<input id="y_manual" type="checkbox"> Manual y limits
</label>
</div>
<div class="form-horizontal" id="y_limits">
<div class="form-group">
<label for="y_min" class="col-sm-5 control-label">y minimum</label>
<div class="col-sm-7">
<input type="number" class="form-control" id="y_min" value="0" />
</div>
</div>
<div class="form-group">
<label for="y_max" class="col-sm-5 control-label">y maximum</label>
<div class="col-sm-7">
<input type="number" class="form-control" id="y_max" value="100" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Plot -->
<div class="col-md-8 col-lg-9">
<div id="plot">
</div>
<div class="row">
<div id="manualtable" class="col-sm-6">
<table class="table table-condensed">
<thead>
<tr><th>Manual line</th><th></th></tr>
</thead>
<tbody>
<tr><td>Slope</td><td id="man-slope"></td></tr>
<tr><td>Intercept</td><td id="man-intercept"></td></tr>
<tr class="warning"><td>Squared residuals</td><td id="man-error"></td></tr>
</tbody>
</table>
</div>
<div id="regtable" class="col-sm-6">
<table class="table table-condensed">
<thead>
<tr><th>Regression line</th><th></th></tr>
</thead>
<tbody>
<tr><td>Slope</td><td id="reg-slope"></td></tr>
<tr><td>Intercept</td><td id="reg-intercept"></td></tr>
<tr class="warning"><td>Squared residuals</td><td id="reg-error"></td></tr>
<tr class="info"><td>R<sup>2</sup></td><td id="reg-r2"></td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div> <!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script src="js/lib/l10n.js"></script>
<script>String.locale = "en";</script>
<script src="js/l10n/localizations.js"></script>
<script src="js/lib/d3.min.js"></script>
<script src="js/lib/simple-statistics.min.js"></script>
<!-- init jquery js -->
<script src="js/bivariate/init.js"></script>
<!-- datasets js -->
<script src="data/bivariate.js"></script>
<!-- plot js -->
<script src="js/bivariate/plot-utils.js"></script>
<script src="js/bivariate/plot-export.js"></script>
<script src="js/bivariate/plot-axes.js"></script>
<script src="js/bivariate/plot-setup.js"></script>
<script src="js/bivariate/plot-dots.js"></script>
<script src="js/bivariate/plot-lines.js"></script>
<script src="js/bivariate/plot-errors.js"></script>
<script src="js/bivariate/plot-predict.js"></script>
<script src="js/bivariate/plot-stats.js"></script>
<script src="js/bivariate/plot.js"></script>
</body>
</html>