perf.html
3.22 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Pivot Demo</title>
<!-- external libs from cdnjs -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.13.1/lodash.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/2.1.0/benchmark.min.js"></script>
<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="../dist/pivot.css">
<script type="text/javascript" src="../dist/pivot.js"></script>
<script type="text/javascript" src="../dist/subtotal_pivotdata.js"></script>
<style>
body {font-family: Verdana;}
</style>
</head>
<body>
<script type="text/javascript">
$(function(){
$.getJSON("mps.json", function(mps) {
var suite = new Benchmark.Suite;
suite
.add('PD: 1-cell', function() {
new $.pivotUtilities.PivotData(mps,
{
rows: [], cols: [],
aggregator: $.pivotUtilities.aggregators.Count(),
filter: function(){return true;},
sorters: function(){}
}
);
})
.add('PD: Party, Province', function() {
new $.pivotUtilities.PivotData(mps,
{
rows: ['Party', 'Province'], cols: [],
aggregator: $.pivotUtilities.aggregators.Count(),
filter: function(){return true;},
sorters: function(){}
}
);
})
.add('PD: Party vs Province', function() {
new $.pivotUtilities.PivotData(mps,
{
rows: ['Party'], cols: ['Province'],
aggregator: $.pivotUtilities.aggregators.Count(),
filter: function(){return true;},
sorters: function(){}
}
);
})
.add('PD: Party, Province vs Gender, Age', function() {
new $.pivotUtilities.PivotData(mps,
{
rows: ['Party', 'Province'], cols: ['Gender', 'Age'],
aggregator: $.pivotUtilities.aggregators.Count(),
filter: function(){return true;},
sorters: function(){}
}
);
})
.on('cycle', function(event) {
$("#output").append(String(event.target)+"\n"+"\n");
}).run();
});
});
</script>
<p><a href="index.html">« back to PivotTable.js examples</a></p>
<pre id="output"></pre>
</body>
</html>