Published
Edited
Sep 4, 2020
Importers
Insert cell
Insert cell
Insert cell
gl = {
var gl;
const canvas = document.createElement('canvas');
try { gl = canvas.getContext("webgl"); }
catch (x) { gl = null; }

if (gl == null) {
try { gl = canvas.getContext("experimental-webgl"); }
catch (x) { gl = null; }
}
return gl;
}
Insert cell
webgl_supported = gl ? true : false
Insert cell
function extension_available(extension_string) {
if (webgl_supported) {
return gl.getSupportedExtensions().includes(extension_string)
}
}
Insert cell
mutable has_webgl_context = true;
Insert cell
function add_context_listener(gl) {
gl.canvas.addEventListener("webglcontextlost", (e) => {
mutable has_webgl_context = false;
}, false);
}
Insert cell
Insert cell
Insert cell
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