-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpivot_table_orb.html
42 lines (36 loc) · 1.73 KB
/
pivot_table_orb.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
<!DOCTYPE html>
<html>
<head>
<title>Pivot Demo</title>
<!-- external libs from cdnjs -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-csv/0.71/jquery.csv-0.71.min.js"></script>
<!-- PivotTable.js libs from ../dist -->
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/orb/1.0.9/orb.min.css">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/orb/1.0.9/orb.min.js"></script>
<style>
body {font-family: Verdana;}
</style>
</head>
<body>
<script type="text/javascript">
$(function(){
var derivers = $.pivotUtilities.derivers;
$.get("./assets/data/events.csv", function(events) {
$("#output").pivotUI($.csv.toArrays(events), {
// derivedAttributes: {
// "Age Bin": derivers.bin("Age", 10),
// "Gender Imbalance": function(mp) {
// return mp["Gender"] == "Male" ? 1 : -1;
// }
// }
});
});
});
</script>
<p><a href="index.html">« back to homepage</a></p>
<p style="width: 800px">This example loads the "Events of the NWSL" dataset from a CSV.</p>
<div id="output" style="margin: 30px;"></div>
</body>
</html>