Published
Edited
Apr 15, 2021
Insert cell
Insert cell
Insert cell
renderKernel = {
const renderKernel = gpu.createKernel(
function(t) {
const r = (Math.cos(t + Math.PI / 2.0) + 1.0) / 2.0;
const g = (Math.cos(t + Math.PI / 4.0) + 1.0) / 2.0;
const b = (Math.cos(t + Math.PI / 8.0) + 1.0) / 2.0;
this.color(r, g, b, 1.0);
},
{
output: [1024, 512],
graphical: true
}
);
return renderKernel;
}
Insert cell
{
while (true) {
const t = performance.now() / 1000.0;
renderKernel(t);
yield t;
}
}
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more