Public
Edited
Jan 17, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
dataUrl
Insert cell
function getWasmBinaryString(wasmBinaryArray) {
const chunkSize = 1024;
const chunks = d3.range(0, wasmBinaryArray.length, chunkSize)
.map(i => wasmBinaryArray.slice(i, i+chunkSize));
return chunks.map(c => String.fromCodePoint(...c)).join("");
}
Insert cell
Insert cell
[...wasmString64].map(c => c.codePointAt(0))
Insert cell
atob(wasmString64)
Insert cell
Uint8Array.from(atob(wasmString64), (m) => m.codePointAt(0));
Insert cell
dataUrl = {
const binString = getWasmBinaryString(wasmBinaryArray);
return `data:application/octet-stream;base64,${btoa(binString)}`;
}
Insert cell
dataUrlFile = "const wasmBinaryFile = `" + dataUrl + "`;"
Insert cell
function getWasmBinaryArray(wasmBinaryString) {
const chunkSize = 1024;
const chunks = d3.range(0, wasmBinaryString.length, chunkSize)
.map(i => wasmBinaryString.slice(i, i+chunkSize));
return chunks; //.map(c => String.fromCodePoint(...c)).join("");
}
Insert cell
getWasmBinaryArray(wasmText)
Insert cell
ba2 = {
const bab = await fetch(dataUrl);
return new Uint8Array(await bab.arrayBuffer());
}
Insert cell
ba2.filter((e,i) => e != wasmBinaryArray[i])
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

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