I tried to use Perpective Data Grid in observablehq, but I am struggling to reproduce even the simpliest examples from the Perspective documentation such as the one below. I fear it is because I do not know how to import the modules. I tried perspective = require("@finos/perspective"), but it does not seem to be working. My end goal is to create a data exploration tool such as this one.
<script>
const worker = window.perspective.worker();
const table = await worker.table({ A: [1, 2, 3] });
const view = await table.view({ sort: [["A", "desc"]] });
const viewer = document.createElement("perspective-viewer");
viewer.load(table);
document.body.appendChild(viewer);
</script>