Published
Edited
Oct 14, 2019
1 fork
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
eye_set = (i,j,t=100) =>
d3.select(eye).dispatch('update', {detail: [i,j,t]})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// TODO: find API hook to orbitcamera (controls that couple position to rotation)
/* tween = {
let PI = Math.PI
return new TWEEN.Tween(camera.)
.to({ x: [-PI/5, -PI/5, PI/5, PI/5],
y: [PI/4, -PI/4, -PI/4, PI/4] }, 4000) // relative animation
.repeat( Infinity )
.onUpdate(function(d) {
// console.log(d)
lines.forEach(u => { u.rotation.set(d.x, d.y, 0) })
// u.rotation.set(d.x, d.y, d.z)
}).start();
}*/
Insert cell
// TWEEN = require('@tweenjs/tween.js')
Insert cell
THREE = {
const THREE = window.THREE = await require('three');
// https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/renderers/SVGRenderer.js
await require('three/examples/js/renderers/Projector.js').catch(() => {});
await require('three/examples/js/renderers/SVGRenderer.js').catch(() => {});
await require("three@0.99.0/examples/js/controls/OrbitControls.js").catch(() => {});
// TODO: use TrackballControls, but detect the 1d space of orientations (no canonical 'up') corresp. to ea. vtx.
return THREE;
}
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more