-
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
19 changed files
with
1,272 additions
and
486 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
Large diffs are not rendered by default.
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.