-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathtest.html
58 lines (48 loc) · 1.18 KB
/
test.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Imply Explorer</title>
<meta name="description" content="Data Explorer">
<meta name="author" content="Imply">
<script src="data/wikipedia_web.js"></script>
</head>
<body>
<div class="test"></div>
<script src="package/plywood.js"></script>
<script>
var Expression = plywood.Expression;
var Dataset = plywood.Dataset;
var $ = plywood.$;
var mark = plywood.mark;
var ds = Dataset.fromJS(wiki).hide();
ex = $()
.apply("wiki", $('wiki').filter("$language = 'en'"))
.apply('cont', mark('div.vis', {
style: { width: '100px' }
}))
.apply('Pages',
$('wiki').split('$page', 'Page')
.apply('Count', '$wiki.count()')
.sort('$Count', 'descending')
.limit(10)
.apply('page-cont',
$('cont').attach('div.page', {
style: {
width: '$Count'
}
})
)
.apply('label',
$('page-cont').attach('div.label', {
text: '$Page'
})
)
);
p = ex.compute({ wiki: ds }, 'div.test');
p.then(function(v) {
console.log(v.toJS())
})
</script>
</body>
</html>