Published
Edited
Aug 29, 2022
14 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
dataset = {
let start = performance.now();
let rv = Float64Array.from({ length: maxMillions * 1e6 }, d3.randomNormal(0));
mutable timeSpent = {
...mutable timeSpent,
dataset: performance.now() - start
};
return rv;
}
Insert cell
data = dataset.subarray(0, numPoints)
Insert cell
numPoints = 1e6 * millions
Insert cell
maxMillions = 50
Insert cell
mutable timeSpent = {}
Insert cell
results = {
let start = performance.now();
let rv = density1d(data, xBins);
mutable timeSpent = { ...mutable timeSpent, bin: performance.now() - start };
return rv;
}
Insert cell
density1d = {
let module = await import(
URL.createObjectURL(await FileAttachment("density_bins@7.js").blob())
);
await module.default(await FileAttachment("density_bins_bg@11.wasm").url());
return module.density_1d_core;
}
Insert cell
kb = {
let f = d3.format(".3s");
return (d) => f(d / 1024) + "kb";
}
Insert cell
wasmSize = (await FileAttachment("density_bins_bg@11.wasm").arrayBuffer())
.byteLength
Insert cell
jsSize = (await FileAttachment("density_bins@7.js").arrayBuffer()).byteLength
Insert cell
import { comma, details } from "@yurivish/zig-density-plot-prototype"
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