chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<script type="module" src="/node_modules/@perspective-dev/viewer/dist/cdn/perspective-viewer.js"></script>
|
||||
<script type="module">
|
||||
await customElements.whenDefined("perspective-viewer-plugin");
|
||||
const BASE = customElements.get("perspective-viewer-plugin");
|
||||
|
||||
class TestPluginImplementsResize extends BASE {
|
||||
get_static_config() {
|
||||
return {
|
||||
name: "Resizing Plugin",
|
||||
select_mode: "select",
|
||||
config_column_names: [],
|
||||
};
|
||||
}
|
||||
|
||||
async draw(view) {
|
||||
this._view = view;
|
||||
console.log(await this._view.num_rows());
|
||||
return await super.draw(view);
|
||||
}
|
||||
|
||||
async update(view) {
|
||||
this._view = view;
|
||||
console.log(await this._view.num_rows());
|
||||
return await super.update(view);
|
||||
}
|
||||
|
||||
async resize(view) {
|
||||
console.log(await this._view.num_rows());
|
||||
await this._view.to_csv();
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("resize-plugin", TestPluginImplementsResize);
|
||||
await customElements.whenDefined("perspective-viewer").then((viewer) => {
|
||||
viewer.registerPlugin("resize-plugin");
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="module" src="/node_modules/@perspective-dev/test/load-viewer-csv.js"></script>
|
||||
<link rel="stylesheet" href="../css/demo.css" />
|
||||
<link rel="stylesheet" href="/node_modules/@perspective-dev/viewer/dist/css/pro.css" />
|
||||
</head>
|
||||
<body>
|
||||
<perspective-viewer></perspective-viewer>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user