Published
Edited
Sep 1, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
for (let index = 0; index < coordinates.length; index++) {
let z = parseInt(index / (width * height));
let subtracted = parseInt(index - (z * width * height));
let y = parseInt(subtracted % height);
let x = parseInt(subtracted / width);
const coordinate = coordinates[index];
if (coordinate.z !== z) throw new Error(`z deviates from ${coordinate.z} at ${index} with ${z}`);
if (coordinate.x !== x) throw new Error(`x deviates from ${coordinate.x} at ${index} with ${x}`);
if (coordinate.y !== y) throw new Error(`y deviates from ${coordinate.y} at ${index} with ${y}`);
}
return "SUCCESS!"
}
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