Published
Edited
Apr 4, 2022
9 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
heatmap(r, { width, color })
Insert cell
r = Uint8ClampedArray.from({ length: width * height }, (_, i) => {
const a = (i % width) / step;
const b = Math.floor(i / width) / step;
return a * n - b * n === (a - b) * n;
})
Insert cell
heatmap(truth, { width, color })
Insert cell
truth = Uint8ClampedArray.from({ length: width * height }, (_, i) => {
const a = (i % width) / step;
const b = Math.floor(i / width) / step;
return a * n - b * n + b * n === a * n;
})
Insert cell
Insert cell
r2 = Uint8ClampedArray.from({ length: width * height }, (_, i) => {
const a = (i % width) / step;
const b = Math.floor(i / width) / step;
return a * n - b * n === d3.fsum([a, -b]) * n;
})
Insert cell
heatmap(r2, { width, color })
Insert cell
Insert cell
import { heatmap } from "@fil/heatmap"
Insert cell
color = (t) => (t ? "#fff" : "#000")
Insert cell
height = width
Insert cell
a = 1.2
Insert cell
b = 1.64
Insert cell
(a - b) * n
Insert cell
a * n - b * n
Insert cell
d3.fsum([a, -b]) * n
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