Published
Edited
Nov 13, 2019
Insert cell
Insert cell
Insert cell
// distances = _.transform(nanobots, (result, bot) => {
// for (const p of inRange(bot)) {
// const l = [p.x, p.y, p.z]
// result[l] = (result[l] || 0) + 1
// }
// }, {})
Insert cell
// function* inRange(b) {
// const { x: bx, y: by, z: bz, r } = b
// for (let x = bx - r; x <= bx + r; x++) {
// for (let y = by - r; y <= by + r; y++) {
// for (let z = bz - r; z <= bz + r; z++) {
// const p = { x, y, z }
// if (distance(b, p) <= r)
// yield p
// }
// }
// }
// }
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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