Published
Edited
Oct 31, 2018
1 star
Insert cell
Insert cell
Insert cell
Module = require(url).catch(() => {
const m = window.Module;
if (m.onRuntimeInitialized) return m; // Already initialized.
return new Promise(resolve => m.onRuntimeInitialized = () => resolve(m));
})
Insert cell
// Convenience function to allocate a buffer in the Module's memory space
// so that we can use it to pass and receive an array of numbers
function cArray(size) {
var offset = Module._malloc(size * 8);
Module.HEAPF64.set(new Float64Array(size), offset / 8);
return {
data: Module.HEAPF64.subarray(offset / 8, offset / 8 + size),
offset: offset,
size:size
}
}
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