Published
Edited
Feb 24, 2021
2 stars
Insert cell
Insert cell
Insert cell
codec = {
const Codec = await getCodec(codecId);
return new Codec();
}
Insert cell
size = 100000
Insert cell
data = {
const data = new Uint32Array(size);
for (let i = 0; i < size; i++) data[i] = i;
return data;
}
Insert cell
uncompressedBytes = new Uint8Array(data.buffer)
Insert cell
compressedBytes = codec.encode(uncompressedBytes)
Insert cell
compressionRatio = uncompressedBytes.length / compressedBytes.length
Insert cell
async function getCodec(codecId) {
const cdn = 'https://cdn.skypack.dev/numcodecs';
const Module = await import(cdn + "/" + codecId);
return Module.default;
}
Insert cell
import { radio } from '@jashkenas/inputs'
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