-
Notifications
You must be signed in to change notification settings - Fork 1k
/
chained.html
51 lines (42 loc) · 1.66 KB
/
chained.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
<!--
Copyright (c) 2017, the Perspective Authors.
This file is part of the Perspective library, distributed under the terms of
the Apache License 2.0. The full license can be found in the LICENSE file.
-->
<!DOCTYPE html>
<html>
<head>
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
/>
<script src="perspective-viewer.js"></script>
<script src="perspective-viewer-datagrid.js"></script>
<script src="perspective-viewer-d3fc.js"></script>
<script src="perspective.js"></script>
<link rel="stylesheet" href="index.css" />
<link rel="stylesheet" href="pro.css" />
</head>
<body>
<perspective-viewer
id="view1"
plugin="Y Area"
row-pivots='["week_bucket(Date)"]'
column-pivots='["Email"]'
columns='["Hash"]'
computed-columns='[{"name":"week_bucket(Date)","inputs":["Date"],"computed_function_name":"week_bucket"}]'
>
</perspective-viewer>
<script>
window.addEventListener("DOMContentLoaded", async function () {
var elem = document.getElementById("view1");
var client = perspective.websocket();
let table = client.open_table("data_source");
let view = await table.view();
let arrow = await view.to_arrow();
let table = await perspective.worker().table(arrow);
elem.load(table);
});
</script>
</body>
</html>