forked from finos/perspective
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.html
50 lines (48 loc) · 2.15 KB
/
template.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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
<script type="module" src="/node_modules/@finos/perspective-viewer/dist/cdn/perspective-viewer.js"></script>
<script type="module" src="/node_modules/@finos/perspective-viewer-datagrid/dist/cdn/perspective-viewer-datagrid.js"></script>
<script type="module" src="/node_modules/@finos/perspective-viewer-d3fc/dist/cdn/perspective-viewer-d3fc.js"></script>
<link rel="stylesheet" href="/node_modules/@finos/perspective-viewer/dist/css/pro.css" />
<style>
perspective-viewer {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
perspective-viewer[theme="Pro Light"] {
--plugin--background: #f2f4f6;
}
</style>
</head>
<body>
<perspective-viewer editable> </perspective-viewer>
<script type="module">
import perspective from "/node_modules/@finos/perspective/dist/cdn/perspective.js";
const WORKER = await perspective.worker();
async function on_load() {
console.log("ON LOAD");
var el = document.getElementsByTagName("perspective-viewer")[0];
console.log("VIEWR ELEMENT:", el);
const plugin = await el.getPlugin("Heatmap");
plugin.render_warning = false;
const table = WORKER.table(this.response);
await el.load(table);
await el.toggleConfig();
window.__TEST_PERSPECTIVE_READY__ = true;
}
// window.addEventListener("DOMContentLoaded", function () {
// console.log("DOM CONTENT LOADED");
var xhr = new XMLHttpRequest();
xhr.open("GET", "/node_modules/superstore-arrow/superstore.lz4.arrow", true);
xhr.responseType = "arraybuffer";
xhr.onload = on_load.bind(xhr);
xhr.send(null);
// });
</script>
</body>
</html>