Published
Edited
Aug 27, 2019
2 forks
Insert cell
Insert cell
viewof regl = reglCanvas(
width,
Math.max(width*0.75,minHeight),
Math.min(devicePixelRatio, 1.5),
{
attributes: { antialias: false}
}
)
Insert cell
{
while (true) {
// regl.poll();
draw();
yield;
}
}
Insert cell
draw = regl({
vert:`
attribute vec2 position;
void main () {
gl_Position = vec4(position, 0, 1);
}
`,
frag:`
void main () {
gl_FragColor = vec4(0, 0, 0, 1);
}
`,
attributes: {
position: [
[1, 0],
[0, 1],
[-1, -1]
]
},
count:3
})
Insert cell
Insert cell
width = 800
Insert cell
minHeight = 400
Insert cell
Insert cell
require('regl')
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