45 lines
1.8 KiB
HTML
45 lines
1.8 KiB
HTML
<!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/@perspective-dev/viewer-datagrid/dist/cdn/perspective-viewer-datagrid.js"></script>
|
|
<script type="module" src="/node_modules/@perspective-dev/viewer-charts/dist/cdn/perspective-viewer-charts.js"></script>
|
|
|
|
<link rel="stylesheet" crossorigin="anonymous" href="/node_modules/@perspective-dev/viewer/dist/css/themes.css" />
|
|
|
|
<style>
|
|
perspective-viewer {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<perspective-viewer id="viewer"></perspective-viewer>
|
|
|
|
<script type="module">
|
|
import "/node_modules/@perspective-dev/viewer/dist/cdn/perspective-viewer.js";
|
|
import perspective from "/node_modules/@perspective-dev/client/dist/cdn/perspective.js";
|
|
|
|
/**
|
|
* `perspective.websocket` connects to a remote Perspective server
|
|
* that accepts WebSocket connections at the specified URL.
|
|
*
|
|
* Use `perspective.websocket` to set up Perspective in server or
|
|
* distributed modes.
|
|
*/
|
|
const websocket = await perspective.websocket("ws://localhost:8080/websocket");
|
|
const server_table = await websocket.open_table("data_source_one");
|
|
// const table = worker.table(server_table);
|
|
|
|
// Load the local table in the `<perspective-viewer>`.
|
|
document.getElementById("viewer").load(server_table);
|
|
</script>
|
|
</body>
|
|
</html>
|