-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
1,097 additions
and
510 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
node_modules/ | ||
dist/ | ||
__pycache__ | ||
.ipynb_checkpoints/ | ||
|
||
/src/eigen_tour/static/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "bcca211d-f7a3-416d-911d-c4fa72c39836", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"%load_ext autoreload\n", | ||
"%autoreload 2" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "0b2b2bb3-f576-4080-a3f9-ff537fe2d62c", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"%%js\n", | ||
"window.global = {};" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "d056a52d-8e1c-4715-b963-1ebbcbabaf88", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"%%html\n", | ||
"<link rel=\"stylesheet\" href=\"https://use.fontawesome.com/releases/v5.2.0/css/all.css\">\n", | ||
"<link rel=\"stylesheet\" media=\"screen and (max-width: 1024px)\" href=\"/styles/small-screen.css\">\n", | ||
"<script src=\"https://distill.pub/template.v2.js\"></script>\n", | ||
"\n", | ||
"<script src=\"https://unpkg.com/numeric@1.2.6/numeric-1.2.6.js\"></script>" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "a6d50740-1061-42ff-9fd1-18f234f5cab0", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from eigen_tour import Widget\n", | ||
"import pathlib" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "261450a4-baff-404f-bbf2-c17071ea42c4", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"data = pathlib.Path(\"data/eigs.arrow\").read_bytes()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "9653616e-a1c3-4b5c-a585-84c85a33172b", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"Widget(data=data)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "297f032e-8f93-46b8-933c-6b0a5753a1c1", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "25640dcd-bdbb-49e6-9c13-400f3ba2ee90", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.12.1" | ||
}, | ||
"widgets": { | ||
"application/vnd.jupyter.widget-state+json": { | ||
"state": {}, | ||
"version_major": 2, | ||
"version_minor": 0 | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import type { RenderProps } from "@anywidget/types"; | ||
|
||
import { Renderer } from "./Renderer"; | ||
import * as utils from "./utils"; | ||
import fs from "./shaders/teaser_fragment.glsl"; | ||
import vs from "./shaders/teaser_vertex.glsl"; | ||
|
||
import "./widget.css"; | ||
|
||
interface Model { | ||
data: DataView | ||
} | ||
|
||
const template = `<d-figure class="teaser"> | ||
<canvas id="teaser"></canvas> | ||
</d-figure> | ||
` | ||
|
||
export default { | ||
async render({ model, el }: RenderProps<Model>) { | ||
el.innerHTML = template; | ||
let canvas = el.querySelector("canvas")!; | ||
console.log("initGL"); | ||
let { gl, program } = utils.initGL(canvas, fs, vs); | ||
let renderer = new Renderer(gl, program); | ||
renderer.overlay.fullScreenButton.style("top", "18px"); | ||
renderer.overlay.epochSlider.style("top", "calc(100% - 28px)"); | ||
renderer.overlay.playButton.style("top", "calc(100% - 34px)"); | ||
renderer.overlay.grandtourButton.style("top", "calc(100% - 34px)"); | ||
|
||
console.log("model", model); | ||
{ | ||
// load the data | ||
let clearBanner = utils.createLoadingBanner(renderer.overlay.figure); | ||
console.log("loading data"); | ||
await renderer.initData(model.get("data").buffer); | ||
console.log("data loaded"); | ||
clearBanner(); | ||
} | ||
|
||
function onResize() { | ||
renderer.setFullScreen(renderer.isFullScreen); | ||
} | ||
window.addEventListener("resize", onResize); | ||
return () => { | ||
window.removeEventListener("resize", onResize); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.